From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] ARM: kernel: update cpuinfo to print all online CPUs features
Date: Wed, 17 Oct 2012 11:20:15 +0100 [thread overview]
Message-ID: <20121017102015.GA13189@e102568-lin.cambridge.arm.com> (raw)
In-Reply-To: <20121016214752.GH21164@n2100.arm.linux.org.uk>
On Tue, Oct 16, 2012 at 10:47:52PM +0100, Russell King - ARM Linux wrote:
> On Tue, Oct 16, 2012 at 11:29:39PM +0530, Santosh Shilimkar wrote:
> > Not exactly related to the $subject patch, but I remember doing a patch
> > to have cat /proc/cpuinfo spitting only online CPUs just like x86 using
> > for_each_online_cpu(i).
> > At that point Russell mentioned about a possibility of read() syscall
> > spreading over the hot-plug operation and hence the above may not
> > be safe.
> >
> > is that right Russell ?
>
> That is correct, but you will notice that the code now uses the online
> cpus rather than the present, inspite of my objections. I gave up
> fighting the case, so now people get to live with the consequences of
> this.
>
> This will be fun with dynamic hotplugging with big.LITTLE when people
> come to read any of these files which change their output with the
> online CPUs. Oh what fun we're in for there.
I had a look at how glibc currently detects cpus in __get_nprocs() and all
methods end up relying on online CPUs:
- /sys/devices/system/cpu/online
- /proc/stat
- /proc/cpuinfo
Given the thread:
http://lists.infradead.org/pipermail/linux-arm-kernel/2011-June/054081.html
I do not think there is room to change the current behaviour of /proc/cpuinfo
as far as the online vs. present argument goes, and I certainly did not try.
I posted this code just to understand if it makes sense to expose all CPU ids
in /proc/cpuinfo the way I did (the same way x86 does, even though the code is
slightly different).
> I guess the only way to convince people is to let them make their
> mistakes in the kernel.
That's what I wanted to prevent by posting this code, namely getting
feedback on the best way to improve /proc/cpuinfo for systems where CPU
ids are not homogeneous.
The "online vs. present" issue is already there as Russell pointed out.
Thank you very much for the review, any further feedback appreciated.
Lorenzo
prev parent reply other threads:[~2012-10-17 10:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-16 16:24 [RFC PATCH] ARM: kernel: update cpuinfo to print all online CPUs features Lorenzo Pieralisi
2012-10-16 17:59 ` Santosh Shilimkar
2012-10-16 21:47 ` Russell King - ARM Linux
2012-10-17 10:20 ` Lorenzo Pieralisi [this message]
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=20121017102015.GA13189@e102568-lin.cambridge.arm.com \
--to=lorenzo.pieralisi@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).