Re: next/master build: 230 builds: 3 failed, 227 passed, 391 warnings (next-20190709)

From: Andrew Morton
Date: Tue Jul 09 2019 - 16:37:40 EST


On Tue, 9 Jul 2019 16:13:33 +0100 Mark Brown <broonie@xxxxxxxxxx> wrote:

> On Tue, Jul 09, 2019 at 07:37:50AM -0700, kernelci.org bot wrote:
>
> Today's -next fails to build tinyconfig on arm64 and x86_64:
>
> > arm64:
> > tinyconfig: (clang-8) FAIL
> > tinyconfig: (gcc-8) FAIL
> >
> > x86_64:
> > tinyconfig: (gcc-8) FAIL
>
> due to:
>
> > tinyconfig (arm64, gcc-8) â FAIL, 0 errors, 0 warnings, 0 section mismatches
> >
> > Section mismatches:
> > WARNING: vmlinux.o(.meminit.text+0x430): Section mismatch in reference from the function sparse_buffer_alloc() to the function .init.text:sparse_buffer_free()
> > FATAL: modpost: Section mismatches detected.
>
> (same error for all of them, the warning appears non-fatally in
> other configs). This is caused by f13d13caa6ef2 (mm/sparse.c:
> fix memory leak of sparsemap_buf in aliged memory) which adds a
> reference from the __meminit annotated sparse_buffer_alloc() to
> the newly added __init annotated sparse_buffer_free().

Thanks. Arnd just fixed this:

From: Arnd Bergmann <arnd@xxxxxxxx>
Subject: mm/sparse.c: mark sparse_buffer_free as __meminit

Calling an __init function from a __meminit function is not allowed:

WARNING: vmlinux.o(.meminit.text+0x30ff): Section mismatch in reference from the function sparse_buffer_alloc() to the function .init.text:sparse_buffer_free()
The function __meminit sparse_buffer_alloc() references
a function __init sparse_buffer_free().
If sparse_buffer_free is only used by sparse_buffer_alloc then
annotate sparse_buffer_free with a matching annotation.

Downgrade the annotation to __meminit for both, as they may be
used in the hotplug case.

Link: http://lkml.kernel.org/r/20190709185528.3251709-1-arnd@xxxxxxxx
Fixes: mmotm ("mm/sparse.c: fix memory leak of sparsemap_buf in aliged memory")
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Cc: Lecopzer Chen <lecopzer.chen@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

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

--- a/mm/sparse.c~mm-sparse-fix-memory-leak-of-sparsemap_buf-in-aliged-memory-fix
+++ a/mm/sparse.c
@@ -428,7 +428,7 @@ struct page __init *sparse_mem_map_popul
static void *sparsemap_buf __meminitdata;
static void *sparsemap_buf_end __meminitdata;

-static inline void __init sparse_buffer_free(unsigned long size)
+static inline void __meminit sparse_buffer_free(unsigned long size)
{
WARN_ON(!sparsemap_buf || size == 0);
memblock_free_early(__pa(sparsemap_buf), size);
_