Re: [rcu:rcu/urgent 11/11] include/linux/srcu.h:66:2: error: #error "Unknown SRCU implementation specified to kernel configuration"

From: Paul E. McKenney
Date: Sun Apr 23 2017 - 16:14:45 EST


On Mon, Apr 24, 2017 at 03:00:38AM +0800, kbuild test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git rcu/urgent
> head: 746ec1f689abc74dca72fdce4134decdbfaec295
> commit: 746ec1f689abc74dca72fdce4134decdbfaec295 [11/11] srcu: Fix Kconfig botch when SRCU not selected
> config: sparc64-allnoconfig (attached as .config)
> compiler: sparc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
> reproduce:
> wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> git checkout 746ec1f689abc74dca72fdce4134decdbfaec295
> # save the attached .config to linux build tree
> make.cross ARCH=sparc64
>
> All errors (new ones prefixed by >>):
>
> In file included from include/linux/notifier.h:15:0,
> from include/linux/pm_qos.h:8,
> from kernel/power/qos.c:32:
> >> include/linux/srcu.h:66:2: error: #error "Unknown SRCU implementation specified to kernel configuration"
> #error "Unknown SRCU implementation specified to kernel configuration"
> ^~~~~
> In file included from include/linux/pm_qos.h:8:0,
> from kernel/power/qos.c:32:
> >> include/linux/notifier.h:77:21: error: field 'srcu' has incomplete type
> struct srcu_struct srcu;
> ^~~~

And it appears that there is much code that includes srcu.h without
having "select SRCU", which underlines the point that SRCU is no longer
optional. Patch below, pushing to -rcu as well.

------------------------------------------------------------------------

commit b0d5280678ad03d0b8dbdbe827c9e31c43923e02
Author: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
Date: Sun Apr 23 12:50:59 2017 -0700

srcu: Make SRCU be built by default

SRCU is optional, and included only if there is a "select SRCU" in effect.
However, we now have Tiny SRCU, so this commit defaults CONFIG_SRCU=y.

Reported-by: kbuild test robot <fengguang.wu@xxxxxxxxx>
Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>

diff --git a/init/Kconfig b/init/Kconfig
index fe72c12e06a5..42a346b0df43 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -521,6 +521,7 @@ config RCU_EXPERT

config SRCU
bool
+ default y
help
This option selects the sleepable version of RCU. This version
permits arbitrary sleeping or blocking within RCU read-side critical