* sh migor_defconfig build breakage
@ 2008-05-08 20:39 Adrian Bunk
2008-05-08 21:19 ` Mike Travis
0 siblings, 1 reply; 9+ messages in thread
From: Adrian Bunk @ 2008-05-08 20:39 UTC (permalink / raw)
To: Mike Travis, Ingo Molnar, lethal; +Cc: linux-sh, linux-kernel
Commit aa6b54461cc5c0019b9d792adf3176b444c10763
(asm-generic: add node_to_cpumask_ptr macro)
causes the following build error with migor_defconfig:
<-- snip -->
...
CC arch/sh/kernel/asm-offsets.s
In file included from /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/mm.h:8,
from /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/kernel/asm-offsets.c:13:
/home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/gfp.h: In function 'alloc_pages_node':
/home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/gfp.h:190:
error: implicit declaration of function 'cpu_to_node'
make[2]: *** [arch/sh/kernel/asm-offsets.s] Error 1
<-- snip -->
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: sh migor_defconfig build breakage 2008-05-08 20:39 sh migor_defconfig build breakage Adrian Bunk @ 2008-05-08 21:19 ` Mike Travis 2008-05-08 21:31 ` Mike Travis 0 siblings, 1 reply; 9+ messages in thread From: Mike Travis @ 2008-05-08 21:19 UTC (permalink / raw) To: Adrian Bunk; +Cc: Ingo Molnar, lethal, linux-sh, linux-kernel Adrian Bunk wrote: > Commit aa6b54461cc5c0019b9d792adf3176b444c10763 > (asm-generic: add node_to_cpumask_ptr macro) > causes the following build error with migor_defconfig: > > <-- snip --> > > ... > CC arch/sh/kernel/asm-offsets.s > In file included from /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/mm.h:8, > from /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/kernel/asm-offsets.c:13: > /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/gfp.h: In function 'alloc_pages_node': > /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/gfp.h:190: > error: implicit declaration of function 'cpu_to_node' > make[2]: *** [arch/sh/kernel/asm-offsets.s] Error 1 > > <-- snip --> > > cu > Adrian > Hi Adrian, Thanks for the feedback, I'll cross-compile test this config. Mike ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sh migor_defconfig build breakage 2008-05-08 21:19 ` Mike Travis @ 2008-05-08 21:31 ` Mike Travis 2008-05-08 21:42 ` Adrian Bunk 2008-05-08 21:55 ` Mike Travis 0 siblings, 2 replies; 9+ messages in thread From: Mike Travis @ 2008-05-08 21:31 UTC (permalink / raw) To: Adrian Bunk; +Cc: Ingo Molnar, lethal, linux-sh, linux-kernel Mike Travis wrote: > Adrian Bunk wrote: >> Commit aa6b54461cc5c0019b9d792adf3176b444c10763 >> (asm-generic: add node_to_cpumask_ptr macro) >> causes the following build error with migor_defconfig: >> >> <-- snip --> >> >> ... >> CC arch/sh/kernel/asm-offsets.s >> In file included from /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/mm.h:8, >> from /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/kernel/asm-offsets.c:13: >> /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/gfp.h: In function 'alloc_pages_node': >> /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/gfp.h:190: >> error: implicit declaration of function 'cpu_to_node' >> make[2]: *** [arch/sh/kernel/asm-offsets.s] Error 1 >> >> <-- snip --> >> >> cu >> Adrian >> > > Hi Adrian, > > Thanks for the feedback, I'll cross-compile test this config. > > Mike Ouch. I just discovered I don't have a cross-compiler for 'sh'. Can you point me towards one? Thanks, Mike ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sh migor_defconfig build breakage 2008-05-08 21:31 ` Mike Travis @ 2008-05-08 21:42 ` Adrian Bunk 2008-05-08 21:55 ` Mike Travis 1 sibling, 0 replies; 9+ messages in thread From: Adrian Bunk @ 2008-05-08 21:42 UTC (permalink / raw) To: Mike Travis; +Cc: Ingo Molnar, lethal, linux-sh, linux-kernel On Thu, May 08, 2008 at 02:31:09PM -0700, Mike Travis wrote: > Mike Travis wrote: > > Adrian Bunk wrote: > >> Commit aa6b54461cc5c0019b9d792adf3176b444c10763 > >> (asm-generic: add node_to_cpumask_ptr macro) > >> causes the following build error with migor_defconfig: > >> > >> <-- snip --> > >> > >> ... > >> CC arch/sh/kernel/asm-offsets.s > >> In file included from /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/mm.h:8, > >> from /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/kernel/asm-offsets.c:13: > >> /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/gfp.h: In function 'alloc_pages_node': > >> /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/gfp.h:190: > >> error: implicit declaration of function 'cpu_to_node' > >> make[2]: *** [arch/sh/kernel/asm-offsets.s] Error 1 > >> > >> <-- snip --> > >> > >> cu > >> Adrian > >> > > > > Hi Adrian, > > > > Thanks for the feedback, I'll cross-compile test this config. > > > > Mike > > > Ouch. I just discovered I don't have a cross-compiler for 'sh'. Can you point me > towards one? Mine are self-built. The LinuxSH project offers binary ones at http://www.linux-sh.org > Thanks, > Mike cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sh migor_defconfig build breakage 2008-05-08 21:31 ` Mike Travis 2008-05-08 21:42 ` Adrian Bunk @ 2008-05-08 21:55 ` Mike Travis 2008-05-08 22:12 ` Mike Travis 1 sibling, 1 reply; 9+ messages in thread From: Mike Travis @ 2008-05-08 21:55 UTC (permalink / raw) To: Adrian Bunk; +Cc: Ingo Molnar, lethal, linux-sh, linux-kernel Mike Travis wrote: > Mike Travis wrote: >> Adrian Bunk wrote: >>> Commit aa6b54461cc5c0019b9d792adf3176b444c10763 >>> (asm-generic: add node_to_cpumask_ptr macro) >>> causes the following build error with migor_defconfig: >>> >>> <-- snip --> >>> >>> ... >>> CC arch/sh/kernel/asm-offsets.s >>> In file included from /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/mm.h:8, >>> from /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/kernel/asm-offsets.c:13: >>> /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/gfp.h: In function 'alloc_pages_node': >>> /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/gfp.h:190: >>> error: implicit declaration of function 'cpu_to_node' >>> make[2]: *** [arch/sh/kernel/asm-offsets.s] Error 1 >>> >>> <-- snip --> >>> >>> cu >>> Adrian ... > Ouch. I just discovered I don't have a cross-compiler for 'sh'. Can you point me > towards one? ... It looks like the migor_config has NUMA=y so is there not a cpu_to_node function? (looking with cscope didn't find it.) I believe this may be the source of the error: include/linux/gfp.h: static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, unsigned int order) { ... /* Unknown node is current node */ if (nid < 0) nid = numa_node_id(); include/linux/mmzone.h: #include <linux/topology.h> /* Returns the number of the current Node. */ #ifndef numa_node_id #define numa_node_id() (cpu_to_node(raw_smp_processor_id())) #endif I can't put into include/linux/topology.h the catchall default: #ifndef cpu_to_node #define cpu_to_node(cpu) (0) #endif Because some arch's have it defined as an inline function. Perhaps the easiest would be to add to include/asm-sh/topology.h a simple define of cpu_to_node()? Thanks, Mike ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sh migor_defconfig build breakage 2008-05-08 21:55 ` Mike Travis @ 2008-05-08 22:12 ` Mike Travis 2008-05-09 0:50 ` Paul Mundt 0 siblings, 1 reply; 9+ messages in thread From: Mike Travis @ 2008-05-08 22:12 UTC (permalink / raw) To: Adrian Bunk; +Cc: Ingo Molnar, lethal, linux-sh, linux-kernel, Andrew Morton Mike Travis wrote: > Mike Travis wrote: >> Mike Travis wrote: >>> Adrian Bunk wrote: >>>> Commit aa6b54461cc5c0019b9d792adf3176b444c10763 >>>> (asm-generic: add node_to_cpumask_ptr macro) >>>> causes the following build error with migor_defconfig: >>>> >>>> <-- snip --> >>>> >>>> ... >>>> CC arch/sh/kernel/asm-offsets.s >>>> In file included from /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/mm.h:8, >>>> from /home/bunk/linux/kernel-2.6/git/linux-2.6/arch/sh/kernel/asm-offsets.c:13: >>>> /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/gfp.h: In function 'alloc_pages_node': >>>> /home/bunk/linux/kernel-2.6/git/linux-2.6/include/linux/gfp.h:190: >>>> error: implicit declaration of function 'cpu_to_node' >>>> make[2]: *** [arch/sh/kernel/asm-offsets.s] Error 1 >>>> >>>> <-- snip --> >>>> >>>> cu >>>> Adrian ... > > It looks like the migor_config has NUMA=y so is there not a cpu_to_node function? > (looking with cscope didn't find it.) > > I believe this may be the source of the error: > > include/linux/gfp.h: > > static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, > unsigned int order) > { > ... > /* Unknown node is current node */ > if (nid < 0) > nid = numa_node_id(); > > > include/linux/mmzone.h: > > #include <linux/topology.h> > /* Returns the number of the current Node. */ > #ifndef numa_node_id > #define numa_node_id() (cpu_to_node(raw_smp_processor_id())) > #endif > > > I can't put into include/linux/topology.h the catchall default: > > #ifndef cpu_to_node > #define cpu_to_node(cpu) (0) > #endif > > Because some arch's have it defined as an inline function. Perhaps the > easiest would be to add to include/asm-sh/topology.h a simple define of > cpu_to_node()? > > Thanks, > Mike Ahh, this is what caused the error. In include/asm-generic/topology.h cpu_to_node is only defined now if NUMA is turned off. #ifndef CONFIG_NUMA /* Other architectures wishing to use this simple topology API should fill in the below functions as appropriate in their own <asm/topology.h> file. */ #ifndef cpu_to_node #define cpu_to_node(cpu) ((void)(cpu),0) #endif ... So before my change arch 'sh' used the default define whether NUMA was set or not. An alternative would be to change all the arch's that define cpu_to_node as an inline to: #define cpu_to_node(cpu) _cpu_to_node(cpu) static inline int _cpu_to_node(int cpu) { ... } Then include/linux/topology could define cpu_to_node if it's not already defined. Andrew or Ingo - do you have any preferences? Thanks, Mike ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sh migor_defconfig build breakage 2008-05-08 22:12 ` Mike Travis @ 2008-05-09 0:50 ` Paul Mundt 2008-05-09 1:21 ` Mike Travis 0 siblings, 1 reply; 9+ messages in thread From: Paul Mundt @ 2008-05-09 0:50 UTC (permalink / raw) To: Mike Travis Cc: Adrian Bunk, Ingo Molnar, linux-sh, linux-kernel, Andrew Morton On Thu, May 08, 2008 at 03:12:46PM -0700, Mike Travis wrote: > Mike Travis wrote: > > Because some arch's have it defined as an inline function. Perhaps the > > easiest would be to add to include/asm-sh/topology.h a simple define of > > cpu_to_node()? > > Ahh, this is what caused the error. In include/asm-generic/topology.h > cpu_to_node is only defined now if NUMA is turned off. > > #ifndef CONFIG_NUMA > > /* Other architectures wishing to use this simple topology API should fill > in the below functions as appropriate in their own <asm/topology.h> file. */ > #ifndef cpu_to_node > #define cpu_to_node(cpu) ((void)(cpu),0) > #endif > ... > > So before my change arch 'sh' used the default define whether NUMA was > set or not. > The dependency here is a bit vague in the first place. For UP NUMA the asm-generic definitions are perfectly fine, it's only the CONFIG_NUMA && CONFIG_SMP cases where there is any point in doing anything more fine-grained. So while it would be trivial to add a CONFIG_SMP test here too, that's likely to break all of the other NUMA platforms. So while sh can use the asm-generic definitions in the UP case, it obviously can't on SMP. The easiest option for now is to just stub the asm-generic bits in to asm-sh/topology.h under a CONFIG_NUMA ifdef and then add more reasonable definitions for the SMP cases. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sh migor_defconfig build breakage 2008-05-09 0:50 ` Paul Mundt @ 2008-05-09 1:21 ` Mike Travis 2008-05-09 1:52 ` Paul Mundt 0 siblings, 1 reply; 9+ messages in thread From: Mike Travis @ 2008-05-09 1:21 UTC (permalink / raw) To: Paul Mundt, Mike Travis, Adrian Bunk, Ingo Molnar, linux-sh, linux-kernel, Andrew Morton Paul Mundt wrote: > On Thu, May 08, 2008 at 03:12:46PM -0700, Mike Travis wrote: >> Mike Travis wrote: >>> Because some arch's have it defined as an inline function. Perhaps the >>> easiest would be to add to include/asm-sh/topology.h a simple define of >>> cpu_to_node()? >> Ahh, this is what caused the error. In include/asm-generic/topology.h >> cpu_to_node is only defined now if NUMA is turned off. >> >> #ifndef CONFIG_NUMA >> >> /* Other architectures wishing to use this simple topology API should fill >> in the below functions as appropriate in their own <asm/topology.h> file. */ >> #ifndef cpu_to_node >> #define cpu_to_node(cpu) ((void)(cpu),0) >> #endif >> ... >> >> So before my change arch 'sh' used the default define whether NUMA was >> set or not. >> > The dependency here is a bit vague in the first place. For UP NUMA the > asm-generic definitions are perfectly fine, it's only the CONFIG_NUMA && > CONFIG_SMP cases where there is any point in doing anything more > fine-grained. So while it would be trivial to add a CONFIG_SMP test here > too, that's likely to break all of the other NUMA platforms. > > So while sh can use the asm-generic definitions in the UP case, it > obviously can't on SMP. The easiest option for now is to just stub the > asm-generic bits in to asm-sh/topology.h under a CONFIG_NUMA ifdef and > then add more reasonable definitions for the SMP cases. The "suggested" patch I submitted sort of covered all the cases of CONFIG_NUMA=y without regards to CONFIG_SMP. It seems you're suggesting that I only change the asm-sh/topology.h file and leave the remaining arch's for "error discovery" later? Thanks, Mike ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: sh migor_defconfig build breakage 2008-05-09 1:21 ` Mike Travis @ 2008-05-09 1:52 ` Paul Mundt 0 siblings, 0 replies; 9+ messages in thread From: Paul Mundt @ 2008-05-09 1:52 UTC (permalink / raw) To: Mike Travis Cc: Adrian Bunk, Ingo Molnar, linux-sh, linux-kernel, Andrew Morton, ralf On Thu, May 08, 2008 at 06:21:17PM -0700, Mike Travis wrote: > Paul Mundt wrote: > > On Thu, May 08, 2008 at 03:12:46PM -0700, Mike Travis wrote: > >> Mike Travis wrote: > >>> Because some arch's have it defined as an inline function. Perhaps the > >>> easiest would be to add to include/asm-sh/topology.h a simple define of > >>> cpu_to_node()? > >> Ahh, this is what caused the error. In include/asm-generic/topology.h > >> cpu_to_node is only defined now if NUMA is turned off. > >> > >> #ifndef CONFIG_NUMA > >> > >> /* Other architectures wishing to use this simple topology API should fill > >> in the below functions as appropriate in their own <asm/topology.h> file. */ > >> #ifndef cpu_to_node > >> #define cpu_to_node(cpu) ((void)(cpu),0) > >> #endif > >> ... > >> > >> So before my change arch 'sh' used the default define whether NUMA was > >> set or not. > >> > > The dependency here is a bit vague in the first place. For UP NUMA the > > asm-generic definitions are perfectly fine, it's only the CONFIG_NUMA && > > CONFIG_SMP cases where there is any point in doing anything more > > fine-grained. So while it would be trivial to add a CONFIG_SMP test here > > too, that's likely to break all of the other NUMA platforms. > > > > So while sh can use the asm-generic definitions in the UP case, it > > obviously can't on SMP. The easiest option for now is to just stub the > > asm-generic bits in to asm-sh/topology.h under a CONFIG_NUMA ifdef and > > then add more reasonable definitions for the SMP cases. > > The "suggested" patch I submitted sort of covered all the cases of CONFIG_NUMA=y > without regards to CONFIG_SMP. It seems you're suggesting that I only change > the asm-sh/topology.h file and leave the remaining arch's for "error discovery" > later? > If you want to solve it that way, it's fine as well. My point is simply that the asm-generic/topology.h definitions are effectively only sane on the UP case in the first place. Out of the platforms that do CONFIG_NUMA, both sh and mips are currently broken due to the cpu_to_node() bits. sh tends to be the odd one out in doing both UP and SMP NUMA, so I don't mind doing this in asm-sh/topology.h either. mips is almost certainly broken, but the generic cpu_to_node() isn't going to be sufficient there anyways, so "error discovery" there will at least wake up anyone interested in the broken platform. ip27 seems to be the only effected platform there, though it's not obvious if NUMA depends on SMP or not in that case. ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-05-09 1:52 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-05-08 20:39 sh migor_defconfig build breakage Adrian Bunk 2008-05-08 21:19 ` Mike Travis 2008-05-08 21:31 ` Mike Travis 2008-05-08 21:42 ` Adrian Bunk 2008-05-08 21:55 ` Mike Travis 2008-05-08 22:12 ` Mike Travis 2008-05-09 0:50 ` Paul Mundt 2008-05-09 1:21 ` Mike Travis 2008-05-09 1:52 ` Paul Mundt
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).