From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162184AbdDWQWM (ORCPT ); Sun, 23 Apr 2017 12:22:12 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54748 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1162145AbdDWQWJ (ORCPT ); Sun, 23 Apr 2017 12:22:09 -0400 Date: Sun, 23 Apr 2017 09:22:05 -0700 From: "Paul E. McKenney" To: kbuild test robot Cc: kbuild-all@01.org, linux-kernel@vger.kernel.org, mingo@kernel.org Subject: Re: [rcu:rcu/next 59/91] tree.c:(.text+0x4248): multiple definition of `srcu_online_cpu' Reply-To: paulmck@linux.vnet.ibm.com References: <201704231318.q6kkGpDC%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704231318.q6kkGpDC%fengguang.wu@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17042316-0024-0000-0000-000002531A4B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006961; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000208; SDB=6.00851409; UDB=6.00420710; IPR=6.00630194; BA=6.00005307; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015145; XFM=3.00000013; UTC=2017-04-23 16:22:06 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17042316-0025-0000-0000-0000439938D8 Message-Id: <20170423162205.GP3956@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-23_15:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1704230297 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 23, 2017 at 01:31:21PM +0800, kbuild test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git rcu/next > head: 87c458e6304c6a1b37bf856e88c70fc37f08851f > commit: da915ad5cf25b5f5d358dd3670c3378d8ae8c03e [59/91] srcu: Parallelize callback handling > config: tile-allnoconfig (attached as .config) > compiler: tilegx-linux-gcc (GCC) 4.6.2 > reproduce: > wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > git checkout da915ad5cf25b5f5d358dd3670c3378d8ae8c03e > # save the attached .config to linux build tree > make.cross ARCH=tile > > All errors (new ones prefixed by >>): > > 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 (Adding Ingo on CC because he also saw this in -tip.) Hmmm... The attached .config has CONFIG_TREE_SRCU=y but no sign of CONFIG_SRCU, which would definitely result in what you are seeing. Taking a look at tile's Kconfig files in current mainline finds me only a "select SRCU", which should not be a problem. OK, time to look at the SRCU code in init/Kconfig: config TINY_SRCU bool default y if 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 help This option selects the full-fledged version of SRCU. And this says that if CONFIG_CLASSIC_SRCU is not selected, you get exactly what the tile guys got. I didn't see this because I am always running rcutorture, which always selects CONFIG_SRCU. Sigh!!! Does the following patch help? Thanx, Paul ------------------------------------------------------------------------ commit 78672b6811bde47aacb0f8bcb128c0107a088849 Author: Paul E. McKenney Date: Sun Apr 23 09:13:44 2017 -0700 srcu: Fix Kconfig botch when SRCU not selected If the CONFIG_SRCU option is not selected, for example, when building 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 diff --git a/init/Kconfig b/init/Kconfig index 4119a44e4157..fe72c12e06a5 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.