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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070502163757.GF30688@localdomain>
Date:	Wed, 2 May 2007 11:37:57 -0500
From:	Nathan Lynch <ntl@...ox.com>
To:	Gautham R Shenoy <ego@...ibm.com>
Cc:	Srivatsa Vaddagiri <vatsa@...ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>, ashok.raj@...el.com,
	heiko.carstens@...ibm.com, linux-kernel@...r.kernel.org
Subject: Re: /sys/devices/system/cpu/*: Present cpus or Possible cpus

Hi Gautham-

Gautham R Shenoy wrote:
> 
> Looking at the topology_init() code, I observe that the meaning of
> the cpuX/ directory entries in /sys/devices/system/cpu/ might be
> different for different architectures. 
> 
> Looks like, in case of i386, ia64, m32, mips etc, the cpuX directory entries
> represent the "present cpus".
> 
> However, in case of powerpc, s390 etc, the cpuX entries represent the
> "possible cpus".
> 
> Wondering if there is any particular reason for this discrepancy.

I believe that the powerpc behavior was established before
cpu_present_map was introduced.


> I am not entirely surely if it's due cpu hotplug because 
> both i386 and powerpc support it!

powerpc also supports processor add and remove (as opposed to
online/offline); i386 does not AFAIK.  I think this may be a reason
for the difference.


> When I do a 
> "echo 1 > /sys/devices/system/cpu/cpuX/online" on a power box as root, 
> I might get "-bash: echo: write error: Invalid argument" 
> because cpuX might not be present!
>
> In case of lpar, cpu_present_map need not necessarily be equal to
> cpu_possible_map, so the above error is observable.

Working as intended.  You have to add a cpu to the partition before
you can online it.


> Is this discrepency intentional ?
> Or is it due to the fact that in most cases,
> cpu_present_map == cpu_possible_map, so lets not bother about it :-?

I think it's the inevitable result when architectures are free to
invent their own versions of the same sysfs interface.  But is it
really causing a problem in this case?

-
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