aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c17
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;