diff options
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index d0b7d988f873..d579a459309d 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -121,9 +121,9 @@ static void __exit_signal(struct task_struct *tsk) | |||
121 | * We won't ever get here for the group leader, since it | 121 | * We won't ever get here for the group leader, since it |
122 | * will have been the last reference on the signal_struct. | 122 | * will have been the last reference on the signal_struct. |
123 | */ | 123 | */ |
124 | sig->utime = cputime_add(sig->utime, tsk->utime); | 124 | sig->utime += tsk->utime; |
125 | sig->stime = cputime_add(sig->stime, tsk->stime); | 125 | sig->stime += tsk->stime; |
126 | sig->gtime = cputime_add(sig->gtime, tsk->gtime); | 126 | sig->gtime += tsk->gtime; |
127 | sig->min_flt += tsk->min_flt; | 127 | sig->min_flt += tsk->min_flt; |
128 | sig->maj_flt += tsk->maj_flt; | 128 | sig->maj_flt += tsk->maj_flt; |
129 | sig->nvcsw += tsk->nvcsw; | 129 | sig->nvcsw += tsk->nvcsw; |
@@ -1255,19 +1255,9 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p) | |||
1255 | spin_lock_irq(&p->real_parent->sighand->siglock); | 1255 | spin_lock_irq(&p->real_parent->sighand->siglock); |
1256 | psig = p->real_parent->signal; | 1256 | psig = p->real_parent->signal; |
1257 | sig = p->signal; | 1257 | sig = p->signal; |
1258 | psig->cutime = | 1258 | psig->cutime += tgutime + sig->cutime; |
1259 | cputime_add(psig->cutime, | 1259 | psig->cstime += tgstime + sig->cstime; |
1260 | cputime_add(tgutime, | 1260 | psig->cgtime += p->gtime + sig->gtime + sig->cgtime; |
1261 | sig->cutime)); | ||
1262 | psig->cstime = | ||
1263 | cputime_add(psig->cstime, | ||
1264 | cputime_add(tgstime, | ||
1265 | sig->cstime)); | ||
1266 | psig->cgtime = | ||
1267 | cputime_add(psig->cgtime, | ||
1268 | cputime_add(p->gtime, | ||
1269 | cputime_add(sig->gtime, | ||
1270 | sig->cgtime))); | ||
1271 | psig->cmin_flt += | 1261 | psig->cmin_flt += |
1272 | p->min_flt + sig->min_flt + sig->cmin_flt; | 1262 | p->min_flt + sig->min_flt + sig->cmin_flt; |
1273 | psig->cmaj_flt += | 1263 | psig->cmaj_flt += |
@@ -1540,8 +1530,15 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace, | |||
1540 | } | 1530 | } |
1541 | 1531 | ||
1542 | /* dead body doesn't have much to contribute */ | 1532 | /* dead body doesn't have much to contribute */ |
1543 | if (p->exit_state == EXIT_DEAD) | 1533 | if (unlikely(p->exit_state == EXIT_DEAD)) { |
1534 | /* | ||
1535 | * But do not ignore this task until the tracer does | ||
1536 | * wait_task_zombie()->do_notify_parent(). | ||
1537 | */ | ||
1538 | if (likely(!ptrace) && unlikely(ptrace_reparented(p))) | ||
1539 | wo->notask_error = 0; | ||
1544 | return 0; | 1540 | return 0; |
1541 | } | ||
1545 | 1542 | ||
1546 | /* slay zombie? */ | 1543 | /* slay zombie? */ |
1547 | if (p->exit_state == EXIT_ZOMBIE) { | 1544 | if (p->exit_state == EXIT_ZOMBIE) { |