From: Geert Uytterhoeven <geert@linux-m68k.org>
To: paulmck@kernel.org
Cc: Boqun Feng <boqun.feng@gmail.com>,
rcu@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
Steven Rostedt <rostedt@goodmis.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <neeraj.upadhyay@kernel.org>,
Joel Fernandes <joel@joelfernandes.org>,
Josh Triplett <josh@joshtriplett.org>,
Uladzislau Rezki <urezki@gmail.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Zqiang <qiang.zhang1211@gmail.com>,
Davidlohr Bueso <dave@stgolabs.net>,
Shuah Khan <shuah@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Huth <thuth@redhat.com>,
"Borislav Petkov (AMD)" <bp@alien8.de>,
Ard Biesheuvel <ardb@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Josh Poimboeuf <jpoimboe@kernel.org>,
Yury Norov <yury.norov@gmail.com>,
Valentin Schneider <vschneid@redhat.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-trace-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH rcu 10/11] srcu: Add FORCE_NEED_SRCU_NMI_SAFE Kconfig for testing
Date: Tue, 25 Mar 2025 15:57:43 +0100 [thread overview]
Message-ID: <CAMuHMdVVQWZCUFT2uF+QSQz-GzOz2PvugkeatA6bDQeNHU9PSA@mail.gmail.com> (raw)
In-Reply-To: <5bf94fdb-7556-4b34-ba21-389dfa1df4f7@paulmck-laptop>
Hi Paul,
On Tue, 25 Mar 2025 at 15:36, Paul E. McKenney <paulmck@kernel.org> wrote:
> On Tue, Mar 25, 2025 at 09:04:31AM +0100, Geert Uytterhoeven wrote:
> > On Wed, 19 Feb 2025 at 16:44, Boqun Feng <boqun.feng@gmail.com> wrote:
> > > From: "Paul E. McKenney" <paulmck@kernel.org>
> > >
> > > The srcu_read_lock_nmisafe() and srcu_read_unlock_nmisafe() functions
> > > map to __srcu_read_lock() and __srcu_read_unlock() on systems like x86
> > > that have NMI-safe this_cpu_inc() operations. This makes the underlying
> > > __srcu_read_lock_nmisafe() and __srcu_read_unlock_nmisafe() functions
> > > difficult to test on (for example) x86 systems, allowing bugs to creep in.
> > >
> > > This commit therefore creates a FORCE_NEED_SRCU_NMI_SAFE Kconfig that
> > > forces those underlying functions to be used even on systems where they
> > > are not needed, thus providing better testing coverage.
> > >
> > > Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> > > Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
> >
> > Thanks for your patch, which is now commit 536e8b9b80bc7a0a ("srcu:
> > Add FORCE_NEED_SRCU_NMI_SAFE Kconfig for testing") in linus/master
> >
> > > --- a/kernel/rcu/Kconfig
> > > +++ b/kernel/rcu/Kconfig
> > > @@ -65,6 +65,17 @@ config TREE_SRCU
> > > help
> > > This option selects the full-fledged version of SRCU.
> > >
> > > +config FORCE_NEED_SRCU_NMI_SAFE
> > > + bool "Force selection of NEED_SRCU_NMI_SAFE"
> >
> > What am I supposed to answer here? "n" I guess.
> > What about distro and allmodconfig kernels?
>
> Yes, you should select "n" unless ...
>
> > > + depends on !TINY_SRCU
> > > + select NEED_SRCU_NMI_SAFE
> > > + default n
> > > + help
> > > + This option forces selection of the NEED_SRCU_NMI_SAFE
> > > + Kconfig option, allowing testing of srcu_read_lock_nmisafe()
> > > + and srcu_read_unlock_nmisafe() on architectures (like x86)
> > > + that select the ARCH_HAS_NMI_SAFE_THIS_CPU_OPS Kconfig option.
> >
> > Perhaps this should depend on ARCH_HAS_NMI_SAFE_THIS_CPU_OPS?
>
> ... you are on a system selecting ARCH_HAS_NMI_SAFE_THIS_CPU_OPS and
So a dependency on ARCH_HAS_NMI_SAFE_THIS_CPU_OPS does make sense,
doesn't it?
> you would like to test the SRCU setup that needed only by systems that
> do not select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS.
>
> Ah. I forgot to add "depends on RCU_EXPERT".
Yes, that makes sense.
> Apologies, I will fix this. Does the patch show below do the trick?
>
> Thanx, Paul
>
> ------------------------------------------------------------------------
>
> commit b5c8c6f89c6d7ac778e961ad4b883eada0c1f42a
> Author: Paul E. McKenney <paulmck@kernel.org>
> Date: Tue Mar 25 07:31:45 2025 -0700
>
> srcu: Make FORCE_NEED_SRCU_NMI_SAFE depend on RCU_EXPERT
>
> The FORCE_NEED_SRCU_NMI_SAFE is useful only for those wishing to test
> the SRCU code paths that accommodate architectures that do not have
> NMI-safe per-CPU operations, that is, those architectures that do not
> select the ARCH_HAS_NMI_SAFE_THIS_CPU_OPS Kconfig option. As such, this
> is a specialized Kconfig option that is not intended for casual users.
>
> This commit therefore hides it behind the RCU_EXPERT Kconfig option.
>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Closes: https://lore.kernel.org/all/CAMuHMdX6dy9_tmpLkpcnGzxyRbe6qSWYukcPp=H1GzZdyd3qBQ@mail.gmail.com/
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
>
> diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig
> index b3f985d41717a..cc4ce79f58aa6 100644
> --- a/kernel/rcu/Kconfig
> +++ b/kernel/rcu/Kconfig
> @@ -68,6 +68,7 @@ config TREE_SRCU
> config FORCE_NEED_SRCU_NMI_SAFE
> bool "Force selection of NEED_SRCU_NMI_SAFE"
> depends on !TINY_SRCU
> + depends on RCU_EXPERT
> select NEED_SRCU_NMI_SAFE
> default n
> help
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2025-03-25 14:58 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 15:39 [PATCH rcu 00/11] RCU torture changes for v6.15 Boqun Feng
2025-02-19 15:39 ` [PATCH rcu 01/11] torture: Add get_torture_init_jiffies() for test-start time Boqun Feng
2025-02-19 15:39 ` [PATCH rcu 02/11] rcutorture: Add a test_boost_holdoff module parameter Boqun Feng
2025-02-19 15:39 ` [PATCH rcu 03/11] rcutorture: Include grace-period sequence numbers in failure/close-call Boqun Feng
2025-02-19 15:39 ` [PATCH rcu 04/11] rcutorture: Expand failure/close-call grace-period output Boqun Feng
2025-02-19 15:39 ` [PATCH rcu 05/11] rcu: Trace expedited grace-period numbers in hexadecimal Boqun Feng
2025-02-19 15:39 ` [PATCH rcu 06/11] rcutorture: Add ftrace-compatible timestamp to GP# failure/close-call output Boqun Feng
2025-02-19 15:39 ` [PATCH rcu 07/11] rcutorture: Make cur_ops->format_gp_seqs take buffer length Boqun Feng
2025-02-19 15:39 ` [PATCH rcu 08/11] rcutorture: Move RCU_TORTURE_TEST_{CHK_RDR_STATE,LOG_CPU} to bool Boqun Feng
2025-02-19 15:39 ` [PATCH rcu 09/11] rcutorture: Complain when invalid SRCU reader_flavor is specified Boqun Feng
2025-02-19 15:39 ` [PATCH rcu 10/11] srcu: Add FORCE_NEED_SRCU_NMI_SAFE Kconfig for testing Boqun Feng
2025-03-25 8:04 ` Geert Uytterhoeven
2025-03-25 14:36 ` Paul E. McKenney
2025-03-25 14:57 ` Geert Uytterhoeven [this message]
2025-03-25 15:07 ` Paul E. McKenney
2025-03-25 15:36 ` Geert Uytterhoeven
2025-03-25 15:51 ` Paul E. McKenney
2025-03-26 5:42 ` Boqun Feng
2025-02-19 15:39 ` [PATCH rcu 11/11] torture: Make SRCU lockdep testing use srcu_read_lock_nmisafe() Boqun Feng
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=CAMuHMdVVQWZCUFT2uF+QSQz-GzOz2PvugkeatA6bDQeNHU9PSA@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=akpm@linux-foundation.org \
--cc=ardb@kernel.org \
--cc=boqun.feng@gmail.com \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dave@stgolabs.net \
--cc=frederic@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=jpoimboe@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=neeraj.upadhyay@kernel.org \
--cc=paulmck@kernel.org \
--cc=qiang.zhang1211@gmail.com \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
--cc=thuth@redhat.com \
--cc=urezki@gmail.com \
--cc=vschneid@redhat.com \
--cc=yury.norov@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;
as well as URLs for NNTP newsgroup(s).