• Ananth N Mavinakayanahalli's avatar
    [PATCH] Kprobes: rearrange preempt_disable/enable() calls · 66ff2d06
    Ananth N Mavinakayanahalli authored
    The following set of patches are aimed at improving kprobes scalability.  We
    currently serialize kprobe registration, unregistration and handler execution
    using a single spinlock - kprobe_lock.
    
    With these changes, kprobe handlers can run without any locks held.  It also
    allows for simultaneous kprobe handler executions on different processors as
    we now track kprobe execution on a per processor basis.  It is now necessary
    that the handlers be re-entrant since handlers can run concurrently on
    multiple processors.
    
    All changes have been tested on i386, ia64, ppc64 and x86_64, while sparc64
    has been compile tested only.
    
    The patches can be viewed as 3 logical chunks:
    
    patch 1: 	Reorder preempt_(dis/en)able calls
    patches 2-7: 	Introduce per_cpu data areas to track kprobe execution
    patches 8-9: 	Use RCU to synchronize kprobe (un)registration and handler
    		execution.
    
    Thanks to Maneesh Soni, James Keniston and Anil Keshavamurthy for their
    review and suggestions. Thanks again to Anil, Hien Nguyen and Kevin Stafford
    for testing the patches.
    
    This patch:
    
    Reorder preempt_disable/enable() calls in arch kprobes files in preparation to
    introduce locking changes.  No functional changes introduced by this patch.
    Signed-off-by: default avatarAnanth N Mavinakayahanalli <ananth@in.ibm.com>
    Signed-off-by: default avatarAnil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    66ff2d06
kprobes.c 20.9 KB