aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@mailshack.com>2008-02-23 18:24:06 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-23 20:13:24 -0500
commitb5a0e011329431b90d315eaf6ca5fdb41df7a117 (patch)
treedc0503d0b6ee2d74cdf4e332524b810ccde5050f /mm
parentbcdca225bfa016100985e5fc7e51cdc1d68beaa6 (diff)
Solve section mismatch for free_area_init_core.
WARNING: vmlinux.o(.meminit.text+0x649): 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. The warning is covers this stack of functions in mm/page_alloc.c: alloc_bootmem_node must be marked __init. alloc_bootmem_node is used by setup_usemap, if !SPARSEMEM. (usemap_size is only used by setup_usemap, if !SPARSEMEM.) setup_usemap is only used by free_area_init_core. free_area_init_core is only used by free_area_init_node. free_area_init_node is used by: arch/alpha/mm/numa.c: __init paging_init() arch/arm/mm/init.c: __init bootmem_init_node() arch/avr32/mm/init.c: __init paging_init() arch/cris/arch-v10/mm/init.c: __init paging_init() arch/cris/arch-v32/mm/init.c: __init paging_init() arch/m32r/mm/discontig.c: __init zone_sizes_init() arch/m32r/mm/init.c: __init zone_sizes_init() arch/m68k/mm/motorola.c: __init paging_init() arch/m68k/mm/sun3mmu.c: __init paging_init() arch/mips/sgi-ip27/ip27-memory.c: __init paging_init() arch/parisc/mm/init.c: __init paging_init() arch/sparc/mm/srmmu.c: __init srmmu_paging_init() arch/sparc/mm/sun4c.c: __init sun4c_paging_init() arch/sparc64/mm/init.c: __init paging_init() mm/page_alloc.c: __init free_area_init_nodes() mm/page_alloc.c: __init free_area_init() and mm/memory_hotplug.c: hotadd_new_pgdat() hotadd_new_pgdat can not be an __init function, but: It is compiled for MEMORY_HOTPLUG configurations only MEMORY_HOTPLUG depends on SPARSEMEM || X86_64_ACPI_NUMA X86_64_ACPI_NUMA depends on X86_64 ARCH_FLATMEM_ENABLE depends on X86_32 ARCH_DISCONTIGMEM_ENABLE depends on X86_32 So X86_64_ACPI_NUMA implies SPARSEMEM, right? So we can mark the stack of functions __init for !SPARSEMEM, but we must mark them __meminit for SPARSEMEM configurations. This is ok, because then the calls to alloc_bootmem_node are also avoided. Compile-tested on: silly minimal config defconfig x86_32 defconfig x86_64 defconfig x86_64 -HIBERNATION +MEMORY_HOTPLUG Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/internal.h13
-rw-r--r--mm/page_alloc.c4
2 files changed, 15 insertions, 2 deletions
diff --git a/mm/internal.h b/mm/internal.h
index 5a9a6200e034..789727309f4d 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -47,4 +47,17 @@ static inline unsigned long page_order(struct page *page)
47 VM_BUG_ON(!PageBuddy(page)); 47 VM_BUG_ON(!PageBuddy(page));
48 return page_private(page); 48 return page_private(page);
49} 49}
50
51/*
52 * FLATMEM and DISCONTIGMEM configurations use alloc_bootmem_node,
53 * so all functions starting at paging_init should be marked __init
54 * in those cases. SPARSEMEM, however, allows for memory hotplug,
55 * and alloc_bootmem_node is not used.
56 */
57#ifdef CONFIG_SPARSEMEM
58#define __paginginit __meminit
59#else
60#define __paginginit __init
61#endif
62
50#endif 63#endif
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 75b979313346..8896e874a67d 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -3314,7 +3314,7 @@ static inline int pageblock_default_order(unsigned int order)
3314 * - mark all memory queues empty 3314 * - mark all memory queues empty
3315 * - clear the memory bitmaps 3315 * - clear the memory bitmaps
3316 */ 3316 */
3317static void __meminit free_area_init_core(struct pglist_data *pgdat, 3317static void __paginginit free_area_init_core(struct pglist_data *pgdat,
3318 unsigned long *zones_size, unsigned long *zholes_size) 3318 unsigned long *zones_size, unsigned long *zholes_size)
3319{ 3319{
3320 enum zone_type j; 3320 enum zone_type j;
@@ -3438,7 +3438,7 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
3438#endif /* CONFIG_FLAT_NODE_MEM_MAP */ 3438#endif /* CONFIG_FLAT_NODE_MEM_MAP */
3439} 3439}
3440 3440
3441void __meminit free_area_init_node(int nid, struct pglist_data *pgdat, 3441void __paginginit free_area_init_node(int nid, struct pglist_data *pgdat,
3442 unsigned long *zones_size, unsigned long node_start_pfn, 3442 unsigned long *zones_size, unsigned long node_start_pfn,
3443 unsigned long *zholes_size) 3443 unsigned long *zholes_size)
3444{ 3444{