From: Mike Travis <travis@sgi.com>
To: Adrian Bunk <bunk@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>,
lethal@linux-sh.org, linux-sh@vger.kernel.org,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: sh migor_defconfig build breakage
Date: Thu, 08 May 2008 22:12:46 +0000 [thread overview]
Message-ID: <48237ADE.3090703@sgi.com> (raw)
In-Reply-To: <482376BC.2000404@sgi.com>
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
WARNING: multiple messages have this Message-ID (diff)
From: Mike Travis <travis@sgi.com>
To: Adrian Bunk <bunk@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>,
lethal@linux-sh.org, linux-sh@vger.kernel.org,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: sh migor_defconfig build breakage
Date: Thu, 08 May 2008 15:12:46 -0700 [thread overview]
Message-ID: <48237ADE.3090703@sgi.com> (raw)
In-Reply-To: <482376BC.2000404@sgi.com>
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
next prev parent reply other threads:[~2008-05-08 22:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-08 20:39 sh migor_defconfig build breakage Adrian Bunk
2008-05-08 20:39 ` Adrian Bunk
2008-05-08 21:19 ` Mike Travis
2008-05-08 21:19 ` Mike Travis
2008-05-08 21:31 ` Mike Travis
2008-05-08 21:31 ` Mike Travis
2008-05-08 21:42 ` Adrian Bunk
2008-05-08 21:42 ` Adrian Bunk
2008-05-08 21:55 ` Mike Travis
2008-05-08 21:55 ` Mike Travis
2008-05-08 22:12 ` Mike Travis [this message]
2008-05-08 22:12 ` Mike Travis
2008-05-09 0:50 ` Paul Mundt
2008-05-09 0:50 ` Paul Mundt
2008-05-09 1:21 ` Mike Travis
2008-05-09 1:21 ` Mike Travis
2008-05-09 1:52 ` Paul Mundt
2008-05-09 1:52 ` Paul Mundt
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=48237ADE.3090703@sgi.com \
--to=travis@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=bunk@kernel.org \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=mingo@elte.hu \
/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.