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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 18 Mar 2015 09:55:48 +0800
From:	"Wang, Yalin" <Yalin.Wang@...ymobile.com>
To:	'David Rientjes' <rientjes@...gle.com>
CC:	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"heiko.carstens@...ibm.com" <heiko.carstens@...ibm.com>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [RFC] proc: change /proc/stat show

> -----Original Message-----
> From: David Rientjes [mailto:rientjes@...gle.com]
> Sent: Wednesday, March 18, 2015 7:02 AM
> To: Wang, Yalin
> Cc: akpm@...ux-foundation.org; heiko.carstens@...ibm.com;
> tglx@...utronix.de; linux-kernel@...r.kernel.org
> Subject: Re: [RFC] proc: change /proc/stat show
> 
> On Tue, 17 Mar 2015, Wang, Yalin wrote:
> 
> > diff --git a/fs/proc/stat.c b/fs/proc/stat.c
> > index 510413eb..60b39e2 100644
> > --- a/fs/proc/stat.c
> > +++ b/fs/proc/stat.c
> > @@ -130,7 +130,7 @@ static int show_stat(struct seq_file *p, void *v)
> >  	seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(guest_nice));
> >  	seq_putc(p, '\n');
> >
> > -	for_each_online_cpu(i) {
> > +	for_each_present_cpu(i) {
> >  		/* Copy values here to work around gcc-2.95.3, gcc-2.96 */
> >  		user = kcpustat_cpu(i).cpustat[CPUTIME_USER];
> >  		nice = kcpustat_cpu(i).cpustat[CPUTIME_NICE];
> > @@ -153,6 +153,7 @@ static int show_stat(struct seq_file *p, void *v)
> >  		seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(steal));
> >  		seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(guest));
> >  		seq_put_decimal_ull(p, ' ', cputime64_to_clock_t(guest_nice));
> > +		seq_printf(p, " %d", cpu_online(i)? 1 : 0);
> >  		seq_putc(p, '\n');
> >  	}
> >  	seq_printf(p, "intr %llu", (unsigned long long)sum);
> 
> Makes sense, but why do we need to output the cpu state as part of
> /proc/stat?  This information should already be available elsewhere.
Yeah,  online / offline info can be read from /sys/devices/cpu .
I can remove this line , if you think it is not needed .

Thanks



--
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