aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Weisbecker <frederic@kernel.org>2022-03-15 16:33:38 +0100
committerPaul E. McKenney <paulmck@kernel.org>2022-04-11 17:07:29 -0700
commitbd6c375b92c3f367e184d164e12952e4b9d9fb4f (patch)
tree3144510fbe7db48d3825b07a74a925184c706d3f
parentrcutorture: Add missing return and use __func__ in warning (diff)
downloadlinux-dev-bd6c375b92c3f367e184d164e12952e4b9d9fb4f.tar.xz
linux-dev-bd6c375b92c3f367e184d164e12952e4b9d9fb4f.zip
rcutorture: Call preempt_schedule() through static call/key
The rcutorture test suite sometimess triggers a random scheduler preemption call while simulating a read delay. Unfortunately, its direct call to preempt_schedule() bypasses the static call/key filter used by CONFIG_PREEMPT_DYNAMIC. This breaks the no-preempt assumption when the dynamic preemption mode is "none". For example, rcu_blocking_is_gp() is fooled and abbreviates grace periods when the CPU runs in no-preempt UP mode. Fix this by making torture_preempt_schedule() call __preempt_schedule(), which uses the static call/key. Reported-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
-rw-r--r--include/linux/torture.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/torture.h b/include/linux/torture.h
index 63fa4196e51c..7038104463e4 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -118,7 +118,7 @@ void _torture_stop_kthread(char *m, struct task_struct **tp);
_torture_stop_kthread("Stopping " #n " task", &(tp))
#ifdef CONFIG_PREEMPTION
-#define torture_preempt_schedule() preempt_schedule()
+#define torture_preempt_schedule() __preempt_schedule()
#else
#define torture_preempt_schedule() do { } while (0)
#endif