public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Fw: [PATCH: 2.6.18.1] delayacct: cpu_count in taskstats updated correctly
       [not found] <20061026223653.bc871cf2.akpm@osdl.org>
@ 2006-10-30 13:48 ` Balbir Singh
  0 siblings, 0 replies; only message in thread
From: Balbir Singh @ 2006-10-30 13:48 UTC (permalink / raw)
  To: Andrew Morton, Martin T. Setek; +Cc: Shailabh Nagar, linux-kernel



> Begin forwarded message:
> 
> Date: Fri, 27 Oct 2006 05:18:17 +0200 (CEST)
> From: Martin Tostrup Setek <martitse@student.matnat.uio.no>
> To: nagar@watson.ibm.com
> Cc: linux-kernel@vger.kernel.org
> Subject: [PATCH: 2.6.18.1] delayacct: cpu_count in taskstats updated correctly
> 
> 
> from: Martin T. Setek <martitse@ifi.uio.no>
> 
> cpu_count in struct taskstats should be the same as the corresponding 
> (third) value found in /proc/<pid>/schedstat
> Signed-off-by: <martitse@ifi.uio.no>
> ---
> Index: linux-2.6.18.1/kernel/delayacct.c
> ===================================================================
> --- linux-2.6.18.1.orig/kernel/delayacct.c
> +++ linux-2.6.18.1/kernel/delayacct.c
> @@ -124,7 +124,7 @@ int __delayacct_add_tsk(struct taskstats
>   	t2 = tsk->sched_info.run_delay;
>   	t3 = tsk->sched_info.cpu_time;
> 
> -	d->cpu_count += t1;
> +	d->cpu_count = t1;
> 
>   	jiffies_to_timespec(t2, &ts);
>   	tmp = (s64)d->cpu_delay_total + timespec_to_ns(&ts);
> -

I was off from work and just saw this message.

The first field "d" in __delayacct_add_task() acts as an accumulator of
statistics (specially useful for fill_tgid() and called just once for
fill_pid() with cpu_count of "d" initialized to 0).

We sum up in d->cpu_count, since the same value of "d" is passed each time from
fill_tgid(). The proposed change is incorrect as we would overwrite the value
each time.

Balbir

-- 

	Balbir Singh,
	Linux Technology Center,
	IBM Software Labs

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-30 13:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20061026223653.bc871cf2.akpm@osdl.org>
2006-10-30 13:48 ` Fw: [PATCH: 2.6.18.1] delayacct: cpu_count in taskstats updated correctly Balbir Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox