public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Balbir Singh <balbir@in.ibm.com>
To: Andrew Morton <akpm@osdl.org>, "Martin T. Setek" <martitse@ifi.uio.no>
Cc: Shailabh Nagar <nagar@watson.ibm.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Fw: [PATCH: 2.6.18.1] delayacct: cpu_count in taskstats updated correctly
Date: Mon, 30 Oct 2006 19:18:35 +0530	[thread overview]
Message-ID: <454602B3.7000306@in.ibm.com> (raw)
In-Reply-To: <20061026223653.bc871cf2.akpm@osdl.org>



> 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

           reply	other threads:[~2006-10-30 13:49 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20061026223653.bc871cf2.akpm@osdl.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=454602B3.7000306@in.ibm.com \
    --to=balbir@in.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martitse@ifi.uio.no \
    --cc=nagar@watson.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox