lkml.org 
[lkml]   [2017]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 8/9] mm, memory_hotplug: fix the section mismatch warning
    Date
    From: Michal Hocko <mhocko@suse.com>

    Tobias has reported following section mismatches introduced by "mm,
    memory_hotplug: do not associate hotadded memory to zones until online".

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

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

    WARNING: vmlinux.o(.text+0x188aa2): Section mismatch in reference from the function move_pfn_range_to_zone() to the function .meminit.text:memmap_init_zone()
    The function move_pfn_range_to_zone() references
    the function __meminit memmap_init_zone().
    This is often because move_pfn_range_to_zone lacks a __meminit
    annotation or the annotation of memmap_init_zone is wrong.

    WARNING: vmlinux.o(.text+0x188b3b): Section mismatch in reference from the function move_pfn_range_to_zone() to the function .meminit.text:init_currently_empty_zone()
    The function move_pfn_range_to_zone() references
    the function __meminit init_currently_empty_zone().
    This is often because move_pfn_range_to_zone lacks a __meminit
    annotation or the annotation of init_currently_empty_zone is wrong.

    Both memmap_init_zone and init_currently_empty_zone are marked __meminit
    but move_pfn_range_to_zone is used outside of __meminit sections (e.g.
    devm_memremap_pages) so we have to hide it from the checker by __ref
    annotation.

    Reported-by: Tobias Regnery <tobias.regnery@gmail.com>
    Signed-off-by: Michal Hocko <mhocko@suse.com>
    ---
    mm/memory_hotplug.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
    index 43e84758057b..be8be844d340 100644
    --- a/mm/memory_hotplug.c
    +++ b/mm/memory_hotplug.c
    @@ -1065,7 +1065,7 @@ static void __meminit resize_pgdat_range(struct pglist_data *pgdat, unsigned lon
    pgdat->node_spanned_pages = max(start_pfn + nr_pages, old_end_pfn) - pgdat->node_start_pfn;
    }

    -void move_pfn_range_to_zone(struct zone *zone,
    +void __ref move_pfn_range_to_zone(struct zone *zone,
    unsigned long start_pfn, unsigned long nr_pages)
    {
    struct pglist_data *pgdat = zone->zone_pgdat;
    --
    2.11.0
    \
     
     \ /
      Last update: 2017-04-10 13:05    [W:4.126 / U:0.204 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site