From: Joel Fernandes <joelagnelf@nvidia.com>
To: linux-kernel@vger.kernel.org
Cc: "Paul E . McKenney" <paulmck@kernel.org>,
Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <neeraj.upadhyay@kernel.org>,
Josh Triplett <josh@joshtriplett.org>,
Boqun Feng <boqun@kernel.org>,
Uladzislau Rezki <urezki@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Zqiang <qiang.zhang@linux.dev>,
rcu@vger.kernel.org, Joel Fernandes <joelagnelf@nvidia.com>
Subject: [PATCH v2 0/7] rcu: fix stuck defer_qs_pending state
Date: Tue, 26 May 2026 18:50:07 -0400 [thread overview]
Message-ID: <20260526225014.314734-1-joelagnelf@nvidia.com> (raw)
This series fixes a bug where rdp->defer_qs_pending can remain stuck in
PENDING when a preempted reader's quiescent state is reported up-tree via
a path other than the deferred-QS irq-work handler (FQS scan, hotplug
transition, expedited GP IPI, context switch). Once stuck, the pending
gate in rcu_read_unlock_special() silently suppresses all future arming
attempts on that CPU. The series adds PENDING -> IDLE transitions at the
missing sites.
Also handles the case where the deferred-QS irq-work handler may run
between segments of a compound section (per Paul McKenney's
counter-example).
The softirq deferred-QS arming path is now also handled (patch 6), which
was the remaining gap flagged in v1.
The last patch is a debug-only detector (CONFIG_RCU_GP_CLEANUP_STALE_CHECK,
marked [TEST COMMIT], not for merge) -- applied alone on unmodified
mainline without patches 2-6 it reliably fires a WARN within 5 minutes
under TREE03 rcutorture, confirming the bug exists and the detector
catches it; with the full fix applied, I could not reproduce the issue.
The git tree with all patches can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/jfern/linux.git (tag: rcu-dqs-stuck-v2-20260526)
Change log:
Changes from v1 to v2:
- Dropped RFC tag now that softirq paths have been investigated.
- Added new patch "rcu: set need_resched on softirq deferred-QS arming
path" to handle the softirq arming case that was deferred in v1.
Link to v1: https://lore.kernel.org/all/20260522142342.1536533-1-joelagnelf@nvidia.com/
Joel Fernandes (7):
rcu: introduce rcu_defer_qs_clear() helper
rcu: clear defer_qs_pending when notifying GP changes
rcu: clear defer_qs_pending in handler for compounded sections
rcu: drop redundant defer_qs_pending clear in irqrestore handler
rcu: clear defer_qs_pending at expedited IPI entry
rcu: set need_resched on softirq deferred-QS arming path
[TEST COMMIT] rcu: detect stuck defer_qs_pending at GP cleanup
kernel/rcu/Kconfig.debug | 11 +++++++++
kernel/rcu/tree.c | 49 ++++++++++++++++++++++++++++++++++++++++
kernel/rcu/tree.h | 13 +++++++++++
kernel/rcu/tree_exp.h | 6 +++++
kernel/rcu/tree_plugin.h | 31 +++++++++++++------------
5 files changed, 95 insertions(+), 15 deletions(-)
base-commit: 95c7d025cc8c3c6c41206e2a18332eb04878b7ef
--
2.34.1
next reply other threads:[~2026-05-26 22:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-26 22:50 Joel Fernandes [this message]
2026-05-26 22:50 ` [PATCH v2 1/7] rcu: introduce rcu_defer_qs_clear() helper Joel Fernandes
2026-05-26 22:50 ` [PATCH v2 2/7] rcu: clear defer_qs_pending when notifying GP changes Joel Fernandes
2026-05-26 22:50 ` [PATCH v2 3/7] rcu: clear defer_qs_pending in handler for compounded sections Joel Fernandes
2026-05-26 22:50 ` [PATCH v2 4/7] rcu: drop redundant defer_qs_pending clear in irqrestore handler Joel Fernandes
2026-05-26 22:50 ` [PATCH v2 5/7] rcu: clear defer_qs_pending at expedited IPI entry Joel Fernandes
2026-05-26 22:50 ` [PATCH v2 6/7] rcu: set need_resched on softirq deferred-QS arming path Joel Fernandes
2026-05-26 22:50 ` [PATCH v2 7/7] [TEST COMMIT] rcu: detect stuck defer_qs_pending at GP cleanup Joel Fernandes
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=20260526225014.314734-1-joelagnelf@nvidia.com \
--to=joelagnelf@nvidia.com \
--cc=boqun@kernel.org \
--cc=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@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=urezki@gmail.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
all inboxes | Powered by JetHome®