Archived
14
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/arch
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
..
alpha inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
arm kprobes: improve kretprobe scalability with hashed locking 2008-07-25 10:53:30 -07:00
avr32 Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-07-24 12:55:01 -07:00
blackfin Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-07-24 12:55:01 -07:00
cris inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
frv remove include/linux/pm_legacy.h 2008-07-24 10:47:22 -07:00
h8300 inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
ia64 kprobes: improve kretprobe scalability with hashed locking 2008-07-25 10:53:30 -07:00
m32r inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
m68k PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
m68knommu Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2008-07-24 12:17:19 -07:00
mips Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-07-24 12:55:01 -07:00
mn10300 inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
parisc flag parameters: pipe 2008-07-24 10:47:28 -07:00
powerpc kprobes: improve kretprobe scalability with hashed locking 2008-07-25 10:53:30 -07:00
s390 kprobes: improve kretprobe scalability with hashed locking 2008-07-25 10:53:30 -07:00
sh inflate: refactor inflate malloc code 2008-07-25 10:53:28 -07:00
sparc flag parameters: pipe 2008-07-24 10:47:28 -07:00
sparc64 kprobes: improve kretprobe scalability with hashed locking 2008-07-25 10:53:30 -07:00
um Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-07-24 12:55:01 -07:00
x86 kprobes: improve kretprobe scalability with hashed locking 2008-07-25 10:53:30 -07:00
xtensa flag parameters: pipe 2008-07-24 10:47:28 -07:00
.gitignore
Kconfig introduce HAVE_EFFICIENT_UNALIGNED_ACCESS Kconfig symbol 2008-07-25 10:53:27 -07:00