]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rcu-tasks: Avoid raw-spinlocked wakeups from call_rcu_tasks_generic()
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 24 Nov 2021 00:16:50 +0000 (16:16 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Thu, 9 Dec 2021 18:52:11 +0000 (10:52 -0800)
commit3063b33a347c088e87516764d487e46fea3dfc94
treec32d61232109eb2faf19d4afbbd5d1ea17c17e89
parent7d13d30bb6c54b57d196eab89dea2729a565dbd7
rcu-tasks: Avoid raw-spinlocked wakeups from call_rcu_tasks_generic()

If the caller of of call_rcu_tasks(), call_rcu_tasks_rude(),
or call_rcu_tasks_trace() holds a raw spinlock, and then if
call_rcu_tasks_generic() determines that the grace-period kthread must
be awakened, then the wakeup might acquire a normal spinlock while a
raw spinlock is held.  This results in lockdep splats when the
kernel is built with CONFIG_PROVE_RAW_LOCK_NESTING=y.

This commit therefore defers the wakeup using irq_work_queue().

It would be nice to directly invoke wakeup when a raw spinlock is not
held, but there is currently no way to check for this in all kernels.

Reported-by: Martin Lau <kafai@fb.com>
Cc: Neeraj Upadhyay <neeraj.iitr10@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tasks.h