srcu: Make FORCE_NEED_SRCU_NMI_SAFE depend on RCU_EXPERT
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 25 Mar 2025 14:31:45 +0000 (07:31 -0700)
committerBoqun Feng <boqun.feng@gmail.com>
Sat, 29 Mar 2025 04:19:17 +0000 (21:19 -0700)
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.
Given that this new FORCE_NEED_SRCU_NMI_SAFE Kconfig option has no effect
unless the ARCH_HAS_NMI_SAFE_THIS_CPU_OPS Kconfig option is also selected,
it also depends on this Kconfig option.

[ paulmck: Apply Geert Uytterhoeven feedback. ]

[ boqun: Add the "Fixes" tag. ]

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Closes: https://lore.kernel.org/all/CAMuHMdX6dy9_tmpLkpcnGzxyRbe6qSWYukcPp=H1GzZdyd3qBQ@mail.gmail.com/
Fixes: 536e8b9b80bc ("srcu: Add FORCE_NEED_SRCU_NMI_SAFE Kconfig for testing")
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
kernel/rcu/Kconfig

index aa42de4d2768408c29d6a8ab3cc2a4fc7d79a642..4d9b21f69eaae483631cb3027a1b16f59e5ba80a 100644 (file)
@@ -68,6 +68,8 @@ 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
+       depends on ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
        select NEED_SRCU_NMI_SAFE
        default n
        help