[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 3/6] Kconfig: Make cpu hotplug configurable





On 4/8/26 15:27, Jan Beulich wrote:
On 08.04.2026 14:21, Mykyta Poturai wrote:

Hello all.

On 3/30/26 15:19, Jan Beulich wrote:
On 30.03.2026 13:59, Mykyta Poturai wrote:
For the purposes of certification, we want as little code as possible to
be unconditionally compiled in. Make CPU hotplug and SMT operations
configurable to ease the process. This will also help with introducing
CPU hotplug on Arm, where it needs to be configurable.

Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>

Looks largely okay from a technical pov; one nit and one (repeated) remark
below.

--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -53,6 +53,11 @@ static long cf_check smt_up_down_helper(void *data)
       unsigned int cpu, sibling_mask = boot_cpu_data.x86_num_siblings - 1;
       int ret = 0;
+ if ( !IS_ENABLED(CONFIG_CPU_HOTPLUG) )
+    {
+        ASSERT_UNREACHABLE();
+        return -EOPNOTSUPP;
+    }
       opt_smt = up;

Another blank line above this one perhaps?

--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -637,6 +637,14 @@ config SYSTEM_SUSPEND
If unsure, say N. +config CPU_HOTPLUG
+       bool "CPU online/offline support"
+       depends on X86
+       default y
+       help
+         Enable support for bringing CPUs online and offline at runtime. On
+         X86 this is required for disabling SMT.

The name of this option may need input from others; I'm not quite convinced
that this is a good name, as there's no true "hot-plugging" involved here.
IOW I fear the present name is misleading.

My first idea was "CONFIG_RUNTIME_CPU_CONTROL" I can switch back to it.

I could live with that, for at least not being misleading. CPU_ONLINE or
CPU_ONLINE_OFFLINE might be another option, possibly better suited to
later become a dependency (select) of a true CPU_HOTPLUG. As said, input
from others may be helpful.

To me, CONFIG_RUNTIME_CPU_CONTROL sounds a little bit vague. Although we are indeed controlling CPUs at runtime, "control" could also mean cpufreq, power management, affinity pinning. I think CONFIG_CPU_ONLINE_OFFLINE is more precise, as it is clear from the name that we are transitioning CPUs between online and offline states.



Jan





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.