lkml.org 
[lkml]   [2010]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [patch 3/4] taskstats: Introduce cdata_acct for complete cumulative accounting
From
Date
On Thu, 2010-11-25 at 14:21 +0100, Oleg Nesterov wrote:
> On 11/25, Michael Holzheu wrote:
> But in fact this reminds we should cleanup this code somehow.
> By the time we call thread_group_times() there are no other
> threads.

Couldn't we just replace thread_group_times() with the following:

--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -101,12 +101,13 @@ static void __account_cdata(struct task_
* group, which consolidates times for all threads in the
* group including the group leader.
*/
- thread_group_times(p, &tgutime, &tgstime);
pcd = &p->real_parent->signal->cdata_wait;
tcd = &p->signal->cdata_threads;
cd = &p->signal->cdata_wait;

spin_lock_irqsave(&p->real_parent->sighand->siglock, flags);
+ tgutime = cputime_add(tcd->utime, p->utime);
+ tgstime = cputime_add(tcd->stime, p->stime);
pcd->utime =
cputime_add(pcd->utime,
cputime_add(tgutime,
Then we can move the __account_cdata() invocation down to the second
group_dead check.

Michael



\
 
 \ /
  Last update: 2010-11-25 18:49    [W:0.136 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site