From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1166515AbdDXILl (ORCPT ); Mon, 24 Apr 2017 04:11:41 -0400 Received: from terminus.zytor.com ([65.50.211.136]:57953 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1166476AbdDXILb (ORCPT ); Mon, 24 Apr 2017 04:11:31 -0400 Date: Mon, 24 Apr 2017 01:10:14 -0700 From: "tip-bot for Paul E. McKenney" Message-ID: Cc: fengguang.wu@intel.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com, paulmck@linux.vnet.ibm.com, mingo@kernel.org Reply-To: mingo@kernel.org, paulmck@linux.vnet.ibm.com, fengguang.wu@intel.com, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de In-Reply-To: <20170423162205.GP3956@linux.vnet.ibm.com> References: <20170423162205.GP3956@linux.vnet.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/rcu] srcu: Fix Kconfig botch when SRCU not selected Git-Commit-ID: 677df9d4615a2db6774cd0e8951bf7404b858b3b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 677df9d4615a2db6774cd0e8951bf7404b858b3b Gitweb: http://git.kernel.org/tip/677df9d4615a2db6774cd0e8951bf7404b858b3b Author: Paul E. McKenney AuthorDate: Sun, 23 Apr 2017 09:22:05 -0700 Committer: Ingo Molnar CommitDate: Mon, 24 Apr 2017 08:14:48 +0200 srcu: Fix Kconfig botch when SRCU not selected If the CONFIG_SRCU option is not selected, for example, when building arch/tile allnoconfig, the following build errors appear: kernel/rcu/tree.o: In function `srcu_online_cpu': tree.c:(.text+0x4248): multiple definition of `srcu_online_cpu' kernel/rcu/srcutree.o:srcutree.c:(.text+0x2120): first defined here kernel/rcu/tree.o: In function `srcu_offline_cpu': tree.c:(.text+0x4250): multiple definition of `srcu_offline_cpu' kernel/rcu/srcutree.o:srcutree.c:(.text+0x2160): first defined here The corresponding .config file shows CONFIG_TREE_SRCU=y, but no sign of CONFIG_SRCU, which fatally confuses SRCU's #ifdefs, resulting in the above errors. The reason this occurs is the folowing line in init/Kconfig's definition for TREE_SRCU: default y if !TINY_RCU && !CLASSIC_SRCU If CONFIG_CLASSIC_SRCU=n, as it will be in for allnoconfig, and if CONFIG_SMP=y, then we will get CONFIG_TREE_SRCU=y but no CONFIG_SRCU, as seen in the .config file, and which will result in the above errors. This error did not show up during rcutorture testing because rcutorture forces CONFIG_SRCU=y, as it must to prevent build errors in rcutorture.c. This commit therefore conditions TREE_SRCU (and TINY_SRCU, while it is at it) with SRCU, like this: default y if SRCU && !TINY_RCU && !CLASSIC_SRCU Reported-by: kbuild test robot Reported-by: Ingo Molnar Signed-off-by: Paul E. McKenney Link: http://lkml.kernel.org/r/20170423162205.GP3956@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- init/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index 4119a44..fe72c12 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -545,13 +545,13 @@ config CLASSIC_SRCU config TINY_SRCU bool - default y if TINY_RCU && !CLASSIC_SRCU + default y if SRCU && TINY_RCU && !CLASSIC_SRCU help This option selects the single-CPU non-preemptible version of SRCU. config TREE_SRCU bool - default y if !TINY_RCU && !CLASSIC_SRCU + default y if SRCU && !TINY_RCU && !CLASSIC_SRCU help This option selects the full-fledged version of SRCU.