public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	benh@kernel.crashing.org, heiko.carstens@de.ibm.com,
	paulus@samba.org, tony.luck@intel.com,
	seto.hidetoshi@jp.fujitsu.com, jeremy@xensource.com,
	a.p.zijlstra@chello.nl, mingo@elte.hu,
	Alexey Dobriyan <adobriyan@gmail.com>
Subject: Re: [RFC][PATCH] /proc/stat idle field for idle cpus
Date: Fri, 17 Apr 2009 16:02:11 -0700	[thread overview]
Message-ID: <20090417160211.4fa36fb7.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090414141851.3174f880@skybase>

On Tue, 14 Apr 2009 14:18:51 +0200
Martin Schwidefsky <schwidefsky@de.ibm.com> wrote:

> --- linux-2.6.orig/fs/proc/stat.c
> +++ linux-2.6/fs/proc/stat.c
> @@ -18,6 +18,9 @@
>  #ifndef arch_irq_stat
>  #define arch_irq_stat() 0
>  #endif
> +#ifndef arch_idle_time
> +#define arch_idle_time(cpu) 0
> +#endif
>  
>  static int show_stat(struct seq_file *p, void *v)
>  {
> @@ -39,7 +42,8 @@ static int show_stat(struct seq_file *p,
>  		user = cputime64_add(user, kstat_cpu(i).cpustat.user);
>  		nice = cputime64_add(nice, kstat_cpu(i).cpustat.nice);
>  		system = cputime64_add(system, kstat_cpu(i).cpustat.system);
> -		idle = cputime64_add(idle, kstat_cpu(i).cpustat.idle);
> +		idle = cputime64_add(idle, kstat_cpu(i).cpustat.idle +
> +				     arch_idle_time(i));
>  		iowait = cputime64_add(iowait, kstat_cpu(i).cpustat.iowait);
>  		irq = cputime64_add(irq, kstat_cpu(i).cpustat.irq);
>  		softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq);
> @@ -68,7 +72,7 @@ static int show_stat(struct seq_file *p,
>  		user = kstat_cpu(i).cpustat.user;
>  		nice = kstat_cpu(i).cpustat.nice;
>  		system = kstat_cpu(i).cpustat.system;
> -		idle = kstat_cpu(i).cpustat.idle;
> +		idle = kstat_cpu(i).cpustat.idle + arch_idle_time(i);
>  		iowait = kstat_cpu(i).cpustat.iowait;
>  		irq = kstat_cpu(i).cpustat.irq;
>  		softirq = kstat_cpu(i).cpustat.softirq;

Looks OK to me.  Please merge it via the s390 tree.

Do other architectures need to fix this?

  reply	other threads:[~2009-04-17 23:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14 12:18 [RFC][PATCH] /proc/stat idle field for idle cpus Martin Schwidefsky
2009-04-17 23:02 ` Andrew Morton [this message]
2009-04-20  7:15   ` Martin Schwidefsky

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=20090417160211.4fa36fb7.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=adobriyan@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jeremy@xensource.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=seto.hidetoshi@jp.fujitsu.com \
    --cc=tony.luck@intel.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