Commit 24aca4ae authored by Paul E. McKenney's avatar Paul E. McKenney

torture: Don't try to offline the last CPU

If there is only one online CPU, it doesn't make sense to try to offline
it, as any such attempt is guaranteed to fail.  This commit therefore
check for this condition and refuses to attempt the nonsensical.
Reported-by: default avatarSu Yue <suy.fnst@cn.fujitsu.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.ibm.com>
Tested-By: default avatarSu Yue <suy.fnst@cn.fujitsu.com>
parent 9e98c678
......@@ -88,6 +88,8 @@ bool torture_offline(int cpu, long *n_offl_attempts, long *n_offl_successes,
if (!cpu_online(cpu) || !cpu_is_hotpluggable(cpu))
return false;
if (num_online_cpus() <= 1)
return false; /* Can't offline the last CPU. */
if (verbose > 1)
pr_alert("%s" TORTURE_FLAG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment