diff options
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index abf9cf3b95c6..4741376c8dec 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 | } |
@@ -981,10 +984,6 @@ NORET_TYPE void do_exit(long code) | |||
981 | tsk->mempolicy = NULL; | 984 | tsk->mempolicy = NULL; |
982 | #endif | 985 | #endif |
983 | #ifdef CONFIG_FUTEX | 986 | #ifdef CONFIG_FUTEX |
984 | /* | ||
985 | * This must happen late, after the PID is not | ||
986 | * hashed anymore: | ||
987 | */ | ||
988 | if (unlikely(!list_empty(&tsk->pi_state_list))) | 987 | if (unlikely(!list_empty(&tsk->pi_state_list))) |
989 | exit_pi_state_list(tsk); | 988 | exit_pi_state_list(tsk); |
990 | if (unlikely(current->pi_state_cache)) | 989 | if (unlikely(current->pi_state_cache)) |
@@ -1251,6 +1250,12 @@ static int wait_task_zombie(struct task_struct *p, int options, | |||
1251 | */ | 1250 | */ |
1252 | read_unlock(&tasklist_lock); | 1251 | read_unlock(&tasklist_lock); |
1253 | 1252 | ||
1253 | /* | ||
1254 | * Flush inherited counters to the parent - before the parent | ||
1255 | * gets woken up by child-exit notifications. | ||
1256 | */ | ||
1257 | perf_counter_exit_task(p); | ||
1258 | |||
1254 | retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0; | 1259 | retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0; |
1255 | status = (p->signal->flags & SIGNAL_GROUP_EXIT) | 1260 | status = (p->signal->flags & SIGNAL_GROUP_EXIT) |
1256 | ? p->signal->group_exit_code : p->exit_code; | 1261 | ? p->signal->group_exit_code : p->exit_code; |