Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Dmytro Maluka and committed by
Shuah Khan
9d2dbd3d 64fac990

+1 -1
+1 -1
tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
··· 24 24 exit $ksft_skip 25 25 fi 26 26 27 - if ! ls $SYSFS/devices/system/cpu/cpu* > /dev/null 2>&1; then 27 + if ! ls $SYSFS/devices/system/cpu/cpu*/online > /dev/null 2>&1; then 28 28 echo $msg cpu hotplug is not supported >&2 29 29 exit $ksft_skip 30 30 fi