On 10/03/2017 23:41, Brijesh Singh wrote: >> Maybe there's a reason this fires: >> >> WARNING: modpost: Found 2 section mismatch(es). >> To see full details build your kernel with: >> 'make CONFIG_DEBUG_SECTION_MISMATCH=y' >> >> WARNING: vmlinux.o(.text+0x48edc): Section mismatch in reference from >> the function __change_page_attr() to the function >> .init.text:memblock_alloc() >> The function __change_page_attr() references >> the function __init memblock_alloc(). >> This is often because __change_page_attr lacks a __init >> annotation or the annotation of memblock_alloc is wrong. >> >> WARNING: vmlinux.o(.text+0x491d1): Section mismatch in reference from >> the function __change_page_attr() to the function >> .meminit.text:memblock_free() >> The function __change_page_attr() references >> the function __meminit memblock_free(). >> This is often because __change_page_attr lacks a __meminit >> annotation or the annotation of memblock_free is wrong. >> >> But maybe Paolo might have an even better idea... > > I am sure he will have better idea :) Not sure if it's better or worse, but an alternative idea is to turn __change_page_attr and __change_page_attr_set_clr inside out, so that: 1) the alloc_pages/__free_page happens in __change_page_attr_set_clr; 2) __change_page_attr_set_clr overall does not beocome more complex. Then you can introduce __early_change_page_attr_set_clr and/or early_kernel_map_pages_in_pgd, for use in your next patches. They use the memblock allocator instead of alloc/free_page The attached patch is compile-tested only and almost certainly has some thinko in it. But it even skims a few lines from the code so the idea might have some merit. Paolo