]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rcutorture: Avoid problematic critical section nesting on PREEMPT_RT
authorScott Wood <swood@redhat.com>
Fri, 20 Aug 2021 07:42:36 +0000 (09:42 +0200)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 25 Aug 2021 18:45:13 +0000 (11:45 -0700)
commit38babc43f45e08a6ea613b1f890d6f1837b16bfd
tree2832af5f2a02c90ce47d78e9a5f1198a362a3724
parenteec6d0554824966f35e5b3be16640f56c7ac392c
rcutorture: Avoid problematic critical section nesting on PREEMPT_RT

rcutorture is generating some nesting scenarios that are not compatible on PREEMPT_RT.
For example:
preempt_disable();
rcu_read_lock_bh();
preempt_enable();
rcu_read_unlock_bh();

The problem here is that on PREEMPT_RT the bottom halves have to be
disabled and enabled in preemptible context.

Reorder locking: start with BH locking and continue with then with
disabling preemption or interrupts. In the unlocking do it reverse by
first enabling interrupts and preemption and BH at the very end.
Ensure that on PREEMPT_RT BH locking remains unchanged if in
non-preemptible context.

Link: https://lkml.kernel.org/r/20190911165729.11178-6-swood@redhat.com
Link: https://lkml.kernel.org/r/20210819182035.GF4126399@paulmck-ThinkPad-P17-Gen-1
Signed-off-by: Scott Wood <swood@redhat.com>
[bigeasy: Drop ATOM_BH, make it only about changing BH in atomic
context. Allow enabling RCU in IRQ-off section. Reword commit message.]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/rcutorture.c