linux/arch/ia64/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
..
cpufreq [IA64] improper printk format in acpi-cpufreq 2008-07-17 11:11:17 -07:00
.gitignore [IA64] Add gate.lds to list of files ignored by Git 2007-11-06 15:39:45 -08:00
acpi-ext.c Pull acpi_os_free into release branch 2006-07-01 17:19:08 -04:00
acpi-processor.c ACPI: Set _PSD ACPI_PDC_SMP_T_SWCOORD 2008-02-02 02:22:43 -05:00
acpi.c [IA64] Avoid overflowing ia64_cpu_to_sapicid in acpi_map_lsapic() 2008-07-17 11:24:42 -07:00
asm-offsets.c ia64: use kbuild.h macros instead of defining macros in asm-offsets.c 2008-04-29 08:06:29 -07:00
audit.c [PATCH] audit signal recipients 2007-05-11 05:38:25 -04:00
brl_emu.c
crash.c [IA64] simplify notify hooks in mca.c 2008-04-22 08:56:38 -07:00
crash_dump.c [IA64] kexec: Minor enhancement to includes in crash.c 2007-02-05 11:31:04 -08:00
cyclone.c cyclone.c: silly use of volatile, __iomem fixes 2007-07-26 11:11:57 -07:00
efi.c [IA64] Kernel parameter for max number of concurrent global TLB purges 2008-04-04 11:06:38 -07:00
efi_stub.S [IA64] make efi_stub.S fit in 80 cols 2006-06-21 14:35:28 -07:00
entry.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
entry.S [IA64] pvops: paravirtualize entry.S 2008-05-27 15:08:01 -07:00
err_inject.c sysdev: Pass the attribute to the low level sysdev show/store function 2008-07-21 21:55:02 -07:00
esi.c [IA64] esi-support 2006-06-21 11:19:22 -07:00
esi_stub.S [IA64] esi-support 2006-06-21 11:19:22 -07:00
fsys.S Pull miscellaneous into release branch 2008-04-17 10:14:51 -07:00
fsyscall_gtod_data.h [IA64] generalize attribute of fsyscall_gtod_data 2008-02-04 15:36:36 -08:00
gate-data.S
gate.lds.S [IA64] increase .data.patch offset 2007-12-07 14:28:02 -08:00
gate.S [IA64] Stop bit for brl instruction 2007-07-09 13:37:44 -07:00
head.S [IA64] pvops: add an early setup hook for pv_ops. 2008-05-27 14:39:54 -07:00
ia64_ksyms.c Generic semaphore implementation 2008-04-17 10:42:34 -04:00
init_task.c [PATCH] take init_files to fs/file.c 2008-05-16 17:22:20 -04:00
iosapic.c Pull pvops into release branch 2008-07-17 10:53:37 -07:00
irq.c [IA64] fix section mismatch in arch/ia64/kernel/irq.c 2008-04-30 14:08:01 -07:00
irq_ia64.c [IA64] pvops: add hooks, pv_irq_ops, to paravirtualized irq related operations. 2008-05-27 15:11:10 -07:00
irq_lsapic.c [IA64] spelling fixes: arch/ia64/ 2007-05-11 14:55:43 -07:00
ivt.S [IA64] pv_ops: move some functions in ivt.S to avoid lack of space. 2008-05-28 09:41:58 -07:00
jprobes.S [IA64] enable trap code on slot 1 2006-12-12 12:00:55 -08:00
kprobes.c kprobes: improve kretprobe scalability with hashed locking 2008-07-25 10:53:30 -07:00
machine_kexec.c vmcoreinfo: fix the configuration dependencies 2008-02-07 08:42:25 -08:00
machvec.c [IA64] Ensure that machvec is set up takes place before serial console 2007-07-25 11:12:47 -07:00
Makefile [IA64] pvops: paravirtualize NR_IRQS 2008-05-27 15:09:30 -07:00
mca.c on_each_cpu(): kill unused 'retry' parameter 2008-06-26 11:24:38 +02:00
mca_asm.S [IA64] Add API for allocating Dynamic TR resource. 2008-04-03 11:02:58 -07:00
mca_drv.c [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
mca_drv.h [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
mca_drv_asm.S [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
minstate.h [IA64] pvops: paravirtualize minstate.h. 2008-05-27 15:02:17 -07:00
module.c [IA64] adding parameter check to module_free() 2008-07-17 11:22:01 -07:00
msi_ia64.c [IA64] Fix irq migration in multiple vector domain 2008-03-04 14:16:20 -08:00
nr-irqs.c [IA64] pvops: paravirtualize NR_IRQS 2008-05-27 15:09:30 -07:00
numa.c [IA64] Minimize per_cpu reservations. 2008-04-08 13:51:35 -07:00
pal.S [IA64] reformat pal.S to fit in 80 columns, fix typos 2006-10-17 14:54:19 -07:00
palinfo.c smp_call_function: get rid of the unused nonatomic/retry argument 2008-06-26 11:24:35 +02:00
paravirt.c [IA64] pvops: add to hooks, pv_time_ops, for steal time accounting. 2008-05-27 15:11:42 -07:00
paravirt_inst.h [IA64] pvops: paravirtualize minstate.h. 2008-05-27 15:02:17 -07:00
paravirtentry.S [IA64] pvops: paravirtualize entry.S 2008-05-27 15:08:01 -07:00
patch.c [IA64] Workaround for RSE issue 2008-05-27 13:24:39 -07:00
perfmon.c on_each_cpu(): kill unused 'retry' parameter 2008-06-26 11:24:38 +02:00
perfmon_default_smpl.c [IA64] remove remaining __FUNCTION__ occurrences 2008-03-06 09:19:27 -08:00
perfmon_generic.h
perfmon_itanium.h
perfmon_mckinley.h [IA64] spelling fixes: arch/ia64/ 2007-05-11 14:55:43 -07:00
perfmon_montecito.h [IA64] sparse cleanups 2006-12-07 10:48:19 -08:00
process.c ACPI : Create "idle=nomwait" bootparam 2008-07-16 23:27:05 +02:00
ptrace.c [IA64] remove duplicate code for register access 2008-03-12 16:28:02 -07:00
relocate_kernel.S [IA64] Removal of percpu TR cleanup in kexec code 2007-05-08 10:00:28 -07:00
sal.c [IA64] Update check_sal_cache_flush to use platform_send_ipi() 2008-06-11 16:40:33 -07:00
salinfo.c ia64: use non-racy method for proc entries creation 2008-04-29 08:06:21 -07:00
setup.c Pull pvops into release branch 2008-07-17 10:53:37 -07:00
sigframe.h [IA64] Add TIF_RESTORE_SIGMASK 2007-05-08 14:51:59 -07:00
signal.c [IA64] TS_RESTORE_SIGMASK 2008-05-01 14:29:44 -07:00
smp.c on_each_cpu(): kill unused 'retry' parameter 2008-06-26 11:24:38 +02:00
smpboot.c Pull pvops into release branch 2008-07-17 10:53:37 -07:00
sys_ia64.c flag parameters: pipe 2008-07-24 10:47:28 -07:00
time.c Pull pvops into release branch 2008-07-17 10:53:37 -07:00
topology.c [IA64] fix section mismatch in arch/ia64/kernel/topology.c 2008-04-30 14:08:07 -07:00
traps.c [IA64] honor notify_die() returning NOTIFY_STOP 2008-02-05 08:26:44 -08:00
unaligned.c [IA64] arch/ia64/kernel/: use time_* macros 2008-04-09 10:38:30 -07:00
uncached.c smp_call_function: get rid of the unused nonatomic/retry argument 2008-06-26 11:24:35 +02:00
unwind.c [IA64] remove remaining __FUNCTION__ occurrences 2008-03-06 09:19:27 -08:00
unwind_decoder.c
unwind_i.h
vmlinux.lds.S [IA64] pvops: preparation: move the constants, LOAD_OFFSET, to a header file. 2008-05-27 14:38:18 -07:00