public inbox for linux-kselftest@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/cpu-hotplug: Fix check for cpu hotplug not supported
@ 2026-03-19 15:38 Dmytro Maluka
  2026-03-31 22:09 ` Shuah Khan
  0 siblings, 1 reply; 2+ messages in thread
From: Dmytro Maluka @ 2026-03-19 15:38 UTC (permalink / raw)
  To: Shuah Khan, Jihed Chaibi, Dmytro Maluka,
	open list:KERNEL SELFTEST FRAMEWORK, open list

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>
---
 tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
index 6232a46ca6e1..287cfd5809f6 100755
--- a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
+++ b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
@@ -24,7 +24,7 @@ prerequisite()
 		exit $ksft_skip
 	fi
 
-	if ! ls $SYSFS/devices/system/cpu/cpu* > /dev/null 2>&1; then
+	if ! ls $SYSFS/devices/system/cpu/cpu*/online > /dev/null 2>&1; then
 		echo $msg cpu hotplug is not supported >&2
 		exit $ksft_skip
 	fi
-- 
2.53.0.851.ga537e3e6e9-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests/cpu-hotplug: Fix check for cpu hotplug not supported
  2026-03-19 15:38 [PATCH] selftests/cpu-hotplug: Fix check for cpu hotplug not supported Dmytro Maluka
@ 2026-03-31 22:09 ` Shuah Khan
  0 siblings, 0 replies; 2+ messages in thread
From: Shuah Khan @ 2026-03-31 22:09 UTC (permalink / raw)
  To: Dmytro Maluka, Shuah Khan, Jihed Chaibi,
	open list:KERNEL SELFTEST FRAMEWORK, open list, Shuah Khan

On 3/19/26 09:38, Dmytro Maluka wrote:
> 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>
> ---

Applied to linux_kselftest next for Linux 7.1-rc1.

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-31 22:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19 15:38 [PATCH] selftests/cpu-hotplug: Fix check for cpu hotplug not supported Dmytro Maluka
2026-03-31 22:09 ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox