diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-05 18:30:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-05 18:30:49 -0500 |
commit | 897e81bea1fcfcd2c5cdb720c9efdb25da9ff374 (patch) | |
tree | 92cf33ed2c35c1ece633f09365702f1c8e24d415 /kernel/exit.c | |
parent | c3fa27d1367fac63ac8533d6f20ea851d0d70a10 (diff) | |
parent | 0cf55e1ec08bb5a22e068309e2d8ba1180ab4239 (diff) |
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (35 commits)
sched, cputime: Introduce thread_group_times()
sched, cputime: Cleanups related to task_times()
Revert "sched, x86: Optimize branch hint in __switch_to()"
sched: Fix isolcpus boot option
sched: Revert 498657a478c60be092208422fefa9c7b248729c2
sched, time: Define nsecs_to_jiffies()
sched: Remove task_{u,s,g}time()
sched: Introduce task_times() to replace task_{u,s}time() pair
sched: Limit the number of scheduler debug messages
sched.c: Call debug_show_all_locks() when dumping all tasks
sched, x86: Optimize branch hint in __switch_to()
sched: Optimize branch hint in context_switch()
sched: Optimize branch hint in pick_next_task_fair()
sched_feat_write(): Update ppos instead of file->f_pos
sched: Sched_rt_periodic_timer vs cpu hotplug
sched, kvm: Fix race condition involving sched_in_preempt_notifers
sched: More generic WAKE_AFFINE vs select_idle_sibling()
sched: Cleanup select_task_rq_fair()
sched: Fix granularity of task_u/stime()
sched: Fix/add missing update_rq_clock() calls
...
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 3f45e3cf931d..80ae941cfd2e 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -111,9 +111,9 @@ static void __exit_signal(struct task_struct *tsk) | |||
111 | * We won't ever get here for the group leader, since it | 111 | * We won't ever get here for the group leader, since it |
112 | * will have been the last reference on the signal_struct. | 112 | * will have been the last reference on the signal_struct. |
113 | */ | 113 | */ |
114 | sig->utime = cputime_add(sig->utime, task_utime(tsk)); | 114 | sig->utime = cputime_add(sig->utime, tsk->utime); |
115 | sig->stime = cputime_add(sig->stime, task_stime(tsk)); | 115 | sig->stime = cputime_add(sig->stime, tsk->stime); |
116 | sig->gtime = cputime_add(sig->gtime, task_gtime(tsk)); | 116 | sig->gtime = cputime_add(sig->gtime, tsk->gtime); |
117 | sig->min_flt += tsk->min_flt; | 117 | sig->min_flt += tsk->min_flt; |
118 | sig->maj_flt += tsk->maj_flt; | 118 | sig->maj_flt += tsk->maj_flt; |
119 | sig->nvcsw += tsk->nvcsw; | 119 | sig->nvcsw += tsk->nvcsw; |
@@ -1210,6 +1210,7 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p) | |||
1210 | struct signal_struct *psig; | 1210 | struct signal_struct *psig; |
1211 | struct signal_struct *sig; | 1211 | struct signal_struct *sig; |
1212 | unsigned long maxrss; | 1212 | unsigned long maxrss; |
1213 | cputime_t tgutime, tgstime; | ||
1213 | 1214 | ||
1214 | /* | 1215 | /* |
1215 | * The resource counters for the group leader are in its | 1216 | * The resource counters for the group leader are in its |
@@ -1225,20 +1226,23 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p) | |||
1225 | * need to protect the access to parent->signal fields, | 1226 | * need to protect the access to parent->signal fields, |
1226 | * as other threads in the parent group can be right | 1227 | * as other threads in the parent group can be right |
1227 | * here reaping other children at the same time. | 1228 | * here reaping other children at the same time. |
1229 | * | ||
1230 | * We use thread_group_times() to get times for the thread | ||
1231 | * group, which consolidates times for all threads in the | ||
1232 | * group including the group leader. | ||
1228 | */ | 1233 | */ |
1234 | thread_group_times(p, &tgutime, &tgstime); | ||
1229 | spin_lock_irq(&p->real_parent->sighand->siglock); | 1235 | spin_lock_irq(&p->real_parent->sighand->siglock); |
1230 | psig = p->real_parent->signal; | 1236 | psig = p->real_parent->signal; |
1231 | sig = p->signal; | 1237 | sig = p->signal; |
1232 | psig->cutime = | 1238 | psig->cutime = |
1233 | cputime_add(psig->cutime, | 1239 | cputime_add(psig->cutime, |
1234 | cputime_add(p->utime, | 1240 | cputime_add(tgutime, |
1235 | cputime_add(sig->utime, | 1241 | sig->cutime)); |
1236 | sig->cutime))); | ||
1237 | psig->cstime = | 1242 | psig->cstime = |
1238 | cputime_add(psig->cstime, | 1243 | cputime_add(psig->cstime, |
1239 | cputime_add(p->stime, | 1244 | cputime_add(tgstime, |
1240 | cputime_add(sig->stime, | 1245 | sig->cstime)); |
1241 | sig->cstime))); | ||
1242 | psig->cgtime = | 1246 | psig->cgtime = |
1243 | cputime_add(psig->cgtime, | 1247 | cputime_add(psig->cgtime, |
1244 | cputime_add(p->gtime, | 1248 | cputime_add(p->gtime, |