rcutorture: Adjust number of reader kthreads per CPU-hotplug operations
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 23 Jul 2018 21:16:47 +0000 (14:16 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 29 Aug 2018 16:20:48 +0000 (09:20 -0700)
commitc04dd09bd38c0df1aa6318164a51eccbc3a9fa5e
tree9f9b5e4eacf93ec6aade9d7214fba3460f90beb3
parentfecad5091f35425246316ab25c8a9f2aa44a7051
rcutorture: Adjust number of reader kthreads per CPU-hotplug operations

Currently, rcutorture provisions rcu_torture_reader() kthreads based
on the initial number of CPUs.  This can be problematic when CPU hotplug
is enabled, as a system with a very large number of CPUs will provision
a very large number of rcu_torture_reader() kthreads.  All of these
kthreads will continue running even if the CPU-hotplug operations result
in only one remaining online CPU.  This can result in all sorts of strange
artifacts due simply to massive overload.

This commit therefore causes the rcu_torture_reader() kthreads to start
blocking as the number of online CPUs decreases.  This is accomplished
by numbering these kthreads, and having each check to make sure that the
number of online CPUs is at least as large as its assigned number.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/rcutorture.c