diff options
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index d4aac24cc469..94ed6e20bb53 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -122,9 +122,9 @@ static void __exit_signal(struct task_struct *tsk) | |||
122 | * We won't ever get here for the group leader, since it | 122 | * We won't ever get here for the group leader, since it |
123 | * will have been the last reference on the signal_struct. | 123 | * will have been the last reference on the signal_struct. |
124 | */ | 124 | */ |
125 | sig->utime = cputime_add(sig->utime, tsk->utime); | 125 | sig->utime += tsk->utime; |
126 | sig->stime = cputime_add(sig->stime, tsk->stime); | 126 | sig->stime += tsk->stime; |
127 | sig->gtime = cputime_add(sig->gtime, tsk->gtime); | 127 | sig->gtime += tsk->gtime; |
128 | sig->min_flt += tsk->min_flt; | 128 | sig->min_flt += tsk->min_flt; |
129 | sig->maj_flt += tsk->maj_flt; | 129 | sig->maj_flt += tsk->maj_flt; |
130 | sig->nvcsw += tsk->nvcsw; | 130 | sig->nvcsw += tsk->nvcsw; |
@@ -680,8 +680,6 @@ static void exit_mm(struct task_struct * tsk) | |||
680 | tsk->mm = NULL; | 680 | tsk->mm = NULL; |
681 | up_read(&mm->mmap_sem); | 681 | up_read(&mm->mmap_sem); |
682 | enter_lazy_tlb(mm, current); | 682 | enter_lazy_tlb(mm, current); |
683 | /* We don't want this task to be frozen prematurely */ | ||
684 | clear_freeze_flag(tsk); | ||
685 | task_unlock(tsk); | 683 | task_unlock(tsk); |
686 | mm_update_next_owner(mm); | 684 | mm_update_next_owner(mm); |
687 | mmput(mm); | 685 | mmput(mm); |
@@ -1043,6 +1041,7 @@ NORET_TYPE void do_exit(long code) | |||
1043 | exit_rcu(); | 1041 | exit_rcu(); |
1044 | /* causes final put_task_struct in finish_task_switch(). */ | 1042 | /* causes final put_task_struct in finish_task_switch(). */ |
1045 | tsk->state = TASK_DEAD; | 1043 | tsk->state = TASK_DEAD; |
1044 | tsk->flags |= PF_NOFREEZE; /* tell freezer to ignore us */ | ||
1046 | schedule(); | 1045 | schedule(); |
1047 | BUG(); | 1046 | BUG(); |
1048 | /* Avoid "noreturn function does return". */ | 1047 | /* Avoid "noreturn function does return". */ |
@@ -1258,19 +1257,9 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p) | |||
1258 | spin_lock_irq(&p->real_parent->sighand->siglock); | 1257 | spin_lock_irq(&p->real_parent->sighand->siglock); |
1259 | psig = p->real_parent->signal; | 1258 | psig = p->real_parent->signal; |
1260 | sig = p->signal; | 1259 | sig = p->signal; |
1261 | psig->cutime = | 1260 | psig->cutime += tgutime + sig->cutime; |
1262 | cputime_add(psig->cutime, | 1261 | psig->cstime += tgstime + sig->cstime; |
1263 | cputime_add(tgutime, | 1262 | psig->cgtime += p->gtime + sig->gtime + sig->cgtime; |
1264 | sig->cutime)); | ||
1265 | psig->cstime = | ||
1266 | cputime_add(psig->cstime, | ||
1267 | cputime_add(tgstime, | ||
1268 | sig->cstime)); | ||
1269 | psig->cgtime = | ||
1270 | cputime_add(psig->cgtime, | ||
1271 | cputime_add(p->gtime, | ||
1272 | cputime_add(sig->gtime, | ||
1273 | sig->cgtime))); | ||
1274 | psig->cmin_flt += | 1263 | psig->cmin_flt += |
1275 | p->min_flt + sig->min_flt + sig->cmin_flt; | 1264 | p->min_flt + sig->min_flt + sig->cmin_flt; |
1276 | psig->cmaj_flt += | 1265 | psig->cmaj_flt += |
@@ -1543,8 +1532,15 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace, | |||
1543 | } | 1532 | } |
1544 | 1533 | ||
1545 | /* dead body doesn't have much to contribute */ | 1534 | /* dead body doesn't have much to contribute */ |
1546 | if (p->exit_state == EXIT_DEAD) | 1535 | if (unlikely(p->exit_state == EXIT_DEAD)) { |
1536 | /* | ||
1537 | * But do not ignore this task until the tracer does | ||
1538 | * wait_task_zombie()->do_notify_parent(). | ||
1539 | */ | ||
1540 | if (likely(!ptrace) && unlikely(ptrace_reparented(p))) | ||
1541 | wo->notask_error = 0; | ||
1547 | return 0; | 1542 | return 0; |
1543 | } | ||
1548 | 1544 | ||
1549 | /* slay zombie? */ | 1545 | /* slay zombie? */ |
1550 | if (p->exit_state == EXIT_ZOMBIE) { | 1546 | if (p->exit_state == EXIT_ZOMBIE) { |