Skip to content

Kprobes: scalability enhancements

Ananth N Mavinakayanahalli lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9Kprobes: rearrange preempt_disable/enable() callsarch/i386/kernel/kprobes.c arch/ia64/kernel/kprobes.c arch/ppc64/kernel/kprobes.c +2 more+61 -520 replies
2/9Kprobes: Track kprobe on a per_cpu basis - base changesinclude/linux/kprobes.h kernel/kprobes.c+50 -240 replies
3/9Kprobes: Track kprobe on a per_cpu basis - i386 changesarch/i386/kernel/kprobes.c include/asm-i386/kprobes.h+86 -570 replies
4/9Kprobes: Track kprobe on a per_cpu basis - ia64 changesarch/ia64/kernel/kprobes.c include/asm-ia64/kprobes.h+58 -380 replies
5/9Kprobes: Track kprobe on a per_cpu basis - ppc64 changesarch/ppc64/kernel/kprobes.c include/asm-ppc64/kprobes.h+69 -400 replies
6/9Kprobes: Track kprobe on a per_cpu basis - sparc64 changesarch/sparc64/kernel/kprobes.c include/asm-sparc64/kprobes.h+87 -640 replies
7/9Kprobes: Track kprobe on a per_cpu basis - x86_64 changesarch/x86_64/kernel/kprobes.c include/asm-x86_64/kprobes.h+89 -590 replies
8/9Kprobes: Use RCU for (un)register synchronization - base changesinclude/linux/kprobes.h kernel/kprobes.c+45 -654 replies
9/9Kprobes: Use RCU for (un)register synchronization - arch changesarch/i386/kernel/kprobes.c arch/ia64/kernel/kprobes.c arch/ppc64/kernel/kprobes.c +2 more+27 -743 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] Kprobes: scalability enhancements

Hi,

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.

Ananth