linux/arch/powerpc/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
..
vdso32 powerpc: Fixup lwsync at runtime 2008-07-03 16:58:10 +10:00
vdso64 powerpc: Fixup lwsync at runtime 2008-07-03 16:58:10 +10:00
Makefile kgdb, powerpc: arch specific powerpc kgdb support 2008-07-23 11:30:15 -05:00
align.c powerpc: Add VSX load/store alignment exception handler 2008-07-15 12:29:25 +10:00
asm-offsets.c powerpc: Introduce VSX thread_struct and CONFIG_VSX 2008-07-01 11:28:46 +10:00
audit.c [PATCH] audit signal recipients 2007-05-11 05:38:25 -04:00
btext.c [POWERPC] Remove duplicate #include 2008-05-09 20:22:58 +10:00
clock.c [POWERPC] clk.h interface for platforms 2007-10-03 09:11:56 +10:00
compat_audit.c [PATCH] add SIGNAL syscall class (v3) 2007-05-11 05:38:25 -04:00
cpu_setup_6xx.S [POWERPC] ppc32: Fix errata for 603 CPUs 2008-04-21 15:00:32 -05:00
cpu_setup_44x.S Revert "[POWERPC] 4xx: Fix 460GT support to not enable FPU" 2008-06-11 07:52:40 -04:00
cpu_setup_pa6t.S [POWERPC] pasemi: Enable one more hid bit 2007-04-24 21:31:49 +10:00
cpu_setup_ppc970.S [POWERPC] powerpc: Enable DEEPNAP power savings mode on 970MP 2006-10-16 16:32:25 +10:00
cputable.c powerpc: Indicate which oprofile counters to use while in compat mode 2008-07-22 10:39:36 +10:00
crash.c powerpc: Increase CRASH_HANDLER_MAX 2008-06-30 22:31:00 +10:00
crash_dump.c powerpc: Add PPC_NOP_INSTR, a hash define for the preferred nop instruction 2008-07-01 11:28:23 +10:00
dma_64.c powerpc: move device_to_mask() to dma-mapping.h 2008-07-09 16:30:44 +10:00
entry_32.S Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build 2008-07-15 15:44:51 +10:00
entry_64.S Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build 2008-07-15 15:44:51 +10:00
firmware.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
fpu.S powerpc: Add VSX context save/restore, ptrace and signal support 2008-07-01 11:28:50 +10:00
ftrace.c ftrace: store mcount address in rec->ip 2008-06-23 22:10:56 +02:00
head_8xx.S [POWERPC] 8xx: fix swap 2008-03-07 08:42:28 -06:00
head_32.S powerpc: Make load_up_fpu and load_up_altivec callable 2008-07-01 11:28:45 +10:00
head_40x.S [POWERPC] 40x/Book-E: Save/restore volatile exception registers 2008-06-02 14:56:35 -05:00
head_44x.S powerpc: rework 4xx PTE access and TLB miss 2008-07-09 13:36:17 -04:00
head_64.S powerpc: Don't spin on sync instruction at boot time 2008-07-15 12:29:28 +10:00
head_booke.h powerpc: rework 4xx PTE access and TLB miss 2008-07-09 13:36:17 -04:00
head_fsl_booke.S powerpc/fsl: Minor TLBSYNC cleanup for FSL Book-E 2008-07-16 17:57:52 -05:00
ibmebus.c powerpc/ibmebus: more meaningful variable name 2008-07-09 16:30:46 +10:00
idle.c nohz: prevent tick stop outside of the idle loop 2008-07-18 18:10:28 +02:00
idle_6xx.S powerpc/85xx: add DOZE/NAP support for e500 core 2008-06-26 01:48:56 -05:00
idle_e500.S powerpc/e500mc: flush L2 on NAP for e500mc 2008-06-26 01:49:03 -05:00
idle_power4.S [POWERPC] powermac: Support G5 CPU hotplug 2007-05-07 20:31:13 +10:00
init_task.c [PATCH] take init_files to fs/file.c 2008-05-16 17:22:20 -04:00
io.c ftrace: support for PowerPC 2008-05-23 22:43:11 +02:00
iomap.c [POWERPC] Add 64-bit resources support to pci_iomap 2007-09-20 07:36:52 -05:00
iommu.c powerpc/dma: Use the struct dma_attrs in iommu code 2008-07-22 10:39:32 +10:00
irq.c Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build 2008-07-15 15:44:51 +10:00
isa-bridge.c [POWERPC] Remove leftover printk in isa-bridge.c 2008-05-09 20:22:59 +10:00
kgdb.c kgdb, powerpc: arch specific powerpc kgdb support 2008-07-23 11:30:15 -05:00
kprobes.c kprobes: improve kretprobe scalability with hashed locking 2008-07-25 10:53:30 -07:00
l2cr_6xx.S Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
legacy_serial.c powerpc: Fix unterminated of_device_id array in legacy_serial.c 2008-07-07 08:53:49 -07:00
lparcfg.c [POWERPC] Fix sparse warnings in arch/powerpc/kernel 2008-05-14 22:31:59 +10:00
machine_kexec.c [POWERPC] Fix crashkernel= handling when no crashkernel= specified 2008-04-30 19:49:48 +10:00
machine_kexec_32.c Storage class should be first 2006-06-26 18:57:34 +02:00
machine_kexec_64.c Merge commit 'origin/master' 2008-07-16 11:07:59 +10:00
misc.S powerpc: Add cputable entry for POWER7 2008-06-30 22:31:11 +10:00
misc_32.S powerpc/kprobes: Some minor fixes 2008-06-26 03:35:33 -05:00
misc_64.S powerpc: fix giveup_vsx to save registers correctly 2008-07-15 12:29:23 +10:00
module.c powerpc: Fixup lwsync at runtime 2008-07-03 16:58:10 +10:00
module_32.c powerpc: Move common module code into its own file 2008-07-01 11:28:05 +10:00
module_64.c powerpc: Add PPC_NOP_INSTR, a hash define for the preferred nop instruction 2008-07-01 11:28:23 +10:00
msi.c [POWERPC] Fix sparse warnings in arch/powerpc/kernel 2008-05-14 22:31:59 +10:00
nvram_64.c [POWERPC] pseries: Eliminate global error_log_cnt variable 2007-08-17 11:01:52 +10:00
of_device.c [POWERPC] Move of_device_get_modalias to drivers/of 2008-05-16 23:22:28 +10:00
of_platform.c powerpc: Add missing reference to coherent_dma_mask 2008-07-08 21:06:35 -07:00
paca.c [POWERPC] Raise the upper limit of NR_CPUS and move the pacas into the BSS 2008-04-24 20:58:04 +10:00
pci-common.c powerpc: Fix OF parsing of 64 bits PCI addresses 2008-07-22 10:39:34 +10:00
pci_32.c [POWERPC] Remove update_bridge_resource 2008-01-23 19:32:30 -06:00
pci_64.c [POWERPC] Use dev_set_name in pci_64.c 2008-06-09 11:32:40 +10:00
pci_dn.c [POWERPC] iSeries: eliminate pci_dn bussubno 2008-01-17 14:57:05 +11:00
pmc.c [POWERPC] Made FSL Book-E PMC support more generic 2008-02-05 23:34:14 -06:00
ppc32.h powerpc: Add VSX context save/restore, ptrace and signal support 2008-07-01 11:28:50 +10:00
ppc_ksyms.c Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build 2008-07-15 15:44:51 +10:00
proc_ppc64.c powerpc: use non-racy method for proc entries creation 2008-04-29 08:06:22 -07:00
process.c powerpc: fix giveup_vsx to save registers correctly 2008-07-15 12:29:23 +10:00
prom.c powerpc: Add VSX CPU feature 2008-07-01 11:28:47 +10:00
prom_init.c powerpc: Tell firmware we support architecture V2.06 2008-07-01 11:28:00 +10:00
prom_init_check.sh [POWERPC] Fix -Os kernel builds with newer gcc versions 2008-06-16 15:00:54 +10:00
prom_parse.c powerpc: Fix OF parsing of 64 bits PCI addresses 2008-07-22 10:39:34 +10:00
ptrace.c powerpc: Update for VSX core file and ptrace 2008-07-01 14:47:09 +10:00
ptrace32.c powerpc: Add macros to access floating point registers in thread_struct. 2008-07-01 11:28:43 +10:00
rtas-proc.c [POWERPC] Fix sparse warnings in arch/powerpc/kernel 2008-05-14 22:31:59 +10:00
rtas-rtc.c [PATCH] powerpc: reorg RTAS delay code 2006-06-09 21:21:06 +10:00
rtas.c Merge commit 'origin/master' 2008-07-16 11:07:59 +10:00
rtas_flash.c [POWERPC] Fix sparse warnings in arch/powerpc/kernel 2008-05-14 22:31:59 +10:00
rtas_pci.c [POWERPC] Fix sparse warnings in arch/powerpc/kernel 2008-05-14 22:31:59 +10:00
setup-common.c powerpc: Add the PC speaker only when requested 2008-06-09 13:42:30 +10:00
setup.h [PATCH] powerpc: Make early xmon logic immune to location of early parsing 2006-05-19 15:02:12 +10:00
setup_32.c kgdb, powerpc: arch specific powerpc kgdb support 2008-07-23 11:30:15 -05:00
setup_64.c powerpc: Fixup lwsync at runtime 2008-07-03 16:58:10 +10:00
signal.c [POWERPC] Define and use TLF_RESTORE_SIGMASK 2008-05-14 22:31:33 +10:00
signal.h powerpc: Clean up copy_to/from_user for vsx and fpr 2008-07-03 16:58:11 +10:00
signal_32.c powerpc: fix giveup_vsx to save registers correctly 2008-07-15 12:29:23 +10:00
signal_64.c powerpc: fix giveup_vsx to save registers correctly 2008-07-15 12:29:23 +10:00
smp-tbsync.c [POWERPC] Replace kmalloc+memset with kzalloc 2006-12-04 20:42:09 +11:00
smp.c Merge commit 'origin/master' 2008-07-16 11:07:59 +10:00
softemu8xx.c powerpc: Add macros to access floating point registers in thread_struct. 2008-07-01 11:28:43 +10:00
stacktrace.c powerpc: Fix support for latencytop 2008-07-22 10:39:33 +10:00
suspend.c PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
swsusp.c powerpc: fixup hard_irq_disable semantics 2007-05-11 08:29:34 -07:00
swsusp_32.S [POWERPC] Make altivec code in swsusp_32.S depend on CONFIG_ALTIVEC 2007-11-08 14:15:34 +11:00
swsusp_64.c [POWERPC] powermac: Suspend to disk on G5 2007-05-07 20:31:14 +10:00
swsusp_asm64.S [POWERPC] powermac: Suspend to disk on G5 2007-05-07 20:31:14 +10:00
sys_ppc32.c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2008-04-21 15:50:49 -07:00
syscalls.c powerpc/mm: Add Strong Access Ordering support 2008-07-09 16:30:45 +10:00
sysfs.c sysdev: Pass the attribute to the low level sysdev show/store function 2008-07-21 21:55:02 -07:00
systbl.S [POWERPC] Align the sys_call_table 2007-10-11 14:36:47 +10:00
systbl_chk.c [POWERPC] Fix a couple of copyright symbols 2008-01-25 22:52:50 +11:00
systbl_chk.sh [POWERPC] Fix a couple of copyright symbols 2008-01-25 22:52:50 +11:00
tau_6xx.c on_each_cpu(): kill unused 'retry' parameter 2008-06-26 11:24:38 +02:00
time.c Merge commit 'origin/master' 2008-07-16 11:07:59 +10:00
traps.c powerpc: Add VSX context save/restore, ptrace and signal support 2008-07-01 11:28:50 +10:00
udbg.c [POWERPC] Mark udbg console as CON_ANYTIME, ie. callable early in boot 2008-04-24 21:08:11 +10:00
udbg_16550.c [POWERPC] 4xx: Add early udbg support for 40x processors 2007-12-23 13:13:03 -06:00
vdso.c powerpc: Fixup lwsync at runtime 2008-07-03 16:58:10 +10:00
vecemu.c [PATCH] powerpc: Move arch/ppc*/kernel/vecemu.c to arch/powerpc 2005-09-21 19:21:07 +10:00
vector.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
vio.c [POWERPC] Replace remaining __FUNCTION__ occurrences 2008-04-01 20:43:09 +11:00
vmlinux.lds.S powerpc: Fix build bug with binutils < 2.18 and GCC < 4.2 2008-07-22 10:39:37 +10:00