From: Andi Kleen <ak@suse.de>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Steve Munroe <sjmunroe@us.ibm.com>, Theodore Tso <tytso@mit.edu>,
libc-alpha@sourceware.org, linux-kernel@vger.kernel.org,
akpm@osdl.org, Arjan van de Ven <arjan@infradead.org>,
Ulrich Drepper <drepper@redhat.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
"Randy.Dunlap" <rdunlap@xenotime.net>
Subject: Re: [PATCH] Use uname not sysctl to get the kernel revision
Date: Fri, 14 Jul 2006 21:09:34 +0200 [thread overview]
Message-ID: <200607142109.34170.ak@suse.de> (raw)
In-Reply-To: <1152902996.23037.90.camel@localhost.localdomain>
On Friday 14 July 2006 20:49, Benjamin Herrenschmidt wrote:
> > We will need an implementation that will fall back to sys_sysctl for older
> > kernels. This is already common practice in glibc. I don't really
> > understand the performance concern because it seems to me that
> > _is_smp_system() is only called once per process.
> >
> > But isn't this the kind of thing that the Aux Vector is for? I like vDSO
> > too, but I think it is best deployed for information of a more dynamic
> > nature and performance sensitive.
>
> For a simple "is_smp" kind of flag, I would tend to agree with the
> above... for more complex NUMA topology and/or cache characteristics,
> which is quite a bigger amount of information, I'm not sure it's worth
> copying all of that data on every process exec (and making the initial
> AT_ parsing slower). Especially since very few processes actually care
> about those.
I've actually spent some thought on that recently. The motivation
came from someone who wanted the number of CPUs in a fast way
to tune AMD64 memcpy etc. better.
My proposal was to supply four new count:
number of cores, number of siblings, number of sockets, number of nodes
These all fit easily in 16bit so it would be 2 new entries in the
aux vector (128 bit total). Shouldn't be much overhead to write this.
If you need more exact topology you can probably eat the overhead
of parsing /proc/cpuinfo or read it from sysfs (or just use libnuma
which supplies most of this in an easy way)
Doing it in a vDSO would be in theory ok for me too, except that x86-64
doesn't have one so far. Even in vDSO I wouldn't add much more than this
(like bitmaps and similar) because otherwise cpu/node hotplug could be racy.
Also I'm reluctant to redo /proc/cpuinfo and /sys for this.
-Andi
next prev parent reply other threads:[~2006-07-14 19:10 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-10 22:39 [PATCH] sysctl: Document that sys_sysctl will be removed Eric W. Biederman
2006-07-10 22:50 ` Randy.Dunlap
2006-07-11 4:10 ` Eric W. Biederman
2006-07-11 7:07 ` Arjan van de Ven
2006-07-12 16:25 ` [PATCH] Use uname not sysctl to get the kernel revision Eric W. Biederman
2006-07-12 16:50 ` Ulrich Drepper
2006-07-12 17:42 ` Eric W. Biederman
2006-07-12 23:24 ` Theodore Tso
2006-07-12 23:31 ` Andi Kleen
2006-07-13 0:12 ` Theodore Tso
2006-07-13 2:33 ` Eric W. Biederman
2006-07-13 12:15 ` Andi Kleen
2006-07-12 23:44 ` Steve Munroe
2006-07-14 18:49 ` Benjamin Herrenschmidt
2006-07-14 19:09 ` Andi Kleen [this message]
2006-07-13 0:19 ` Eric W. Biederman
2006-07-12 18:44 ` Roland McGrath
2006-07-12 19:33 ` Ulrich Drepper
2006-07-12 19:53 ` Jakub Jelinek
2006-07-12 20:09 ` H. Peter Anvin
2006-07-12 21:23 ` Eric W. Biederman
2006-07-12 21:29 ` Arjan van de Ven
2006-07-12 21:56 ` Eric W. Biederman
2006-07-12 22:01 ` Arjan van de Ven
2006-07-12 22:02 ` H. Peter Anvin
2006-07-12 22:26 ` Eric W. Biederman
2006-07-12 22:31 ` H. Peter Anvin
2006-07-12 23:07 ` Alan Cox
2006-07-12 23:19 ` H. Peter Anvin
2006-07-13 11:15 ` Alan Cox
2006-07-14 18:45 ` Benjamin Herrenschmidt
2006-07-14 19:11 ` H. Peter Anvin
2006-07-12 21:29 ` H. Peter Anvin
2006-07-12 21:33 ` Michael Tokarev
2006-07-13 5:17 ` Ulrich Drepper
2006-07-13 6:27 ` Ian Wienand
2006-07-13 14:39 ` Eric W. Biederman
2006-07-13 15:05 ` Arjan van de Ven
-- strict thread matches above, loose matches on Subject: below --
2006-07-13 5:00 Albert Cahalan
2006-07-13 5:42 ` H. Peter Anvin
2006-07-13 6:09 ` Albert Cahalan
2006-07-13 6:13 ` Albert Cahalan
2006-07-13 6:38 ` Eric W. Biederman
2006-07-13 16:15 ` Albert Cahalan
2006-07-13 16:53 ` Eric W. Biederman
2006-07-13 17:06 ` Albert Cahalan
2006-07-13 15:20 ` Eric W. Biederman
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=200607142109.34170.ak@suse.de \
--to=ak@suse.de \
--cc=akpm@osdl.org \
--cc=arjan@infradead.org \
--cc=benh@kernel.crashing.org \
--cc=drepper@redhat.com \
--cc=ebiederm@xmission.com \
--cc=libc-alpha@sourceware.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@xenotime.net \
--cc=sjmunroe@us.ibm.com \
--cc=tytso@mit.edu \
/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