linux/arch/s390/kernel
Srinivasa D S ef53d9c5e4 kprobes: improve kretprobe scalability with hashed locking
Currently list of kretprobe instances are stored in kretprobe object (as
used_instances,free_instances) and in kretprobe hash table.  We have one
global kretprobe lock to serialise the access to these lists.  This causes
only one kretprobe handler to execute at a time.  Hence affects system
performance, particularly on SMP systems and when return probe is set on
lot of functions (like on all systemcalls).

Solution proposed here gives fine-grain locks that performs better on SMP
system compared to present kretprobe implementation.

Solution:

 1) Instead of having one global lock to protect kretprobe instances
    present in kretprobe object and kretprobe hash table.  We will have
    two locks, one lock for protecting kretprobe hash table and another
    lock for kretporbe object.

 2) We hold lock present in kretprobe object while we modify kretprobe
    instance in kretprobe object and we hold per-hash-list lock while
    modifying kretprobe instances present in that hash list.  To prevent
    deadlock, we never grab a per-hash-list lock while holding a kretprobe
    lock.

 3) We can remove used_instances from struct kretprobe, as we can
    track used instances of kretprobe instances using kretprobe hash
    table.

Time duration for kernel compilation ("make -j 8") on a 8-way ppc64 system
with return probes set on all systemcalls looks like this.

cacheline              non-cacheline             Un-patched kernel
aligned patch 	       aligned patch
===============================================================================
real    9m46.784s       9m54.412s                  10m2.450s
user    40m5.715s       40m7.142s                  40m4.273s
sys     2m57.754s       2m58.583s                  3m17.430s
===========================================================

Time duration for kernel compilation ("make -j 8) on the same system, when
kernel is not probed.
=========================
real    9m26.389s
user    40m8.775s
sys     2m7.283s
=========================

Signed-off-by: Srinivasa DS <srinivasa@in.ibm.com>
Signed-off-by: Jim Keniston <jkenisto@us.ibm.com>
Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-25 10:53:30 -07:00
..
asm-offsets.c s390: use kbuild.h instead of defining macros in asm-offsets.c 2008-04-29 08:06:30 -07:00
audit.c [S390] Get rid of a bunch of sparse warnings again. 2007-10-12 16:13:06 +02:00
audit.h [S390] Get rid of a bunch of sparse warnings again. 2007-10-12 16:13:06 +02:00
base.S [S390] Convert memory detection into C code. 2007-02-05 21:18:37 +01:00
bitmap.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
compat_audit.c [S390] Get rid of a bunch of sparse warnings again. 2007-10-12 16:13:06 +02:00
compat_exec_domain.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
compat_linux.c arch: Remove unnecessary inclusions of asm/semaphore.h 2008-04-18 22:14:49 -04:00
compat_linux.h [S390] Fix a lot of sparse warnings. 2008-04-17 07:47:06 +02:00
compat_ptrace.h [S390] Introduce user_regset accessors for s390 2008-07-14 10:02:09 +02:00
compat_signal.c [S390] Fix a lot of sparse warnings. 2008-04-17 07:47:06 +02:00
compat_wrapper.S [S390] compat ptrace cleanup 2008-05-07 09:23:02 +02:00
cpcmd.c [S390] cpcmd: fix inline assembly usage. 2007-10-12 16:13:09 +02:00
crash.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
debug.c [S390] Cleanup s390 debug feature print messages. 2008-07-14 10:02:22 +02:00
diag.c [S390] vmur: fix diag14 exceptions with addresses > 2GB. 2007-08-22 13:51:47 +02:00
dis.c [S390] disassembler: fix idte instruction format. 2008-05-30 10:03:36 +02:00
early.c [S390] Remove P390 support. 2008-07-14 10:02:25 +02:00
ebcdic.c [S390] Get rid of a lot of sparse warnings. 2007-02-05 21:16:47 +01:00
entry64.S [S390] s390-kvm: leave sie context on work. Removes preemption requirement 2008-05-07 09:23:01 +02:00
entry.h [S390] Fix a lot of sparse warnings. 2008-04-17 07:47:06 +02:00
entry.S [S390] s390: Optimize user and work TIF check 2008-05-07 09:23:00 +02:00
head31.S [S390] Convert machine feature detection code to C. 2008-04-30 13:38:47 +02:00
head64.S [S390] System z large page support. 2008-04-30 13:38:47 +02:00
head.S [S390] Get rid of new section mismatch warnings. 2007-07-27 12:29:18 +02:00
init_task.c [PATCH] take init_files to fs/file.c 2008-05-16 17:22:20 -04:00
ipl.c [S390] s390: use memory_read_from_buffer() 2008-07-14 10:02:16 +02:00
irq.c [S390] show_interrupts: prevent cpu hotplug when walking cpu_online_map. 2008-05-15 16:52:41 +02:00
kprobes.c kprobes: improve kretprobe scalability with hashed locking 2008-07-25 10:53:30 -07:00
machine_kexec.c [S390] Cleanup kprobes printk messages. 2008-07-14 10:02:24 +02:00
Makefile [S390] Move memory detection code to own file. 2008-07-14 10:02:17 +02:00
mem_detect.c [S390] Move memory detection code to own file. 2008-07-14 10:02:17 +02:00
module.c [S390] Use generic bug. 2007-04-27 16:01:42 +02:00
process.c nohz: adjust tick_nohz_stop_sched_tick() call of s390 as well 2008-07-19 09:44:33 +02:00
ptrace.c [S390] Introduce user_regset accessors for s390 2008-07-14 10:02:09 +02:00
reipl64.S [S390] reipl: move dump_prefix_page out of text section. 2007-03-05 23:35:43 +01:00
reipl.S [S390] reipl: move dump_prefix_page out of text section. 2007-03-05 23:35:43 +01:00
relocate_kernel64.S [S390] Reset infrastructure for re-IPL. 2006-12-04 15:40:26 +01:00
relocate_kernel.S [S390] Reset infrastructure for re-IPL. 2006-12-04 15:40:26 +01:00
s390_ext.c [S390] Fix a lot of sparse warnings. 2008-04-17 07:47:06 +02:00
s390_ksyms.c Generic semaphore implementation 2008-04-17 10:42:34 -04:00
setup.c s390: use virtio_console for KVM on s390 2008-07-25 12:06:07 +10:00
signal.c [S390] Fix a lot of sparse warnings. 2008-04-17 07:47:06 +02:00
smp.c sysdev: Pass the attribute to the low level sysdev show/store function 2008-07-21 21:55:02 -07:00
stacktrace.c [S390] Fix stacktrace compile bug. 2008-07-17 17:22:09 +02:00
sys_s390.c unified (weak) sys_pipe implementation 2008-05-03 13:50:33 -07:00
syscalls.S [S390] Wire up new timerfd syscalls. 2008-02-09 18:24:37 +01:00
time.c sysdev: Pass the attribute to the low level sysdev show/store function 2008-07-21 21:55:02 -07:00
topology.c [S390] arch/s390: Eliminate NULL test and memset after alloc_bootmem 2008-07-14 10:02:14 +02:00
traps.c [S390] Move show_regs to traps.c. 2008-04-30 13:38:43 +02:00
vmlinux.lds.S move BUG_TABLE into RODATA 2008-05-25 07:06:08 +02:00
vtime.c [S390] Cleanup vtime printk messages. 2008-07-14 10:02:18 +02:00