From f835224b306eff3ede9bcf156939dba2dc8e9d98 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sun, 17 May 2009 11:08:41 +0200 Subject: [PATCH] --- yaml --- r: 147475 b: refs/heads/master c: 33b2fb303fe7f6b08bbb32f708e67b96eaa94a7a h: refs/heads/master i: 147473: ac0874b980596346afaf87baa76c714fb7654afa 147471: 8a612005bac63b448426f15ca5ecb9988c7e3423 v: v3 --- [refs] | 2 +- trunk/kernel/exit.c | 19 +++++++------------ trunk/kernel/perf_counter.c | 2 ++ 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index e2e87dacc1a2..e9ab8e9df4c0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b68f1d2e7aa21029d73c7d453a8046e95d351740 +refs/heads/master: 33b2fb303fe7f6b08bbb32f708e67b96eaa94a7a diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index 73affd35e76d..f9dfedd94af0 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -178,12 +178,6 @@ void release_task(struct task_struct * p) proc_flush_task(p); - /* - * Flush inherited counters to the parent - before the parent - * gets woken up by child-exit notifications. - */ - perf_counter_exit_task(p); - write_lock_irq(&tasklist_lock); tracehook_finish_release_task(p); __exit_signal(p); @@ -985,6 +979,13 @@ NORET_TYPE void do_exit(long code) module_put(tsk->binfmt->module); proc_exit_connector(tsk); + + /* + * Flush inherited counters to the parent - before the parent + * gets woken up by child-exit notifications. + */ + perf_counter_exit_task(tsk); + exit_notify(tsk, group_dead); #ifdef CONFIG_NUMA mpol_put(tsk->mempolicy); @@ -1257,12 +1258,6 @@ static int wait_task_zombie(struct task_struct *p, int options, */ read_unlock(&tasklist_lock); - /* - * Flush inherited counters to the parent - before the parent - * gets woken up by child-exit notifications. - */ - perf_counter_exit_task(p); - retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0; status = (p->signal->flags & SIGNAL_GROUP_EXIT) ? p->signal->group_exit_code : p->exit_code; diff --git a/trunk/kernel/perf_counter.c b/trunk/kernel/perf_counter.c index 59a926d04baf..7af16d1c480f 100644 --- a/trunk/kernel/perf_counter.c +++ b/trunk/kernel/perf_counter.c @@ -3299,6 +3299,8 @@ void perf_counter_exit_task(struct task_struct *child) struct perf_counter *child_counter, *tmp; struct perf_counter_context *child_ctx; + WARN_ON_ONCE(child != current); + child_ctx = &child->perf_counter_ctx; if (likely(!child_ctx->nr_counters))