aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 16395644a98f..40036ac04271 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -112,8 +112,6 @@ static void __exit_signal(struct task_struct *tsk)
112 * We won't ever get here for the group leader, since it 112 * We won't ever get here for the group leader, since it
113 * will have been the last reference on the signal_struct. 113 * will have been the last reference on the signal_struct.
114 */ 114 */
115 sig->utime = cputime_add(sig->utime, task_utime(tsk));
116 sig->stime = cputime_add(sig->stime, task_stime(tsk));
117 sig->gtime = cputime_add(sig->gtime, task_gtime(tsk)); 115 sig->gtime = cputime_add(sig->gtime, task_gtime(tsk));
118 sig->min_flt += tsk->min_flt; 116 sig->min_flt += tsk->min_flt;
119 sig->maj_flt += tsk->maj_flt; 117 sig->maj_flt += tsk->maj_flt;
@@ -122,7 +120,6 @@ static void __exit_signal(struct task_struct *tsk)
122 sig->inblock += task_io_get_inblock(tsk); 120 sig->inblock += task_io_get_inblock(tsk);
123 sig->oublock += task_io_get_oublock(tsk); 121 sig->oublock += task_io_get_oublock(tsk);
124 task_io_accounting_add(&sig->ioac, &tsk->ioac); 122 task_io_accounting_add(&sig->ioac, &tsk->ioac);
125 sig->sum_sched_runtime += tsk->se.sum_exec_runtime;
126 sig = NULL; /* Marker for below. */ 123 sig = NULL; /* Marker for below. */
127 } 124 }
128 125
@@ -1294,6 +1291,7 @@ static int wait_task_zombie(struct task_struct *p, int options,
1294 if (likely(!traced)) { 1291 if (likely(!traced)) {
1295 struct signal_struct *psig; 1292 struct signal_struct *psig;
1296 struct signal_struct *sig; 1293 struct signal_struct *sig;
1294 struct task_cputime cputime;
1297 1295
1298 /* 1296 /*
1299 * The resource counters for the group leader are in its 1297 * The resource counters for the group leader are in its
@@ -1309,20 +1307,23 @@ static int wait_task_zombie(struct task_struct *p, int options,
1309 * need to protect the access to p->parent->signal fields, 1307 * need to protect the access to p->parent->signal fields,
1310 * as other threads in the parent group can be right 1308 * as other threads in the parent group can be right
1311 * here reaping other children at the same time. 1309 * here reaping other children at the same time.
1310 *
1311 * We use thread_group_cputime() to get times for the thread
1312 * group, which consolidates times for all threads in the
1313 * group including the group leader.
1312 */ 1314 */
1313 spin_lock_irq(&p->parent->sighand->siglock); 1315 spin_lock_irq(&p->parent->sighand->siglock);
1314 psig = p->parent->signal; 1316 psig = p->parent->signal;
1315 sig = p->signal; 1317 sig = p->signal;
1318 thread_group_cputime(p, &cputime);
1316 psig->cutime = 1319 psig->cutime =
1317 cputime_add(psig->cutime, 1320 cputime_add(psig->cutime,
1318 cputime_add(p->utime, 1321 cputime_add(cputime.utime,
1319 cputime_add(sig->utime, 1322 sig->cutime));
1320 sig->cutime)));
1321 psig->cstime = 1323 psig->cstime =
1322 cputime_add(psig->cstime, 1324 cputime_add(psig->cstime,
1323 cputime_add(p->stime, 1325 cputime_add(cputime.stime,
1324 cputime_add(sig->stime, 1326 sig->cstime));
1325 sig->cstime)));
1326 psig->cgtime = 1327 psig->cgtime =
1327 cputime_add(psig->cgtime, 1328 cputime_add(psig->cgtime,
1328 cputime_add(p->gtime, 1329 cputime_add(p->gtime,