From: Andi Kleen <andi@firstfloor.org>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: getting processor numbers
Date: Tue, 3 Apr 2007 19:58:27 +0200 [thread overview]
Message-ID: <20070403175827.GA24033@one.firstfloor.org> (raw)
In-Reply-To: <461292BF.5020803@redhat.com>
On Tue, Apr 03, 2007 at 10:45:35AM -0700, Ulrich Drepper wrote:
> Andi Kleen wrote:
> >>> Topology is dependent on the number of CPUs.
> >> Not all of it.
> >
> > What is not?
>
> Memory banks can exist without a CPU present. The places where you can
> plug in memory don't change and so the memory hierarchy can be described.
There are systems that support node hotplug, like Altix or the larger
IBM or Unisys x86 systems. Basically they are a bunch of
smaller systems connected with cables running a cache coherent network
protocol. With that memory can appear (and disappear but we don't handle
that yet) unexpectedly.
That said we might have some idea of that in advance -- it can
be described in ACPI SRAT -- but the trouble is that many quite
ordinary x86 server systems always describe hotplug zones even though
it is unlikely they will ever get any. Trusting that can be quite
inefficient.
> There is an inexpensive solution: finally make the vdso concept a bit
> more flexible. You could add a vdso call to get the processor count.
> The vdso code itself can use a data page mapped in from the kernel.
The ELF aux vector is exactly that already.
> This page (read-only at userlevel) would contain global information such
> as processor count and topology.
You would still need an event notification mechanism, won't you?
>
>
> But we're getting IMO off topic here. That's a separate and far more
> complicated issue.
Yes I agree. Hotplug is best ignored for now
> Here we now have the concrete issue that determining the CPU count is
> terribly expensive and there is a simple proposal to make it faster by
> keeping /sys/devices/system/cpu/ free from anything but cpu* directories.
The cost will be still large. Accessing sysfs will be never cheap.
For once anything going through the VFS tens to take a two sometimes
three digit number of locks.
If you want it cheap look for some other way.
-Andi
next prev parent reply other threads:[~2007-04-03 17:58 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-03 16:54 getting processor numbers Ulrich Drepper
2007-04-03 17:30 ` linux-os (Dick Johnson)
2007-04-03 17:37 ` Ulrich Drepper
2007-04-03 17:56 ` Dr. David Alan Gilbert
2007-04-03 18:11 ` Andi Kleen
2007-04-03 17:17 ` Ulrich Drepper
2007-04-03 17:22 ` Alan Cox
2007-04-03 17:30 ` Andi Kleen
2007-04-03 20:24 ` Jeremy Fitzhardinge
2007-04-03 17:27 ` Andi Kleen
2007-04-03 17:30 ` Ulrich Drepper
2007-04-03 17:35 ` Andi Kleen
2007-04-03 17:45 ` Ulrich Drepper
2007-04-03 17:58 ` Andi Kleen [this message]
2007-04-03 18:05 ` Ulrich Drepper
2007-04-03 18:11 ` Andi Kleen
2007-04-03 18:21 ` Ulrich Drepper
2007-04-03 17:44 ` Siddha, Suresh B
2007-04-03 17:59 ` Ulrich Drepper
2007-04-03 19:40 ` Jakub Jelinek
2007-04-03 20:13 ` Ingo Oeser
2007-04-03 23:38 ` J.A. Magallón
2007-04-03 19:55 ` Ulrich Drepper
2007-04-03 20:13 ` Siddha, Suresh B
2007-04-03 20:19 ` Ulrich Drepper
2007-04-03 20:32 ` Eric Dumazet
2007-04-03 20:20 ` Nathan Lynch
2007-04-03 19:15 ` Davide Libenzi
2007-04-03 19:32 ` Ulrich Drepper
2007-04-04 0:31 ` H. Peter Anvin
2007-04-04 0:35 ` Jeremy Fitzhardinge
2007-04-04 0:38 ` H. Peter Anvin
2007-04-04 5:09 ` Eric Dumazet
2007-04-04 5:16 ` H. Peter Anvin
2007-04-04 5:22 ` Jeremy Fitzhardinge
2007-04-04 5:40 ` H. Peter Anvin
2007-04-04 5:46 ` Eric Dumazet
2007-04-04 5:29 ` Eric Dumazet
2007-04-03 20:16 ` Andrew Morton
[not found] ` <4612BB89.8040102@redhat.com>
[not found] ` <20070403141348.9bcdb13e.akpm@linux-foundation.org>
2007-04-03 22:13 ` Ulrich Drepper
2007-04-03 22:48 ` Andrew Morton
2007-04-03 23:00 ` Ulrich Drepper
2007-04-03 23:23 ` Andrew Morton
2007-04-03 23:54 ` Ulrich Drepper
2007-04-04 2:55 ` Paul Jackson
2007-04-04 8:39 ` Oleg Nesterov
2007-04-04 9:39 ` Ingo Molnar
2007-04-04 8:57 ` Oleg Nesterov
2007-04-04 10:01 ` Ingo Molnar
2007-04-04 2:58 ` Paul Jackson
2007-04-04 3:04 ` Paul Jackson
2007-04-04 2:52 ` Paul Jackson
2007-04-04 2:04 ` Paul Jackson
2007-04-04 6:47 ` Jakub Jelinek
2007-04-04 7:02 ` Paul Jackson
2007-04-04 14:51 ` Cliff Wickman
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=20070403175827.GA24033@one.firstfloor.org \
--to=andi@firstfloor.org \
--cc=akpm@linux-foundation.org \
--cc=drepper@redhat.com \
--cc=linux-kernel@vger.kernel.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