]> git.baikalelectronics.ru Git - kernel.git/commit
rcutorture: Call preempt_schedule() through static call/key
authorFrederic Weisbecker <frederic@kernel.org>
Tue, 15 Mar 2022 15:33:38 +0000 (16:33 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 12 Apr 2022 00:07:29 +0000 (17:07 -0700)
commit6f6ac022e488af19a448d17138cbbbd60654b020
tree3144510fbe7db48d3825b07a74a925184c706d3f
parent015ea08d75d84de29697a4a86e0595fffde00f13
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>
include/linux/torture.h