lkml.org 
[lkml]   [2008]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] cpumask: add sysfs displays for configured and disabled cpu maps
Greg KH wrote:
> On Wed, Dec 17, 2008 at 10:23:52PM +1030, Rusty Russell wrote:
>> On Tuesday 16 December 2008 14:56:48 Mike Travis wrote:
>>> Impact: add new functionality.
>>>
>>> Add sysfs files "kernel_max" and "offline" to display the max CPU index
>>> allowed (NR_CPUS-1), and the map of cpus that are offline.
>> I've applied this to the cpumask series, but Greg is sysfs maestro, so
>> I'll await his ack (I've quoted whole thing for easy reading).
>
> All new sysfs files should have corrisponding Documentation/ABI files
> added as well, containing all of the information in the body of this
> email so that others can find it in the future in an easy manner.
>
> Mike, can you make this change please?

Yes, I will.
>
>>> Cpus can be offlined via HOTPLUG, disabled by the BIOS ACPI tables, or
>>> if they exceed the number of cpus allowed by the NR_CPUS config option,
>>> or the "maxcpus=NUM" kernel start parameter.
>>>
>>> The "possible_cpus=NUM" parameter can also extend the number of possible
>>> cpus allowed, in which case the cpus not present at startup will be
>>> in the offline state. (These cpus can be HOTPLUGGED ON after system
>>> startup [pending a follow-on patch to provide the capability via the
>>> /sys/devices/sys/cpu/cpuN/online mechanism to bring them online.])
>>>
>>> By design, the "offlined cpus > possible cpus" display will always
>>> use the following formats:
>>>
>>> * all possible cpus online: "x$" or "x-y$"
>>> * some possible cpus offline: ".*,x$" or ".*,x-y$"
>
> Care to provide an example of what these sysfs files will actually hold?
> It seems like you are craming more information than needed into a single
> sysfs file.

Well, it's somewhat of a cop out as well :*). The cpus within 0 <= cpu < nr_cpu_ids
are printed with a cpulist_scnprintf. This is printed for all architectures
and shows primarily cpus that either have been offlined via CPU HOTPLUG or
made possible by extending the number of "possible" cpus via a kernel start
parameter.

Those cpus that may actually be present in the system but their index exceeds
NR_CPUS/maxcpus are printed following the above and are appended to the list.
If the list is non-empty, a comma is inserted first. This keeps it all within
the syntax needed by cpulist_parse(). This is only done for x86 right now.

I'll put this info in the doc file.
>
> Oh, and state why this is really needed, as I thought we already showed
> this kind of information today in the existing sysfs files, but I'm
> probably wrong :)

Almost, but not quite. You can mine the syslog file to find if there's a
warning message but otherwise, "extra" cpus are silently ignored.

>
> thanks,
>
> greg k-h

Thanks!
Mike


\
 
 \ /
  Last update: 2008-12-17 21:39    [W:2.861 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site