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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 19 Mar 2015 15:18:07 +0800
From:	"Wang, Yalin" <Yalin.Wang@...ymobile.com>
To:	'Andrew Morton' <akpm@...ux-foundation.org>
CC:	'David Rientjes' <rientjes@...gle.com>,
	"'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 V2] proc: change /proc/stat show

> -----Original Message-----
> From: Andrew Morton [mailto:akpm@...ux-foundation.org]
> Sent: Thursday, March 19, 2015 6:08 AM
> To: Wang, Yalin
> Cc: 'David Rientjes'; 'heiko.carstens@...ibm.com'; 'tglx@...utronix.de';
> 'linux-kernel@...r.kernel.org'
> Subject: Re: [RFC V2] proc: change /proc/stat show
> 
> On Wed, 18 Mar 2015 10:35:39 +0800 "Wang, Yalin"
> <Yalin.Wang@...ymobile.com> wrote:
> 
> > This patch change /proc/stat to show each cpu,
> > we show each present cpus instead of eacn online cpu,
> > because some cpus are online / offline dynamically,
> > we should also show its cputime even it is offline,
> > some lib will read this file to detect cpu numbers,
> > we should also return the real present cpu numbers,
> > not just online cpus.
> 
> /proc/cpuinfo also skips offline CPUs.
> 
> > --- 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];
> 
> It's a non-back-compatible userspace interface change and I don't know
> what might break as a result.  For example, anyone who is using
> /proc/stat to find out which CPUs are online will get a surprise!
> 
I see,
I found on android, sysconf(_SC_NPROCESSORS_ONLN) function is implemented by
read /proc/stat file, and return the online processor numbers,
it will be non-compatible if I change this.

Thanks for your comments.





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