From: Paul E. McKenney Date: Fri, 28 Apr 2017 20:53:04 +0000 (-0700) Subject: srcu: Make SRCU be once again optional X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=07f6e64bf2ab98cad0d9c595659209858e7bff83;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git srcu: Make SRCU be once again optional Commit d160a727c40e ("srcu: Make SRCU be built by default") in response to build errors, which were caused by code that included srcu.h despite !SRCU. However, srcutiny.o is almost 2K of code, which is not insignificant for those attempting to run the Linux kernel on IoT devices. This commit therefore makes SRCU be once again optional, and adjusts srcu.h to allow error-free inclusion in !SRCU kernel builds. Signed-off-by: Paul E. McKenney Acked-by: Nicolas Pitre --- diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 4c1d5f7e62c4..ea356d800675 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h @@ -62,8 +62,13 @@ int init_srcu_struct(struct srcu_struct *sp); #include #elif defined(CONFIG_CLASSIC_SRCU) #include -#else +#elif defined(CONFIG_SRCU) #error "Unknown SRCU implementation specified to kernel configuration" +#else + +/* Dummy definition for things like notifiers. Actual use gets link error. */ +struct srcu_struct { }; + #endif /** diff --git a/init/Kconfig b/init/Kconfig index 1d3475fc9496..d928a3724af9 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -521,7 +521,6 @@ 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