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 6686ed1e4aa3..7a14a2b504f5 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}
@@ -980,10 +983,6 @@ NORET_TYPE void do_exit(long code)
980 tsk->mempolicy = NULL; 983 tsk->mempolicy = NULL;
981#endif 984#endif
982#ifdef CONFIG_FUTEX 985#ifdef CONFIG_FUTEX
983 /*
984 * This must happen late, after the PID is not
985 * hashed anymore:
986 */
987 if (unlikely(!list_empty(&tsk->pi_state_list))) 986 if (unlikely(!list_empty(&tsk->pi_state_list)))
988 exit_pi_state_list(tsk); 987 exit_pi_state_list(tsk);
989 if (unlikely(current->pi_state_cache)) 988 if (unlikely(current->pi_state_cache))
@@ -1250,6 +1249,12 @@ static int wait_task_zombie(struct task_struct *p, int options,
1250 */ 1249 */
1251 read_unlock(&tasklist_lock); 1250 read_unlock(&tasklist_lock);
1252 1251
1252 /*
1253 * Flush inherited counters to the parent - before the parent
1254 * gets woken up by child-exit notifications.
1255 */
1256 perf_counter_exit_task(p);
1257
1253 retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0; 1258 retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0;
1254 status = (p->signal->flags & SIGNAL_GROUP_EXIT) 1259 status = (p->signal->flags & SIGNAL_GROUP_EXIT)
1255 ? p->signal->group_exit_code : p->exit_code; 1260 ? p->signal->group_exit_code : p->exit_code;