linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [rcu:rcu/next 59/91] tree.c:(.text+0x4248): multiple definition of `srcu_online_cpu'
@ 2017-04-23  5:31 kbuild test robot
  2017-04-23 16:22 ` Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2017-04-23  5:31 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: kbuild-all, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]

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

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 4284 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [rcu:rcu/next 59/91] tree.c:(.text+0x4248): multiple definition of `srcu_online_cpu'
  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
  2017-04-24  8:10   ` [tip:core/rcu] srcu: Fix Kconfig botch when SRCU not selected tip-bot for Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2017-04-23 16:22 UTC (permalink / raw)
  To: kbuild test robot; +Cc: kbuild-all, linux-kernel, mingo

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.
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [tip:core/rcu] srcu: Fix Kconfig botch when SRCU not selected
  2017-04-23 16:22 ` Paul E. McKenney
@ 2017-04-24  8:10   ` tip-bot for Paul E. McKenney
  0 siblings, 0 replies; 3+ messages in thread
From: tip-bot for Paul E. McKenney @ 2017-04-24  8:10 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: fengguang.wu, tglx, linux-kernel, hpa, paulmck, mingo

Commit-ID:  677df9d4615a2db6774cd0e8951bf7404b858b3b
Gitweb:     http://git.kernel.org/tip/677df9d4615a2db6774cd0e8951bf7404b858b3b
Author:     Paul E. McKenney <paulmck@linux.vnet.ibm.com>
AuthorDate: Sun, 23 Apr 2017 09:22:05 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
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 <fengguang.wu@intel.com>
Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20170423162205.GP3956@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 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.
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-24  8:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2017-04-24  8:10   ` [tip:core/rcu] srcu: Fix Kconfig botch when SRCU not selected tip-bot for Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).