LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] mm: setup_usemap() must be __meminit
@ 2008-02-17 12:20 Geert Uytterhoeven
  2008-02-17 12:31 ` Geert Uytterhoeven
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2008-02-17 12:20 UTC (permalink / raw)
  To: Mel Gorman, Andrew Morton; +Cc: Linux Kernel Development

On m68k (CONFIG_SPARSEMEM is not set), I get:

    WARNING: vmlinux.o(.meminit.text+0x36c): Section mismatch in reference from the function free_area_init_core() to the function .init.text:setup_usemap()
    The function __meminit free_area_init_core() references
    a function __init setup_usemap().
    If free_area_init_core is only used by setup_usemap then
    annotate free_area_init_core with a matching annotation.

If CONFIG_SPARSEMEM is set, the problem is  not noticed because setup_usemap()
is always inlined.

Properly annotating setup_usemap() and usemap_size() fixes it.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 mm/page_alloc.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3241,7 +3241,7 @@ static void __meminit calculate_node_tot
  * round what is now in bits to nearest long in bits, then return it in
  * bytes.
  */
-static unsigned long __init usemap_size(unsigned long zonesize)
+static unsigned long __meminit usemap_size(unsigned long zonesize)
 {
 	unsigned long usemapsize;
 
@@ -3253,8 +3253,8 @@ static unsigned long __init usemap_size(
 	return usemapsize / 8;
 }
 
-static void __init setup_usemap(struct pglist_data *pgdat,
-				struct zone *zone, unsigned long zonesize)
+static void __meminit setup_usemap(struct pglist_data *pgdat,
+				   struct zone *zone, unsigned long zonesize)
 {
 	unsigned long usemapsize = usemap_size(zonesize);
 	zone->pageblock_flags = NULL;
@@ -3264,8 +3264,9 @@ static void __init setup_usemap(struct p
 	}
 }
 #else
-static void inline setup_usemap(struct pglist_data *pgdat,
-				struct zone *zone, unsigned long zonesize) {}
+static inline void __meminit setup_usemap(struct pglist_data *pgdat,
+					  struct zone *zone,
+					  unsigned long zonesize) {}
 #endif /* CONFIG_SPARSEMEM */
 
 #ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* Re: [PATCH] mm: setup_usemap() must be __meminit
  2008-02-17 12:20 [PATCH] mm: setup_usemap() must be __meminit Geert Uytterhoeven
@ 2008-02-17 12:31 ` Geert Uytterhoeven
  2008-02-17 19:43   ` Sam Ravnborg
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2008-02-17 12:31 UTC (permalink / raw)
  To: Mel Gorman, Andrew Morton; +Cc: Linux Kernel Development

On Sun, 17 Feb 2008, Geert Uytterhoeven wrote:
> On m68k (CONFIG_SPARSEMEM is not set), I get:
> 
>     WARNING: vmlinux.o(.meminit.text+0x36c): Section mismatch in reference from the function free_area_init_core() to the function .init.text:setup_usemap()
>     The function __meminit free_area_init_core() references
>     a function __init setup_usemap().
>     If free_area_init_core is only used by setup_usemap then
>     annotate free_area_init_core with a matching annotation.
> 
> If CONFIG_SPARSEMEM is set, the problem is  not noticed because setup_usemap()
> is always inlined.
> 
> Properly annotating setup_usemap() and usemap_size() fixes it.

Woops, hit the send button too soon.

setup_usemap() calls alloc_bootmem_node(), causing a whole new
avalanche of warnings to be fixed up :-(

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* Re: [PATCH] mm: setup_usemap() must be __meminit
  2008-02-17 12:31 ` Geert Uytterhoeven
@ 2008-02-17 19:43   ` Sam Ravnborg
  2008-02-17 20:38     ` Geert Uytterhoeven
  0 siblings, 1 reply; 6+ messages in thread
From: Sam Ravnborg @ 2008-02-17 19:43 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Mel Gorman, Andrew Morton, Linux Kernel Development

On Sun, Feb 17, 2008 at 01:31:14PM +0100, Geert Uytterhoeven wrote:
> On Sun, 17 Feb 2008, Geert Uytterhoeven wrote:
> > On m68k (CONFIG_SPARSEMEM is not set), I get:
> > 
> >     WARNING: vmlinux.o(.meminit.text+0x36c): Section mismatch in reference from the function free_area_init_core() to the function .init.text:setup_usemap()
> >     The function __meminit free_area_init_core() references
> >     a function __init setup_usemap().
> >     If free_area_init_core is only used by setup_usemap then
> >     annotate free_area_init_core with a matching annotation.
> > 
> > If CONFIG_SPARSEMEM is set, the problem is  not noticed because setup_usemap()
> > is always inlined.
> > 
> > Properly annotating setup_usemap() and usemap_size() fixes it.
> 
> Woops, hit the send button too soon.
> 
> setup_usemap() calls alloc_bootmem_node(), causing a whole new
> avalanche of warnings to be fixed up :-(

Something you like me to help with?
I would need a config where the mismatch triggers for one
of the more popular architectures (as in where I have a toolchain).

I could not reproduce it with x86 64bit - not even with -fno-inline-functions

	Sam

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

* Re: [PATCH] mm: setup_usemap() must be __meminit
  2008-02-17 19:43   ` Sam Ravnborg
@ 2008-02-17 20:38     ` Geert Uytterhoeven
  2008-02-17 22:36       ` Sam Ravnborg
  2008-02-18 20:58       ` Sam Ravnborg
  0 siblings, 2 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2008-02-17 20:38 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Mel Gorman, Andrew Morton, Linux Kernel Development

On Sun, 17 Feb 2008, Sam Ravnborg wrote:
> On Sun, Feb 17, 2008 at 01:31:14PM +0100, Geert Uytterhoeven wrote:
> > On Sun, 17 Feb 2008, Geert Uytterhoeven wrote:
> > > On m68k (CONFIG_SPARSEMEM is not set), I get:
> > > 
> > >     WARNING: vmlinux.o(.meminit.text+0x36c): Section mismatch in reference from the function free_area_init_core() to the function .init.text:setup_usemap()
> > >     The function __meminit free_area_init_core() references
> > >     a function __init setup_usemap().
> > >     If free_area_init_core is only used by setup_usemap then
> > >     annotate free_area_init_core with a matching annotation.
> > > 
> > > If CONFIG_SPARSEMEM is set, the problem is  not noticed because setup_usemap()
> > > is always inlined.
> > > 
> > > Properly annotating setup_usemap() and usemap_size() fixes it.
> > 
> > Woops, hit the send button too soon.
> > 
> > setup_usemap() calls alloc_bootmem_node(), causing a whole new
> > avalanche of warnings to be fixed up :-(
> 
> Something you like me to help with?

Yes, that would be nice.

> I would need a config where the mismatch triggers for one
> of the more popular architectures (as in where I have a toolchain).

That was with plain m68k defconfig.

> I could not reproduce it with x86 64bit - not even with -fno-inline-functions

If it helps, my cross-compiler is gcc version 4.1.2 20061115 (prerelease)
(Debian 4.1.1-21).

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

* Re: [PATCH] mm: setup_usemap() must be __meminit
  2008-02-17 20:38     ` Geert Uytterhoeven
@ 2008-02-17 22:36       ` Sam Ravnborg
  2008-02-18 20:58       ` Sam Ravnborg
  1 sibling, 0 replies; 6+ messages in thread
From: Sam Ravnborg @ 2008-02-17 22:36 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Mel Gorman, Andrew Morton, Linux Kernel Development

> 
> > I would need a config where the mismatch triggers for one
> > of the more popular architectures (as in where I have a toolchain).
> 
> That was with plain m68k defconfig.
> 
> > I could not reproduce it with x86 64bit - not even with -fno-inline-functions
> 
> If it helps, my cross-compiler is gcc version 4.1.2 20061115 (prerelease)
> (Debian 4.1.1-21).

I could build a m68k toolchin using crosstool.
I will take a look one of the next days - too late now.

	Sam

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

* Re: [PATCH] mm: setup_usemap() must be __meminit
  2008-02-17 20:38     ` Geert Uytterhoeven
  2008-02-17 22:36       ` Sam Ravnborg
@ 2008-02-18 20:58       ` Sam Ravnborg
  1 sibling, 0 replies; 6+ messages in thread
From: Sam Ravnborg @ 2008-02-18 20:58 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Mel Gorman, Andrew Morton, Linux Kernel Development

On Sun, Feb 17, 2008 at 09:38:55PM +0100, Geert Uytterhoeven wrote:
> On Sun, 17 Feb 2008, Sam Ravnborg wrote:
> > On Sun, Feb 17, 2008 at 01:31:14PM +0100, Geert Uytterhoeven wrote:
> > > On Sun, 17 Feb 2008, Geert Uytterhoeven wrote:
> > > > On m68k (CONFIG_SPARSEMEM is not set), I get:
> > > > 
> > > >     WARNING: vmlinux.o(.meminit.text+0x36c): Section mismatch in reference from the function free_area_init_core() to the function .init.text:setup_usemap()
> > > >     The function __meminit free_area_init_core() references
> > > >     a function __init setup_usemap().
> > > >     If free_area_init_core is only used by setup_usemap then
> > > >     annotate free_area_init_core with a matching annotation.
> > > > 
> > > > If CONFIG_SPARSEMEM is set, the problem is  not noticed because setup_usemap()
> > > > is always inlined.
> > > > 
> > > > Properly annotating setup_usemap() and usemap_size() fixes it.
> > > 
> > > Woops, hit the send button too soon.
> > > 
> > > setup_usemap() calls alloc_bootmem_node(), causing a whole new
> > > avalanche of warnings to be fixed up :-(
> > 
> > Something you like me to help with?
> 
> Yes, that would be nice.

I tried the patch posted by Alexander previously.
After reviewing it for some time I convinced myself the
patch is correct (has stayed in my to-be-looked-at queue for a while).

See:
http://lkml.org/lkml/2008/2/3/129

I will ask Andrew to take it.

	Sam

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

end of thread, other threads:[~2008-02-18 20:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-17 12:20 [PATCH] mm: setup_usemap() must be __meminit Geert Uytterhoeven
2008-02-17 12:31 ` Geert Uytterhoeven
2008-02-17 19:43   ` Sam Ravnborg
2008-02-17 20:38     ` Geert Uytterhoeven
2008-02-17 22:36       ` Sam Ravnborg
2008-02-18 20:58       ` Sam Ravnborg

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).