RCU fixes for v7.0 (part 2)
Boqun Feng
maintainerHi Linus,
This is another set fixes for RCU in v7.0-rc, please pull these into v7.0. The issue is since we replace the Tasks Trace RCU in tracing (e.g. BPF) with SRCU, SRCU has to work in preemption disabled or scheduler lock held contexts, which was missing in v7.0 RCU pull request.
There is an email thread which can explain more of the context:
https://lore.kernel.org/rcu/fe28d664-3872-40f6-83c6-818627ad5b7d@paulmck-laptop/
Thanks a lot for the report and test from Kumar and Andrea, and Joel and Paul for the prompt fixes!
The following changes since commit f338e77383789c0cae23ca3d48adcc5e9e137e3c:
Linux 7.0-rc4 (2026-03-15 13:52:05 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux.git tags/rcu-fixes.v7.0-20260325a
for you to fetch changes up to a6fc88b22bc8d12ad52e8412c667ec0f5bf055af:
srcu: Use irq_work to start GP in tiny SRCU (2026-03-25 09:00:05 -0700)
----------------------------------------------------------------
RCU fixes for v7.0 - Part 2
Fix a regression introduced by commit c27cea4416a3 ("rcu: Re-implement RCU Tasks Trace in terms of SRCU-fast"): BPF contexts can run with preemption disabled or scheduler locks held, so call_srcu() must work in all such contexts. Fix this by converting SRCU's spinlocks to raw spinlocks and avoiding scheduler lock acquisition in call_srcu() by deferring to an irq_work (similar to call_rcu_tasks_generic()), for both tree SRCU and tiny SRCU. Also fix a follow-on lockdep splat caused by srcu_node allocation under the newly introduced raw spinlock by deferring the allocation to grace-period worker context.
----------------------------------------------------------------
Regards,
Boqun
Boqun Feng (1):
rcu: Use an intermediate irq_work to start process_srcu()
Joel Fernandes (1):
srcu: Use irq_work to start GP in tiny SRCU
Paul E. McKenney (2):
srcu: Use raw spinlocks so call_srcu() can be used under preempt_disable()
srcu: Push srcu_node allocation to GP when non-preemptible
include/linux/srcutiny.h | 4 + include/linux/srcutree.h | 9 +- kernel/rcu/rcu.h | 9 ++ kernel/rcu/srcutiny.c | 19 ++++- kernel/rcu/srcutree.c | 211 +++++++++++++++++++++++------------------------ 5 files changed, 138 insertions(+), 114 deletions(-)
The pull request you sent on Wed, 25 Mar 2026 15:28:51 -0700:
The pull request you sent on Wed, 25 Mar 2026 15:28:51 -0700:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux.gittags/rcu-fixes.v7.0-20260325a
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/aba9da0905f14106b368e0abf75220e744d27626
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html
This pull request was applied to netdev/net.git (main) by Linus Torvalds <[email protected]>:
Hello:
This pull request was applied to netdev/net.git (main) by Linus Torvalds <[email protected]>:
Quoted 9 lines · On Wed, 25 Mar 2026 15:28:51 -0700 you wrote:
Hi Linus,
This is another set fixes for RCU in v7.0-rc, please pull these into v7.0. The issue is since we replace the Tasks Trace RCU in tracing (e.g. BPF) with SRCU, SRCU has to work in preemption disabled or scheduler lock held contexts, which was missing in v7.0 RCU pull request.
[...]
Here is the summary with links:
- [GIT,PULL] RCU fixes for v7.0 (part 2)
https://git.kernel.org/netdev/net/c/aba9da0905f1
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html