diff options
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 2eaf68b634e3..b221ad65fd20 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -91,8 +91,6 @@ static void __exit_signal(struct task_struct *tsk) | |||
91 | if (atomic_dec_and_test(&sig->count)) | 91 | if (atomic_dec_and_test(&sig->count)) |
92 | posix_cpu_timers_exit_group(tsk); | 92 | posix_cpu_timers_exit_group(tsk); |
93 | else { | 93 | else { |
94 | cputime_t utime, stime; | ||
95 | |||
96 | /* | 94 | /* |
97 | * If there is any task waiting for the group exit | 95 | * If there is any task waiting for the group exit |
98 | * then notify it: | 96 | * then notify it: |
@@ -112,9 +110,8 @@ static void __exit_signal(struct task_struct *tsk) | |||
112 | * We won't ever get here for the group leader, since it | 110 | * We won't ever get here for the group leader, since it |
113 | * will have been the last reference on the signal_struct. | 111 | * will have been the last reference on the signal_struct. |
114 | */ | 112 | */ |
115 | task_times(tsk, &utime, &stime); | 113 | sig->utime = cputime_add(sig->utime, tsk->utime); |
116 | sig->utime = cputime_add(sig->utime, utime); | 114 | sig->stime = cputime_add(sig->stime, tsk->stime); |
117 | sig->stime = cputime_add(sig->stime, stime); | ||
118 | sig->gtime = cputime_add(sig->gtime, tsk->gtime); | 115 | sig->gtime = cputime_add(sig->gtime, tsk->gtime); |
119 | sig->min_flt += tsk->min_flt; | 116 | sig->min_flt += tsk->min_flt; |
120 | sig->maj_flt += tsk->maj_flt; | 117 | sig->maj_flt += tsk->maj_flt; |
@@ -1208,6 +1205,7 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p) | |||
1208 | struct signal_struct *psig; | 1205 | struct signal_struct *psig; |
1209 | struct signal_struct *sig; | 1206 | struct signal_struct *sig; |
1210 | unsigned long maxrss; | 1207 | unsigned long maxrss; |
1208 | cputime_t tgutime, tgstime; | ||
1211 | 1209 | ||
1212 | /* | 1210 | /* |
1213 | * The resource counters for the group leader are in its | 1211 | * The resource counters for the group leader are in its |
@@ -1223,20 +1221,23 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p) | |||
1223 | * need to protect the access to parent->signal fields, | 1221 | * need to protect the access to parent->signal fields, |
1224 | * as other threads in the parent group can be right | 1222 | * as other threads in the parent group can be right |
1225 | * here reaping other children at the same time. | 1223 | * here reaping other children at the same time. |
1224 | * | ||
1225 | * We use thread_group_times() to get times for the thread | ||
1226 | * group, which consolidates times for all threads in the | ||
1227 | * group including the group leader. | ||
1226 | */ | 1228 | */ |
1229 | thread_group_times(p, &tgutime, &tgstime); | ||
1227 | spin_lock_irq(&p->real_parent->sighand->siglock); | 1230 | spin_lock_irq(&p->real_parent->sighand->siglock); |
1228 | psig = p->real_parent->signal; | 1231 | psig = p->real_parent->signal; |
1229 | sig = p->signal; | 1232 | sig = p->signal; |
1230 | psig->cutime = | 1233 | psig->cutime = |
1231 | cputime_add(psig->cutime, | 1234 | cputime_add(psig->cutime, |
1232 | cputime_add(p->utime, | 1235 | cputime_add(tgutime, |
1233 | cputime_add(sig->utime, | 1236 | sig->cutime)); |
1234 | sig->cutime))); | ||
1235 | psig->cstime = | 1237 | psig->cstime = |
1236 | cputime_add(psig->cstime, | 1238 | cputime_add(psig->cstime, |
1237 | cputime_add(p->stime, | 1239 | cputime_add(tgstime, |
1238 | cputime_add(sig->stime, | 1240 | sig->cstime)); |
1239 | sig->cstime))); | ||
1240 | psig->cgtime = | 1241 | psig->cgtime = |
1241 | cputime_add(psig->cgtime, | 1242 | cputime_add(psig->cgtime, |
1242 | cputime_add(p->gtime, | 1243 | cputime_add(p->gtime, |