[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <461292BF.5020803@redhat.com>
Date: Tue, 03 Apr 2007 10:45:35 -0700
From: Ulrich Drepper <drepper@...hat.com>
To: Andi Kleen <andi@...stfloor.org>
CC: Linux Kernel <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: getting processor numbers
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.
> Hmm, e.g. in OpenMP you would have another thread that just reads /proc/cpuinfo
> in a loop and starts new threads on new CPUs?
>
> That sounds ...... "expensive"
That's the cost of doing business.
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.
This page (read-only at userlevel) would contain global information such
as processor count and topology.
But we're getting IMO off topic here. That's a separate and far more
complicated issue.
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.
--
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
Download attachment "signature.asc" of type "application/pgp-signature" (252 bytes)
Powered by blists - more mailing lists