diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-17 14:10:57 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-23 12:45:14 +0100 |
commit | aa9c4c0f967fdb482ea95e8473ec3d201e6e0781 (patch) | |
tree | 8223d34630b7d3130825e8a2197e9bb51c34b7fa /kernel/exit.c | |
parent | 7671581f1666ef4b54a1c1e598c51ac44c060a9b (diff) | |
download | op-kernel-dev-aa9c4c0f967fdb482ea95e8473ec3d201e6e0781.zip op-kernel-dev-aa9c4c0f967fdb482ea95e8473ec3d201e6e0781.tar.gz |
perfcounters: fix task clock counter
Impact: fix per task clock counter precision
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index d336c90..244edfd 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -922,6 +922,12 @@ static void exit_notify(struct task_struct *tsk, int group_dead) forget_original_parent(tsk); exit_task_namespaces(tsk); + /* + * Flush inherited counters to the parent - before the parent + * gets woken up by child-exit notifications. + */ + perf_counter_exit_task(tsk); + write_lock_irq(&tasklist_lock); if (group_dead) kill_orphaned_pgrp(tsk->group_leader, NULL); @@ -1093,11 +1099,6 @@ NORET_TYPE void do_exit(long code) mpol_put(tsk->mempolicy); tsk->mempolicy = NULL; #endif - /* - * These must happen late, after the PID is not - * hashed anymore, but still at a point that may sleep: - */ - perf_counter_exit_task(tsk); #ifdef CONFIG_FUTEX if (unlikely(!list_empty(&tsk->pi_state_list))) exit_pi_state_list(tsk); @@ -1121,6 +1122,12 @@ NORET_TYPE void do_exit(long code) if (tsk->splice_pipe) __free_pipe_info(tsk->splice_pipe); + /* + * These must happen late, after the PID is not + * hashed anymore, but still at a point that may sleep: + */ + perf_counter_exit_task(tsk); + preempt_disable(); /* causes final put_task_struct in finish_task_switch(). */ tsk->state = TASK_DEAD; |