Re: [PATCH v2 02/23] cpu/hotplug: Avoid trying to bring up CPUs that are already online
From: Thomas Gleixner
Date: Thu Oct 15 2026 - 17:14:40 EST
On Fri, Oct 09 2026 at 11:07, Will Deacon wrote:
> There's little point trying to bring up a CPU that is already online.
> Although _cpu_up() handles this case by doing nothing (because the
> target state has already been reached), it's wasted effort when we can
> easily elide the call to cpu_up() in the first place.
s/we can ../the call can be .../
> Check that the target CPU isn't already online before invoking cpu_up()
> from cpuhp_bringup_mask().
Confused.
cpuhp_bringup_mask() is only invoked from bringup_nonboot_cpus() during
init. So there is only _ONE_ CPU which can be online and in the present
mask, i.e. the boot CPU, right? Any other CPU than that being online
would be a bug, no?
Can you spell that out please and add a comment to that effect?
I'm not opposed to the change per se, but I doubt that the "win" is
actually measurable as you trade that one pointless call against a
conditional which has to be executed NR_CPUS times, where NR_CPUS-1
times the conditinal is pointless. There is ZERO contention at that
point, so what's the actual benefit?
Thanks,
tglx