From: "Zqiang" <qiang.zhang@linux.dev>
To: "Joel Fernandes" <joelagnelf@nvidia.com>
Cc: paulmck@kernel.org, frederic@kernel.org,
neeraj.upadhyay@kernel.org, urezki@gmail.com, boqun@kernel.org,
rcu@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rcu-tasks: Warn on too-short RCU Tasks Rude grace period
Date: Sun, 18 Oct 2026 02:51:18 +0000 [thread overview]
Message-ID: <0c9fd241b8bdef73b3fe83683a238ad7df13bf65@linux.dev> (raw)
In-Reply-To: <970F52C9-3198-4BD1-B1A9-6A4B24F550AA@nvidia.com>
>
> >
> > On Oct 15, 2026, at 5:46 AM, Zqiang <qiang.zhang@linux.dev> wrote:
> >
> > The RCU Tasks Rude grace period is implemented by invoking the
> > schedule_on_each_cpu() with an empty work function, which forces
> > a context switch on every online CPU and guarantees that all
> > rude-tasks read-side critical sections have completed. However,
> > schedule_on_each_cpu() can fail (via alloc_percpu() returning
> > -ENOMEM) and returns immediately, in which case those context
> > switches never happen, too-short grace period happen.
> >
> > This commit therefore wraps the schedule_on_each_cpu() call in
> > WARN_ONCE() so that this failure is reported as a "Too-short
> > grace period" warning.
> >
> > Signed-off-by: Zqiang <qiang.zhang@linux.dev>
> > ---
> > kernel/rcu/tasks.h | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
> > index fcac7361ec51..91c25717402e 100644
> > --- a/kernel/rcu/tasks.h
> > +++ b/kernel/rcu/tasks.h
> > @@ -1361,7 +1361,8 @@ static void rcu_tasks_be_rude(struct work_struct *work)
> > static void rcu_tasks_rude_wait_gp(struct rcu_tasks *rtp)
> > {
> > rtp->n_ipis += cpumask_weight(cpu_online_mask);
> > - schedule_on_each_cpu(rcu_tasks_be_rude);
> > + WARN_ONCE(schedule_on_each_cpu(rcu_tasks_be_rude),
> > + "%s: Too-short grace period, OOM is now expected behavior!!!\n", rtp->name);
> >
> Is that the best error message? OOM is expected when grace periods do not conclude.
>
Hi, Joel
I will resend v2, use DEFINE_PER_CPU() to replace alloc_percpu() to allocate work_struct objects.
Thanks
Zqiang
> Thanks.
>
> >
> > }
> >
> > static void call_rcu_tasks_rude(struct rcu_head *rhp, rcu_callback_t func);
> > --
> > 2.17.1
> >
>
prev parent reply other threads:[~2026-10-18 2:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 9:46 Zqiang
2026-10-15 16:31 ` Bradley Morgan
2026-10-16 23:41 ` Zqiang
2026-10-17 11:16 ` Bradley Morgan
2026-10-17 12:14 ` Zqiang
2026-10-17 12:20 ` Bradley Morgan
2026-10-17 12:25 ` Bradley Morgan
2026-10-17 13:37 ` Zqiang
2026-10-17 14:08 ` Bradley Morgan
2026-10-17 17:46 ` Paul E. McKenney
2026-10-17 17:49 ` Bradley Morgan
2026-10-17 20:04 ` Paul E. McKenney
2026-10-17 20:08 ` Bradley Morgan
2026-10-17 15:02 ` Joel Fernandes
2026-10-18 2:51 ` Zqiang [this message]
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=0c9fd241b8bdef73b3fe83683a238ad7df13bf65@linux.dev \
--to=qiang.zhang@linux.dev \
--cc=boqun@kernel.org \
--cc=frederic@kernel.org \
--cc=joelagnelf@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=neeraj.upadhyay@kernel.org \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.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®