diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-17 08:10:57 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-23 06:45:14 -0500 |
commit | aa9c4c0f967fdb482ea95e8473ec3d201e6e0781 (patch) | |
tree | 8223d34630b7d3130825e8a2197e9bb51c34b7fa /kernel/exit.c | |
parent | 7671581f1666ef4b54a1c1e598c51ac44c060a9b (diff) |
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 d336c90a5f13..244edfd96865 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -922,6 +922,12 @@ static void exit_notify(struct task_struct *tsk, int group_dead) | |||
922 | forget_original_parent(tsk); | 922 | forget_original_parent(tsk); |
923 | exit_task_namespaces(tsk); | 923 | exit_task_namespaces(tsk); |
924 | 924 | ||
925 | /* | ||
926 | * Flush inherited counters to the parent - before the parent | ||
927 | * gets woken up by child-exit notifications. | ||
928 | */ | ||
929 | perf_counter_exit_task(tsk); | ||
930 | |||
925 | write_lock_irq(&tasklist_lock); | 931 | write_lock_irq(&tasklist_lock); |
926 | if (group_dead) | 932 | if (group_dead) |
927 | kill_orphaned_pgrp(tsk->group_leader, NULL); | 933 | kill_orphaned_pgrp(tsk->group_leader, NULL); |
@@ -1093,11 +1099,6 @@ NORET_TYPE void do_exit(long code) | |||
1093 | mpol_put(tsk->mempolicy); | 1099 | mpol_put(tsk->mempolicy); |
1094 | tsk->mempolicy = NULL; | 1100 | tsk->mempolicy = NULL; |
1095 | #endif | 1101 | #endif |
1096 | /* | ||
1097 | * These must happen late, after the PID is not | ||
1098 | * hashed anymore, but still at a point that may sleep: | ||
1099 | */ | ||
1100 | perf_counter_exit_task(tsk); | ||
1101 | #ifdef CONFIG_FUTEX | 1102 | #ifdef CONFIG_FUTEX |
1102 | if (unlikely(!list_empty(&tsk->pi_state_list))) | 1103 | if (unlikely(!list_empty(&tsk->pi_state_list))) |
1103 | exit_pi_state_list(tsk); | 1104 | exit_pi_state_list(tsk); |
@@ -1121,6 +1122,12 @@ NORET_TYPE void do_exit(long code) | |||
1121 | if (tsk->splice_pipe) | 1122 | if (tsk->splice_pipe) |
1122 | __free_pipe_info(tsk->splice_pipe); | 1123 | __free_pipe_info(tsk->splice_pipe); |
1123 | 1124 | ||
1125 | /* | ||
1126 | * These must happen late, after the PID is not | ||
1127 | * hashed anymore, but still at a point that may sleep: | ||
1128 | */ | ||
1129 | perf_counter_exit_task(tsk); | ||
1130 | |||
1124 | preempt_disable(); | 1131 | preempt_disable(); |
1125 | /* causes final put_task_struct in finish_task_switch(). */ | 1132 | /* causes final put_task_struct in finish_task_switch(). */ |
1126 | tsk->state = TASK_DEAD; | 1133 | tsk->state = TASK_DEAD; |