From: Joel Fernandes <jfern@kernel.org>
To: paulmck@kernel.org
Cc: Kunwu Chan <kunwu.chan@gmail.com>,
dave@stgolabs.net, josh@joshtriplett.org, frederic@kernel.org,
neeraj.upadhyay@kernel.org, joelagnelf@nvidia.com,
boqun@kernel.org, urezki@gmail.com, rostedt@goodmis.org,
mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com,
qiang.zhang@linux.dev, linux-kernel@vger.kernel.org,
rcu@vger.kernel.org, Kunwu Chan <chentao@kylinos.cn>
Subject: Re: [PATCH v3 2/7] rcutorture: Require debug_objects flag for debug-objects test
Date: Wed, 2 Dec 2026 12:40:20 -0500 [thread overview]
Message-ID: <20261202174020.GA4092025@joelbox> (raw)
In-Reply-To: <f9578a29-46c1-464e-9861-f3967a00275d@paulmck-laptop>
On 12/02, "Paul E. McKenney" <paulmck@kernel.org> wrote:
> On Sat, Nov 28, 2026 at 10:27:24PM +0800, Kunwu Chan wrote:
> > rcu_test_debug_objects() checks for missing callback and barrier
> > operations only when ->debug_objects is set. With the flag clear,
> > execution falls through to the test even if those operations are
> > missing.
> >
> > With CONFIG_DEBUG_OBJECTS_RCU_HEAD=y and rcutorture.object_debug=1,
> > the trivial flavor can therefore call a NULL function pointer.
> >
> > Skip the test for flavors that do not set ->debug_objects.
> >
> > Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
>
> Nice, but one issue below.
>
> Thanx, Paul
>
> > ---
> > kernel/rcu/rcutorture.c | 9 +++++++--
> > 1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
> > index 67fc770abc102..1648e6369d809 100644
> > --- a/kernel/rcu/rcutorture.c
> > +++ b/kernel/rcu/rcutorture.c
> > @@ -4774,8 +4774,13 @@ static void rcu_test_debug_objects(void)
> > return;
> > }
> >
> > - if (WARN_ON_ONCE(cur_ops->debug_objects &&
> > - (!cur_ops->call || !cur_ops->cb_barrier)))
> > + if (!cur_ops->debug_objects) {
>
> Could you please do something here like a:
>
> WARN_ON_ONCE(IS_BUILTIN(CONFIG_RCU_TORTURE_TEST));
>
> This allows us to spot this sort of misconfiguration in things like
> torture.sh, so that we can fix them.
Paul's suggestion makes sense to me, I have proactively applied this 7 patch series
for v7.6 for further review and testing. Thanks!
Don't need to send another iteration if this is the only change for this
particular patch, here is the final patch:
https://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux.git/commit/?h=dev&id=46640c462c609b28547d1f41a40c43640bc4dad7
thanks,
Joel Fernandes
>
> > + pr_alert("%s: %s does not support debug-object testing\n",
> > + KBUILD_MODNAME, cur_ops->name);
> > + return;
> > + }
> > +
> > + if (WARN_ON_ONCE(!cur_ops->call || !cur_ops->cb_barrier))
> > return;
> >
> > struct rcu_head *rhp = kmalloc_obj(*rhp);
> > --
> > 2.43.0
> >
next prev parent reply other threads:[~2026-12-02 17:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-28 14:27 [PATCH v3 0/7] rcu: Record callback enqueue stacks and add torture tests Kunwu Chan
2026-11-28 14:27 ` [PATCH v3 1/7] rcu-tasks: Record callback enqueue stack Kunwu Chan
2026-11-28 14:27 ` [PATCH v3 2/7] rcutorture: Require debug_objects flag for debug-objects test Kunwu Chan
2026-12-02 16:52 ` Paul E. McKenney
2026-12-02 17:40 ` Joel Fernandes [this message]
2026-11-28 14:27 ` [PATCH v3 3/7] rcutorture: Test duplicate call_rcu_tasks() callback enqueue Kunwu Chan
2026-11-28 14:27 ` [PATCH v3 4/7] rcutorture: Add KASAN aux-stack self-test Kunwu Chan
2026-11-28 14:27 ` [PATCH v3 5/7] rcutorture: Add kasan-aux.sh aux-stack checker Kunwu Chan
2026-11-28 14:27 ` [PATCH v3 6/7] rcutorture: Run KASAN aux-stack checks from torture.sh Kunwu Chan
2026-11-28 14:27 ` [PATCH v3 7/7] rcutorture: Accept TRIVIAL-PREEMPT skips in kasan-aux.sh Kunwu Chan
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=20261202174020.GA4092025@joelbox \
--to=jfern@kernel.org \
--cc=boqun@kernel.org \
--cc=chentao@kylinos.cn \
--cc=dave@stgolabs.net \
--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=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