]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: cpu-hotplug: fix case where CPUs offline > CPUs present
authorColin Ian King <colin.king@canonical.com>
Thu, 10 Jan 2019 12:38:02 +0000 (12:38 +0000)
committerShuah Khan <shuah@kernel.org>
Fri, 25 Jan 2019 21:57:45 +0000 (14:57 -0700)
commit4f83830bba8e4f71c46b0ce0274c32ec65624c31
tree19a15bd955ef9927db0f893bb8d755d985712906
parent84db6df35dc9700402eb5440964af3a2426f5eb6
selftests: cpu-hotplug: fix case where CPUs offline > CPUs present

The cpu-hotplug test assumes that we can offline the maximum CPU as
described by /sys/devices/system/cpu/offline.  However, in the case
where the number of CPUs exceeds like kernel configuration then
the offline count can be greater than the present count and we end
up trying to test the offlining of a CPU that is not available to
offline.  Fix this by testing the maximum present CPU instead.

Also, the test currently offlines the CPU and does not online it,
so fix this by onlining the CPU after the test.

Fixes: 33c268101094 ("fault-injection: add selftests for cpu and memory hotplug")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Shuah Khan <shuah@kernel.org>
tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh