Re: [PATCH v4 0/8] rcu: fix stuck defer_qs_pending state and add rescue timer

Joel Fernandes <[email protected]>
Newsgroups org.kernel.vger.rcu,org.kernel.vger.linux-kernel
Message-ID <[email protected]>

On 6/25/2026 8:42 PM, Joel Fernandes wrote:
> 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 (patches 1-7), including the case where the deferred-QS
> irq-work handler may run between segments of a compound section (per Paul
> McKenney's counter-example) and the softirq deferred-QS arming path.
> 
> Patch 8 adds a per-CPU rescue hrtimer that bounds the worst-case
> deferred-QS reporting latency: when the irq-work handler lands in a clean
> (non-reader, non-compound) context it reports the quiescent state directly
> via the new rcu_preempt_deferred_qs_try_report() helper, and the rescue timer
> reuses the same helper so that, under preempt=none, the QS report is quick
> without depending on the scheduler.  The rescue timer is cancelled from the
> normal deferred-QS report path so it does not fire once the quiescent state
> has already been reported.
> 
> This version is rebased on top of Paul's latest rcu/dev branch. The
> rcutorture reader-end deboost test patches that were folded into v3 are now
> in rcu/dev and have been dropped here. The git tree below additionally
> carries two debug-only commits on top of the series ([TEST COMMIT], not for
> merge): a detector that WARNs if defer_qs_pending is stuck at GP cleanup,
> and an rcutorture tweak that gives the async deboost mechanisms up to 500us
> before warning. Applied alone on unmodified mainline, the detector reliably
> fires within 5 minutes under TREE03 rcutorture; 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-v4-20260625)

Additional overnight testing with the patch series passes. Perhaps ready
for some linux -next testing? Or do you want to test on your end as well first?

thanks,
Joel Fernandes
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.