From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: kbuild test robot <fengguang.wu@intel.com>
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'
Date: Sun, 23 Apr 2017 09:22:05 -0700 [thread overview]
Message-ID: <20170423162205.GP3956@linux.vnet.ibm.com> (raw)
In-Reply-To: <201704231318.q6kkGpDC%fengguang.wu@intel.com>
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 <paulmck@linux.vnet.ibm.com>
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 <fengguang.wu@intel.com>
Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
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.
next prev parent reply other threads:[~2017-04-23 16:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-23 5:31 [rcu:rcu/next 59/91] tree.c:(.text+0x4248): multiple definition of `srcu_online_cpu' kbuild test robot
2017-04-23 16:22 ` Paul E. McKenney [this message]
2017-04-24 8:10 ` [tip:core/rcu] srcu: Fix Kconfig botch when SRCU not selected tip-bot for Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170423162205.GP3956@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=fengguang.wu@intel.com \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.