Re: [PATCH] add command line init_start_cpus

From: Ingo Molnar
Date: Tue Dec 16 2008 - 16:19:21 EST



* Yinghai Lu <yinghai@xxxxxxxxxx> wrote:

> On Sun, Dec 14, 2008 at 4:11 PM, Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:
> > Yinghai Lu <yinghai@xxxxxxxxxx> writes:
> >
> >> Impact: new command line
> >>
> >> so could select cpus to be started during init stage
> >
> > maxcpus=N should do this already, at least for the first N cpus.
> > If you really need a non continuous range of N (why?) then it would
> > be better to fix maxcpus instead of adding a new option.
>
> it seems it is hard to make maxcpus= to support random cpus selecting
> and maxcpus=0 looks insane

yes, maxcpus=0 looks sucky. If we want this via a boot option then it
should be a separate one.

> also maxcpus=1, will disable smp, can you enable other cpus later in
> user space?

only booting maxcpus=0 or nosmp will disable SMP permanently. maxcpus=1
should give the boot CPU [if not then we need to fix it], and you can then
enable an arbitrary permutation of good CPUs via:

echo 1 > /sys/devices/system/cpu/cpuX/online

as long as you CONFIG_HOTPLUG_CPU enabled.

What _might_ make sense is to introduce badcpus=2,4,6 that would
permanently disnumerate all the broken CPUs, by striking that mask from
the possible-cpus-map - inaccessible to hotplugging as well. (Note that by
naming it in the inverse way the thing gets a whole new quality - the boot
option in itself explains its purpose.)

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/