aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 32cbf2607cb0..fbb5d94c8bbc 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -158,6 +158,9 @@ static void delayed_put_task_struct(struct rcu_head *rhp)
158{ 158{
159 struct task_struct *tsk = container_of(rhp, struct task_struct, rcu); 159 struct task_struct *tsk = container_of(rhp, struct task_struct, rcu);
160 160
161#ifdef CONFIG_PERF_COUNTERS
162 WARN_ON_ONCE(!list_empty(&tsk->perf_counter_ctx.counter_list));
163#endif
161 trace_sched_process_free(tsk); 164 trace_sched_process_free(tsk);
162 put_task_struct(tsk); 165 put_task_struct(tsk);
163} 166}
@@ -979,10 +982,6 @@ NORET_TYPE void do_exit(long code)
979 tsk->mempolicy = NULL; 982 tsk->mempolicy = NULL;
980#endif 983#endif
981#ifdef CONFIG_FUTEX 984#ifdef CONFIG_FUTEX
982 /*
983 * This must happen late, after the PID is not
984 * hashed anymore:
985 */
986 if (unlikely(!list_empty(&tsk->pi_state_list))) 985 if (unlikely(!list_empty(&tsk->pi_state_list)))
987 exit_pi_state_list(tsk); 986 exit_pi_state_list(tsk);
988 if (unlikely(current->pi_state_cache)) 987 if (unlikely(current->pi_state_cache))
@@ -1249,6 +1248,12 @@ static int wait_task_zombie(struct task_struct *p, int options,
1249 */ 1248 */
1250 read_unlock(&tasklist_lock); 1249 read_unlock(&tasklist_lock);
1251 1250
1251 /*
1252 * Flush inherited counters to the parent - before the parent
1253 * gets woken up by child-exit notifications.
1254 */
1255 perf_counter_exit_task(p);
1256
1252 retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0; 1257 retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0;
1253 status = (p->signal->flags & SIGNAL_GROUP_EXIT) 1258 status = (p->signal->flags & SIGNAL_GROUP_EXIT)
1254 ? p->signal->group_exit_code : p->exit_code; 1259 ? p->signal->group_exit_code : p->exit_code;