lkml.org 
[lkml]   [2009]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] /proc/stat idle field for idle cpus
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?


\
 
 \ /
  Last update: 2009-04-18 01:13    [W:0.166 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site