[RFC][PATCH] powerpc: respect how command line nr_cpus is set

Kumar Gala galak at kernel.crashing.org
Thu May 5 21:38:01 EST 2011


On May 4, 2011, at 9:25 PM, Benjamin Herrenschmidt wrote:

> On Wed, 2011-05-04 at 15:17 -0500, Kumar Gala wrote:
>> We should utilize nr_cpus as the max # of CPUs that we can have present
>> instead of NR_CPUS.  This way we actually respect how nr_cpus is set on
>> the command line rather than ignoring it.
>> 
>> Signed-off-by: Kumar Gala <galak at kernel.crashing.org>
>> ---
>> I think this is what we should be doing, but would like someone else to take
>> a look.
> 
> The main question I have is should max_cpus absolutely limit the number
> of possible CPUs or should it limit the number that get automatically
> onlined at boot, potentially letting us bring the rest online later on ?
> 
> Cheers,
> Ben.

From Documentation/kernel-parameters.txt:

        nr_cpus=        [SMP] Maximum number of processors that an SMP kernel
                        could support.  nr_cpus=n : n >= 1 limits the kernel to
                        supporting 'n' processors. Later in runtime you can not
                        use hotplug cpu feature to put more cpu back to online.
                        just like you compile the kernel NR_CPUS=n

Which makes me think we should have max_cpus be an absolute limit.

- k


More information about the Linuxppc-dev mailing list