Re: [PATCH] smp: Add bootcpus parameter to boot subset of CPUs

From: Sudeep Holla
Date: Wed Oct 28 2020 - 22:11:57 EST


On Fri, Oct 23, 2020 at 7:24 AM Elliot Berman <eberman@xxxxxxxxxxxxxx> wrote:
>
> In a heterogeneous multiprocessor system, specifying the 'maxcpus'
> parameter on kernel command line does not provide sufficient control
> over which CPUs are brought online at kernel boot time, since CPUs may
> have nonuniform performance characteristics. Thus, add bootcpus kernel
> parameter to control which CPUs should be brought online during kernel
> boot. When both maxcpus and bootcpus is set, the more restrictive of the
> two are booted.
>
> Signed-off-by: Elliot Berman <eberman@xxxxxxxxxxxxxx>
> ---
> Documentation/admin-guide/kernel-parameters.txt | 8 +++++++
> include/linux/cpu.h | 2 +-
> kernel/cpu.c | 4 ++--
> kernel/smp.c | 28 +++++++++++++++++++++++--
> 4 files changed, 37 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 65d047f..ea31af3 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -449,6 +449,14 @@
>
> See Documentation/admin-guide/bootconfig.rst
>
> + bootcpus= [SMP] List of processors that an SMP kernel
> + will bring up during bootup. Similar to maxcpus, except
> + as a cpu list as described above. The more restrictive
> + of maxcpus and bootcpus applies. If bootcpus=1-3 and
> + maxcpus=2, only processors 1 and 2 are booted. As with
> + maxcpus, you can bring up other plugged cpu by executing
> + "echo 1 > /sys/devices/system/cpu/cpuX/online"
> +

There is a fundamental assumption here that the user of this cmdline
understands how
the logical cpu numbers are allocated for the physical cpus. Based on
the discussion
I understand that you want to boot specific physical cpus for whatever
reasons and
here you want to specify the logical cpu numbers for them. So NACK for
that concept
alone irrespective of whether this concept as a whole is acceptable or not.

--
Regards,
Sudeep