mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: paulmck@kernel.org
Cc: linux-kernel@vger.kernel.org,
	David Woodhouse <dwmw2@infradead.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	Neeraj Upadhyay <neeraj.upadhyay@kernel.org>,
	Joel Fernandes <joelagnelf@nvidia.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Boqun Feng <boqun@kernel.org>,
	Uladzislau Rezki <urezki@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Zqiang <qiang.zhang@linux.dev>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Kunwu Chan <kunwu.chan@gmail.com>,
	Puranjay Mohan <puranjay@kernel.org>,
	rcu@vger.kernel.org
Subject: Re: [PATCH 3/4] rcutorture: Run NMI-safe SRCU readers from NMI
Date: Wed, 11 Nov 2026 09:10:35 -0500	[thread overview]
Message-ID: <3f6746a7-e1eb-4463-aec6-687489d7c637@efficios.com> (raw)
In-Reply-To: <9fbcb43b-ddea-44bf-b339-d01ba723d5a2@paulmck-laptop>

On 2026-11-10 17:46, Paul E. McKenney wrote:
> On Tue, Nov 10, 2026 at 02:28:43PM -0500, Mathieu Desnoyers wrote:
[...]
> A good addition!  Vanilla RCU could benefit from this as well, but that
> can be done later.

Thanks!

[...]
>> +            if (READ_ONCE(p->rtort_pipe_count) > 1)
>> +                    atomic_inc(&n_rcu_torture_error);
>
> Doesn't this miss doing a splat on RCU too-short grace period?
[...]
> Maybe a separate global array for NMIs, parallel to the "Reader Pipe:"
> and "Reader Batch:" arrays, that is atomically updated and printed
> separately, maybe "NMI Reader Pipe:" or similar?
>
> Or is there a better way?

It does miss it.  The test still ends in FAILURE.  But there is no
"!!!", no warning, and nothing in "Reader Pipe:".

v2 takes your approach.  The NMI reader counts its pipe and batch values
in two arrays of atomic_long_t.  rcu_torture_stats_print() prints them
as "NMI Reader Pipe:" and "NMI Reader Batch:", only when readers ran in
NMI.  A too-short grace period in NMI joins the "!!!" condition, with
its own WARN_ON_ONCE().  So the other readers keep their this_cpu_inc().

The NMI reader skips the trace event and rcu_ftrace_dump() of the other
readers.  The "!!!" and the warning then come from the statistics
kthread.

I checked it with a mutation that makes every NMI reader see a pipe
count of 2: the run splats as expected.

[...]
>>              cur_ops->call(&rtncp->rh, rcu_torture_nmi_invoked);
>
> OK, the invocation of ->call() without testing ->call() is OK because
> rcu_torture_nmi_do_calls never gets set if ->call() is NULL.

Yes.

Thanks!

Mathieu


-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com

  reply	other threads:[~2026-11-11 14:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 19:28 [PATCH 0/4] srcu: NMI-safe atomic SRCU readers, and their irqsave forms Mathieu Desnoyers
2026-11-10 19:28 ` [PATCH 1/4] srcu: Make atomic SRCU readers NMI-safe Mathieu Desnoyers
2026-11-10 19:28 ` [PATCH 2/4] srcu: Add irqsave variants of the atomic SRCU readers Mathieu Desnoyers
2026-11-10 19:28 ` [PATCH 3/4] rcutorture: Run NMI-safe SRCU readers from NMI Mathieu Desnoyers
2026-11-10 22:46   ` Paul E. McKenney
2026-11-11 14:10     ` Mathieu Desnoyers [this message]
2026-11-10 19:28 ` [PATCH 4/4] rcutorture: Test the irqsave forms of atomic SRCU readers Mathieu Desnoyers
2026-11-10 22:33   ` Paul E. McKenney
2026-11-11  0:29     ` Paul E. McKenney
2026-11-11  4:13       ` Mathieu Desnoyers

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=3f6746a7-e1eb-4463-aec6-687489d7c637@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=boqun@kernel.org \
    --cc=dave@stgolabs.net \
    --cc=dwmw2@infradead.org \
    --cc=frederic@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=joelagnelf@nvidia.com \
    --cc=josh@joshtriplett.org \
    --cc=kunwu.chan@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neeraj.upadhyay@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=puranjay@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®