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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 3 Apr 2007 19:58:27 +0200
From:	Andi Kleen <andi@...stfloor.org>
To:	Ulrich Drepper <drepper@...hat.com>
Cc:	Andi Kleen <andi@...stfloor.org>,
	Linux Kernel <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: getting processor numbers

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ