Re: [PATCH 5/6] mm, memory_hotplug: do not associate hotadded memory to zones until online

From: Michal Hocko
Date: Tue Apr 04 2017 - 08:45:21 EST


On Tue 04-04-17 14:21:19, Tobias Regnery wrote:
[...]
> Hi Michal,

Hi

> building an x86 allmodconfig with next-20170404 results in the following
> section mismatch warnings probably caused by this patch:
>
> 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.

Right. __add_pages which used to call memmap_init_zone before
is __ref (to hide it the checker) which is not the case for
move_pfn_range_to_zone. I cannot say I would see the point of separating
all meminit functions because they are not going away but using __ref
for move_pfn_range_to_zone should be as safe as __add_pages is.

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

and this is the same thing. Thanks a lot. The following patch should fix
it. I will keep it separate to have a reference why this has been
done...
---