lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090417160211.4fa36fb7.akpm@linux-foundation.org>
Date:	Fri, 17 Apr 2009 16:02:11 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Martin Schwidefsky <schwidefsky@...ibm.com>
Cc:	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
	benh@...nel.crashing.org, heiko.carstens@...ibm.com,
	paulus@...ba.org, tony.luck@...el.com,
	seto.hidetoshi@...fujitsu.com, jeremy@...source.com,
	a.p.zijlstra@...llo.nl, mingo@...e.hu,
	Alexey Dobriyan <adobriyan@...il.com>
Subject: Re: [RFC][PATCH] /proc/stat idle field for idle cpus

On Tue, 14 Apr 2009 14:18:51 +0200
Martin Schwidefsky <schwidefsky@...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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ