rcutorture: Preempt rather than block when testing task stalls
authorPaul E. McKenney <paulmck@kernel.org>
Mon, 17 May 2021 04:17:27 +0000 (21:17 -0700)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 27 Jul 2021 18:39:30 +0000 (11:39 -0700)
commit59e836662860a28880d45b35e1fbc5afca4847ce
treea34efca09e2547468226926b5827014969822c84
parent25f6fa53a07422e2bb004229eefd32760c469fb0
rcutorture: Preempt rather than block when testing task stalls

Currently, rcu_torture_stall() does a one-jiffy timed wait when
stall_cpu_block is set.  This works, but emits a pointless splat in
CONFIG_PREEMPT=y kernels.  This commit avoids this splat by instead
invoking preempt_schedule() in CONFIG_PREEMPT=y kernels.

This uses an admittedly ugly #ifdef, but abstracted approaches just
looked worse.  A prettier approach would provide a preempt_schedule()
definition with a WARN_ON() for CONFIG_PREEMPT=n kernels, but this seems
quite silly.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/rcutorture.c