From: Boqun Feng <boqun.feng@gmail.com>
To: Joel Fernandes <joelagnelf@nvidia.com>
Cc: paulmck@kernel.org, Steven Rostedt <rostedt@goodmis.org>,
rcu@vger.kernel.org, Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <neeraj.upadhyay@kernel.org>,
Josh Triplett <josh@joshtriplett.org>,
Uladzislau Rezki <urezki@gmail.com>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Zqiang <qiang.zhang@linux.dev>, Shuah Khan <shuah@kernel.org>,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
Yao Kai <yaokai34@huawei.com>, Tengda Wu <wutengda2@huawei.com>
Subject: Re: [PATCH -next 1/8] rcu: Fix rcu_read_unlock() deadloop due to softirq
Date: Sun, 4 Jan 2026 18:00:21 +0800 [thread overview]
Message-ID: <aVo6NRYDhxlMUANZ@tardis-2.local> (raw)
In-Reply-To: <252063db-ec72-42df-b9e0-b8dc0aa6bef9@nvidia.com>
On Fri, Jan 02, 2026 at 07:41:38PM -0500, Joel Fernandes wrote:
>
>
> On 1/2/2026 2:51 PM, Paul E. McKenney wrote:
> > On Fri, Jan 02, 2026 at 12:30:09PM -0500, Steven Rostedt wrote:
> >> On Fri, 2 Jan 2026 12:28:07 -0500
> >> Steven Rostedt <rostedt@goodmis.org> wrote:
> >>
> >>> Stacktrace should have recursion protection too.
> >>>
> >>> Can you try this patch to see if it would have fixed the problem too?
> >>
> >> As I believe the recursion protection should be in the tracing
> >> infrastructure more than in RCU. As RCU is used as an active participant in
> >> the kernel whereas tracing is supposed to be only an observer.
> >>
> >> If tracing is the culprit, it should be the one that is fixed.
> >
> > Makes sense to me! But then it would... ;-)
> >
> Could we fix it in both? (RCU and tracing). The patch just adds 3 more net lines
> to RCU code. It'd be good to have a guard rail against softirq recursion in RCU
> read unlock path, as much as the existing guard rail we already have with
> irq_work? After all, both paths attempt to do deferred work when it is safer to
> do so.
>
Agreed. First it's crucial that RCU itself can prevent indefinitely
entering rcu_read_unlock_special(), because although unlikely, any RCU
reader in raise_softirq_irqoff() would cause a similar infinite loop.
Second, with solely the tracing fix, there still exists a call chain:
rcu_read_unlock_special():
raise_softirq_irqoff():
trace_softirq_raise():
rcu_read_unlock_special():
raise_softirq_irqoff():
trace_softirq_raise(); // <- recursion ends here
while with the RCU fix added, the call chain ends at the second
rcu_read_unlock_special():
rcu_read_unlock_special():
raise_softirq_irqoff():
trace_softirq_raise():
rcu_read_unlock_special(); // <- recursion ends here
which would slightly improve the performance becasue of fewer calls.
I'm going to include this into the RCU PR for 7.0 if no one objects.
Thanks!
Regards,
Boqun
> Yao, if you could test Steve's patch and reply whether it fixes it too?
>
> thanks,
>
> - Joel
>
>
>
>
next prev parent reply other threads:[~2026-01-04 10:00 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-01 16:34 [PATCH -next 0/8] RCU updates from me for next merge window Joel Fernandes
2026-01-01 16:34 ` [PATCH -next 1/8] rcu: Fix rcu_read_unlock() deadloop due to softirq Joel Fernandes
2026-01-02 17:28 ` Steven Rostedt
2026-01-02 17:30 ` Steven Rostedt
2026-01-02 19:51 ` Paul E. McKenney
2026-01-03 0:41 ` Joel Fernandes
2026-01-04 3:20 ` Yao Kai
2026-01-05 17:16 ` Steven Rostedt
2026-01-09 16:38 ` Steven Rostedt
2026-01-04 10:00 ` Boqun Feng [this message]
2026-01-07 23:14 ` Frederic Weisbecker
2026-01-08 1:02 ` Joel Fernandes
2026-01-08 1:35 ` Joel Fernandes
2026-01-08 3:35 ` Joel Fernandes
2026-01-08 15:39 ` Frederic Weisbecker
2026-01-08 15:57 ` Mathieu Desnoyers
2026-01-08 15:25 ` Frederic Weisbecker
2026-01-09 1:12 ` Joel Fernandes
2026-01-09 14:23 ` Frederic Weisbecker
2026-01-01 16:34 ` [PATCH -next 2/8] srcu: Use suitable gfp_flags for the init_srcu_struct_nodes() Joel Fernandes
2026-01-01 16:34 ` [PATCH -next 3/8] rcu/nocb: Remove unnecessary WakeOvfIsDeferred wake path Joel Fernandes
2026-01-08 15:57 ` Frederic Weisbecker
2026-01-09 1:39 ` Joel Fernandes
2026-01-09 10:32 ` Boqun Feng
2026-01-09 11:20 ` Joel Fernandes
2026-01-11 12:14 ` Boqun Feng
2026-01-01 16:34 ` [PATCH -next 4/8] rcu/nocb: Add warning if no rcuog wake up attempt happened during overload Joel Fernandes
2026-01-08 17:22 ` Frederic Weisbecker
2026-01-09 3:49 ` Joel Fernandes
2026-01-09 14:36 ` Frederic Weisbecker
2026-01-09 21:20 ` Joel Fernandes
2026-01-01 16:34 ` [PATCH -next 5/8] rcu/nocb: Add warning to detect if overload advancement is ever useful Joel Fernandes
2026-01-14 1:09 ` Joel Fernandes
2026-01-01 16:34 ` [PATCH -next 6/8] rcu: Reduce synchronize_rcu() latency by reporting GP kthread's CPU QS early Joel Fernandes
2026-01-01 16:34 ` [PATCH -next 7/8] rcutorture: Prevent concurrent kvm.sh runs on same source tree Joel Fernandes
2026-01-01 16:34 ` [PATCH -next 8/8] rcutorture: Add --kill-previous option to terminate previous kvm.sh runs Joel Fernandes
2026-01-01 22:48 ` Paul E. McKenney
2026-01-04 10:55 ` [PATCH -next 0/8] RCU updates from me for next merge window Boqun Feng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aVo6NRYDhxlMUANZ@tardis-2.local \
--to=boqun.feng@gmail.com \
--cc=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=joelagnelf@nvidia.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=neeraj.upadhyay@kernel.org \
--cc=paulmck@kernel.org \
--cc=qiang.zhang@linux.dev \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
--cc=urezki@gmail.com \
--cc=wutengda2@huawei.com \
--cc=yaokai34@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox