summaryrefslogtreecommitdiff
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorJohn Levon <levon@movementarian.org>2004-08-26 20:34:28 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-26 20:34:28 -0700
commitddebb8b659b9b56c29cf6a8db3f100a9a4b00ef3 (patch)
tree17c3d056d02cba7d37edcdb4853923bbff19f8ca /kernel/fork.c
parent6e7ca99d18d0b57aecbd760a422ab42ea256f634 (diff)
[PATCH] improve OProfile on many-way systems
Anton prompted me to get this patch merged. It changes the core buffer sync algorithm of OProfile to avoid global locks wherever possible. Anton tested an earlier version of this patch with some success. I've lightly tested this applied against 2.6.8.1-mm3 on my two-way machine. The changes also have the happy side-effect of losing less samples after munmap operations, and removing the blind spot of tasks exiting inside the kernel. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 201f7bc57719..6074fa10410a 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -36,6 +36,7 @@
#include <linux/ptrace.h>
#include <linux/mount.h>
#include <linux/audit.h>
+#include <linux/profile.h>
#include <linux/rmap.h>
#include <asm/pgtable.h>
@@ -76,11 +77,12 @@ int nr_processes(void)
static kmem_cache_t *task_struct_cachep;
#endif
-static void free_task(struct task_struct *tsk)
+void free_task(struct task_struct *tsk)
{
free_thread_info(tsk->thread_info);
free_task_struct(tsk);
}
+EXPORT_SYMBOL(free_task);
void __put_task_struct(struct task_struct *tsk)
{
@@ -93,7 +95,9 @@ void __put_task_struct(struct task_struct *tsk)
security_task_free(tsk);
free_uid(tsk->user);
put_group_info(tsk->group_info);
- free_task(tsk);
+
+ if (!profile_handoff_task(tsk))
+ free_task(tsk);
}
void fastcall add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)