]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/cpu-hotplug: Fix check for cpu hotplug not supported
authorDmytro Maluka <dmaluka@chromium.org>
Thu, 19 Mar 2026 15:38:12 +0000 (16:38 +0100)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 31 Mar 2026 22:07:19 +0000 (16:07 -0600)
commit9d2dbd3d59d8fb9cfd98bf857975fcd151fb3946
tree2b6b0dc6ed85d73cd976d2cf081c71e1ab501766
parent64fac99037689020ad97e472ae898e96ea3616dc
selftests/cpu-hotplug: Fix check for cpu hotplug not supported

If CONFIG_HOTPLUG_CPU is disabled, /sys/devices/system/cpu/cpu*
directories are still populated, so the test fails to correctly detect
that CPU hotplug is not supported.

Fix this by checking for the presence of 'online' files in those
directories instead. The 'online' node is created for the given CPU if
and only if this CPU supports hotplug. So if none of the CPUs have
'online' nodes, it means CPU hotplug is not supported.

Signed-off-by: Dmytro Maluka <dmaluka@chromium.org>
Link: https://lore.kernel.org/r/20260319153825.2813576-1-dmaluka@chromium.org
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh