diff options
author | bibo mao <bibo_mao@linux.intel.com> | 2006-03-26 04:38:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:57:04 -0500 |
commit | c6fd91f0bdcd294a0ae0ba2b2a7f7456ef4b7144 (patch) | |
tree | 1d095d1761a44118f101b2ce9697346ff168753a /arch | |
parent | c9becf58d935265919bf1cb348b2c04492c8949d (diff) |
[PATCH] kretprobe instance recycled by parent process
When kretprobe probes the schedule() function, if the probed process exits
then schedule() will never return, so some kretprobe instances will never
be recycled.
In this patch the parent process will recycle retprobe instances of the
probed function and there will be no memory leak of kretprobe instances.
Signed-off-by: bibo mao <bibo.mao@intel.com>
Cc: Masami Hiramatsu <hiramatu@sdl.hitachi.co.jp>
Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/process.c | 8 | ||||
-rw-r--r-- | arch/ia64/kernel/process.c | 8 | ||||
-rw-r--r-- | arch/powerpc/kernel/process.c | 2 | ||||
-rw-r--r-- | arch/x86_64/kernel/process.c | 9 |
4 files changed, 1 insertions, 26 deletions
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c index 299e61674084..24b3e745478b 100644 --- a/arch/i386/kernel/process.c +++ b/arch/i386/kernel/process.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include <linux/kallsyms.h> | 38 | #include <linux/kallsyms.h> |
39 | #include <linux/ptrace.h> | 39 | #include <linux/ptrace.h> |
40 | #include <linux/random.h> | 40 | #include <linux/random.h> |
41 | #include <linux/kprobes.h> | ||
42 | 41 | ||
43 | #include <asm/uaccess.h> | 42 | #include <asm/uaccess.h> |
44 | #include <asm/pgtable.h> | 43 | #include <asm/pgtable.h> |
@@ -364,13 +363,6 @@ void exit_thread(void) | |||
364 | struct task_struct *tsk = current; | 363 | struct task_struct *tsk = current; |
365 | struct thread_struct *t = &tsk->thread; | 364 | struct thread_struct *t = &tsk->thread; |
366 | 365 | ||
367 | /* | ||
368 | * Remove function-return probe instances associated with this task | ||
369 | * and put them back on the free list. Do not insert an exit probe for | ||
370 | * this function, it will be disabled by kprobe_flush_task if you do. | ||
371 | */ | ||
372 | kprobe_flush_task(tsk); | ||
373 | |||
374 | /* The process may have allocated an io port bitmap... nuke it. */ | 366 | /* The process may have allocated an io port bitmap... nuke it. */ |
375 | if (unlikely(NULL != t->io_bitmap_ptr)) { | 367 | if (unlikely(NULL != t->io_bitmap_ptr)) { |
376 | int cpu = get_cpu(); | 368 | int cpu = get_cpu(); |
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index 309d59658e5f..355d57970ba3 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <linux/efi.h> | 30 | #include <linux/efi.h> |
31 | #include <linux/interrupt.h> | 31 | #include <linux/interrupt.h> |
32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
33 | #include <linux/kprobes.h> | ||
34 | 33 | ||
35 | #include <asm/cpu.h> | 34 | #include <asm/cpu.h> |
36 | #include <asm/delay.h> | 35 | #include <asm/delay.h> |
@@ -738,13 +737,6 @@ void | |||
738 | exit_thread (void) | 737 | exit_thread (void) |
739 | { | 738 | { |
740 | 739 | ||
741 | /* | ||
742 | * Remove function-return probe instances associated with this task | ||
743 | * and put them back on the free list. Do not insert an exit probe for | ||
744 | * this function, it will be disabled by kprobe_flush_task if you do. | ||
745 | */ | ||
746 | kprobe_flush_task(current); | ||
747 | |||
748 | ia64_drop_fpu(current); | 740 | ia64_drop_fpu(current); |
749 | #ifdef CONFIG_PERFMON | 741 | #ifdef CONFIG_PERFMON |
750 | /* if needed, stop monitoring and flush state to perfmon context */ | 742 | /* if needed, stop monitoring and flush state to perfmon context */ |
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 1770a066c217..f698aa77127e 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <linux/mqueue.h> | 35 | #include <linux/mqueue.h> |
36 | #include <linux/hardirq.h> | 36 | #include <linux/hardirq.h> |
37 | #include <linux/utsname.h> | 37 | #include <linux/utsname.h> |
38 | #include <linux/kprobes.h> | ||
39 | 38 | ||
40 | #include <asm/pgtable.h> | 39 | #include <asm/pgtable.h> |
41 | #include <asm/uaccess.h> | 40 | #include <asm/uaccess.h> |
@@ -460,7 +459,6 @@ void show_regs(struct pt_regs * regs) | |||
460 | 459 | ||
461 | void exit_thread(void) | 460 | void exit_thread(void) |
462 | { | 461 | { |
463 | kprobe_flush_task(current); | ||
464 | discard_lazy_cpu_state(); | 462 | discard_lazy_cpu_state(); |
465 | } | 463 | } |
466 | 464 | ||
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c index 81111835722d..0370720515f1 100644 --- a/arch/x86_64/kernel/process.c +++ b/arch/x86_64/kernel/process.c | |||
@@ -35,8 +35,8 @@ | |||
35 | #include <linux/ptrace.h> | 35 | #include <linux/ptrace.h> |
36 | #include <linux/utsname.h> | 36 | #include <linux/utsname.h> |
37 | #include <linux/random.h> | 37 | #include <linux/random.h> |
38 | #include <linux/kprobes.h> | ||
39 | #include <linux/notifier.h> | 38 | #include <linux/notifier.h> |
39 | #include <linux/kprobes.h> | ||
40 | 40 | ||
41 | #include <asm/uaccess.h> | 41 | #include <asm/uaccess.h> |
42 | #include <asm/pgtable.h> | 42 | #include <asm/pgtable.h> |
@@ -353,13 +353,6 @@ void exit_thread(void) | |||
353 | struct task_struct *me = current; | 353 | struct task_struct *me = current; |
354 | struct thread_struct *t = &me->thread; | 354 | struct thread_struct *t = &me->thread; |
355 | 355 | ||
356 | /* | ||
357 | * Remove function-return probe instances associated with this task | ||
358 | * and put them back on the free list. Do not insert an exit probe for | ||
359 | * this function, it will be disabled by kprobe_flush_task if you do. | ||
360 | */ | ||
361 | kprobe_flush_task(me); | ||
362 | |||
363 | if (me->thread.io_bitmap_ptr) { | 356 | if (me->thread.io_bitmap_ptr) { |
364 | struct tss_struct *tss = &per_cpu(init_tss, get_cpu()); | 357 | struct tss_struct *tss = &per_cpu(init_tss, get_cpu()); |
365 | 358 | ||