mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] selftest: don't offline the last CPU in cpu hotplug test
@ 2020-12-17 15:34 Lai Jiangshan
  2020-12-17 15:34 ` [PATCH 2/2] selftest: parse the max cpu corretly from cpu list string Lai Jiangshan
  0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2020-12-17 15:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: Lai Jiangshan, Shuah Khan, linux-kselftest

From: Lai Jiangshan <laijs@linux.alibaba.com>

In my box, all CPUs are allowed to be offline.  The test tries to offline
all offline-able CPUs and causes fail on the last one.  We should just
skip offlining the last CPU

Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
---
 tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh | 5 +++++
 1 file changed, 5 insertions(+)

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 0d26b5e3f966..5cdef96326a7 100755
--- a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
+++ b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
@@ -126,6 +126,11 @@ offline_cpu_expect_success()
 {
 	local cpu=$1
 
+	# don't offline the last CPU if all CPUs are offline-able
+	if [[ a$cpu = a`cat $SYSFS/devices/system/cpu/online` ]]; then
+		return
+	fi
+
 	if ! offline_cpu $cpu; then
 		echo $FUNCNAME $cpu: unexpected fail >&2
 		exit 1
-- 
2.19.1.6.gb485710b


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

end of thread, other threads:[~2020-12-17 14:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 15:34 [PATCH 1/2] selftest: don't offline the last CPU in cpu hotplug test Lai Jiangshan
2020-12-17 15:34 ` [PATCH 2/2] selftest: parse the max cpu corretly from cpu list string Lai Jiangshan

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

all inboxes | Powered by JetHome®