Skip to contentSkip to conversation

mm: fix setup_zone_pageset section mismatch

PATCH In review Randy Dunlap 2 participants 5 messages Mar 24, 2011 – Mar 31, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: fix setup_zone_pageset section mismatch

From: Randy Dunlap <[email protected]>

Fix section mismatch warning:
setup_zone_pageset() is called from build_all_zonelists(), which can be called at any time by NUMA sysctl handler numa_zonelist_order_handler(),
so it should not be marked as __meminit.

WARNING: mm/built-in.o(.text+0xab17): Section mismatch in reference from the function build_all_zonelists() to the function .meminit.text:setup_zone_pageset() The function build_all_zonelists() references
the function __meminit setup_zone_pageset().
This is often because build_all_zonelists lacks a __meminit
annotation or the annotation of setup_zone_pageset is wrong.

---
 mm/page_alloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +1 -1
@@ -3511,7 +3511,7 @@ static void setup_pagelist_highmark(stru
 		pcp->batch = PAGE_SHIFT * 8;
 }
 
-static __meminit void setup_zone_pageset(struct zone *zone)
+static void setup_zone_pageset(struct zone *zone)
 {
 	int cpu;
 

---

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

maintainer
#1 lore raw
Quoted 22 lines · On Thu, 24 Mar 2011 13:24:35 -0700 Randy Dunlap <[email protected]> wrote:

From: Randy Dunlap <[email protected]>

Fix section mismatch warning:
setup_zone_pageset() is called from build_all_zonelists(), which can be called at any time by NUMA sysctl handler numa_zonelist_order_handler(),
so it should not be marked as __meminit.

WARNING: mm/built-in.o(.text+0xab17): Section mismatch in reference from the function build_all_zonelists() to the function .meminit.text:setup_zone_pageset() The function build_all_zonelists() references
the function __meminit setup_zone_pageset().
This is often because build_all_zonelists lacks a __meminit
annotation or the annotation of setup_zone_pageset is wrong.

---
 mm/page_alloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

mm/page_alloc.c static void setup_pagelist_highmark(stru · line 3517

Quoted 8 lines
mm/page_alloc.c +1 -1
@@ -3511,7 +3511,7 @@ static void setup_pagelist_highmark(stru
 		pcp->batch = PAGE_SHIFT * 8;
 }
 
-static __meminit void setup_zone_pageset(struct zone *zone)
+static void setup_zone_pageset(struct zone *zone)
 {
 	int cpu;
 

I already merged Paul Mundt's patch whcih marks build_all_zonelists() as __ref. That seems a better solution?

I'm rather wondering if we did all this the right way anyway. The call from build_all_zonelists() into setup_zone_pageset() is inside #ifdef CONFIG_MEMORY_HOTPLUG, so there is clearly no bug here. But the build system generated a warning anyway. Why'd it do that?

If we'd handled the section via

#ifdef CONFIG_MEMORY_HOTPLUG
#define __meminit
#else
#define __meminit __init
#endif

of similar then that would fix things. iirc we used to do it that way...

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
Quoted 28 lines · Andrew Morton
Quoted 25 lines · On Thu, 24 Mar 2011 13:24:35 -0700 Randy Dunlap <[email protected]> wrote:

From: Randy Dunlap <[email protected]>

Fix section mismatch warning:
setup_zone_pageset() is called from build_all_zonelists(), which can be called at any time by NUMA sysctl handler numa_zonelist_order_handler(),
so it should not be marked as __meminit.

WARNING: mm/built-in.o(.text+0xab17): Section mismatch in reference from the function build_all_zonelists() to the function .meminit.text:setup_zone_pageset() The function build_all_zonelists() references
the function __meminit setup_zone_pageset().
This is often because build_all_zonelists lacks a __meminit
annotation or the annotation of setup_zone_pageset is wrong.

---
 mm/page_alloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/page_alloc.c +0 -0
@@ -3511,7 +3511,7 @@ static void setup_pagelist_highmark(stru
 		pcp->batch = PAGE_SHIFT * 8;
 }
 
Quoted 8 lines

mm/page_alloc.c static void setup_pagelist_highmark(stru · line 3517

Quoted 5 lines
mm/page_alloc.c +1 -1
-static __meminit void setup_zone_pageset(struct zone *zone)
+static void setup_zone_pageset(struct zone *zone)
 {
 	int cpu;
 

I already merged Paul Mundt's patch whcih marks build_all_zonelists() as __ref. That seems a better solution?

Merged where? mmotm?

2.6.39-rc1 still has this section mismatch warning. If Paul's patch fixes the warning, I'm OK with it.

Quoted 4 lines

I'm rather wondering if we did all this the right way anyway. The call from build_all_zonelists() into setup_zone_pageset() is inside #ifdef CONFIG_MEMORY_HOTPLUG, so there is clearly no bug here. But the build system generated a warning anyway. Why'd it do that?

It's a mystery.

Quoted 10 lines

If we'd handled the section via

#ifdef CONFIG_MEMORY_HOTPLUG
#define __meminit
#else
#define __meminit __init
#endif

of similar then that would fix things. iirc we used to do it that way...

Yes, that older way made more sense to me.

Signature · 9 lines
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
maintainer
#3 lore raw
Quoted 7 lines · On Wed, 30 Mar 2011 15:47:30 -0700 Randy Dunlap <[email protected]> wrote:

...

Quoted 3 lines

I already merged Paul Mundt's patch whcih marks build_all_zonelists() as __ref. That seems a better solution?

Merged where? mmotm?

mm.

mm/page_alloc.c renamed from mm/page_alloc.c~mm-page_allocc-silence-build_all_zonelists-section-mismatch +1 -1
@@ -3170,7 +3170,7 @@ static __init_refok int __build_all_zone
  * Called with zonelists_mutex held always
  * unless system_state == SYSTEM_BOOTING.
  */
-void build_all_zonelists(void *data)
+void __ref build_all_zonelists(void *data)
 {
 	set_zonelist_order();
 

_

Quoted 11 lines

...

Quoted 8 lines

If we'd handled the section via

#ifdef CONFIG_MEMORY_HOTPLUG
#define __meminit
#else
#define __meminit __init
#endif

Quoted 4 lines
Quoted 2 lines

of similar then that would fix things. iirc we used to do it that way...

Yes, that older way made more sense to me.

I guess it was too simple.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

author Acked-by
#4 lore raw
Quoted 24 lines · Andrew Morton
Quoted 7 lines · On Wed, 30 Mar 2011 15:47:30 -0700 Randy Dunlap <[email protected]> wrote:

...

Quoted 3 lines

I already merged Paul Mundt's patch whcih marks build_all_zonelists() as __ref. That seems a better solution?

Merged where? mmotm?

mm.

mm/page_alloc.c renamed from mm/page_alloc.c~mm-page_allocc-silence-build_all_zonelists-section-mismatch +1 -1
@@ -3170,7 +3170,7 @@ static __init_refok int __build_all_zone
  * Called with zonelists_mutex held always
  * unless system_state == SYSTEM_BOOTING.
  */
-void build_all_zonelists(void *data)
+void __ref build_all_zonelists(void *data)
 {
 	set_zonelist_order();
 
Quoted 1 line

_

Thanks.

Signature · 9 lines
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>