]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rcu: Use an intermediate irq_work to start process_srcu()
authorBoqun Feng <boqun@kernel.org>
Thu, 19 Mar 2026 00:56:21 +0000 (17:56 -0700)
committerBoqun Feng <boqun@kernel.org>
Wed, 25 Mar 2026 15:59:59 +0000 (08:59 -0700)
commit7c405fb3279b39244b260b54f1bd6488689ae235
tree223cf55ff026faf1cc094561d3d3292230caa00b
parent61bbcfb50514a8a94e035a7349697a3790ab4783
rcu: Use an intermediate irq_work to start process_srcu()

Since commit c27cea4416a3 ("rcu: Re-implement RCU Tasks Trace in terms
of SRCU-fast") we switched to SRCU in BPF. However as BPF instrument can
happen basically everywhere (including where a scheduler lock is held),
call_srcu() now needs to avoid acquiring scheduler lock because
otherwise it could cause deadlock [1]. Fix this by following what the
previous RCU Tasks Trace did: using an irq_work to delay the queuing of
the work to start process_srcu().

[boqun: Apply Joel's feedback]
[boqun: Apply Andrea's test feedback]

Reported-by: Andrea Righi <arighi@nvidia.com>
Closes: https://lore.kernel.org/all/abjzvz_tL_siV17s@gpd4/
Fixes: commit c27cea4416a3 ("rcu: Re-implement RCU Tasks Trace in terms of SRCU-fast")
Link: https://lore.kernel.org/rcu/3c4c5a29-24ea-492d-aeee-e0d9605b4183@nvidia.com/
Suggested-by: Zqiang <qiang.zhang@linux.dev>
Tested-by: Andrea Righi <arighi@nvidia.com>
Tested-by: Paul E. McKenney <paulmck@kernel.org>
Tested-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Boqun Feng <boqun@kernel.org>
include/linux/srcutree.h
kernel/rcu/srcutree.c