lkml.org 
[lkml]   [2017]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] mm: Mark create_huge_pmd() inline to prevent build failure
On Wed, Jul 12, 2017 at 8:57 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
>
> With gcc 4.1.2:
>
> mm/memory.o: In function `create_huge_pmd':
> memory.c:(.text+0x93e): undefined reference to `do_huge_pmd_anonymous_page'
>
> Converting transparent_hugepage_enabled() from a macro to a static
> inline function reduced the ability of the compiler to remove unused
> code.
>
> Fix this by marking create_huge_pmd() inline.
>
> Fixes: 16981d763501c0e0 ("mm: improve readability of transparent_hugepage_enabled()")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

> ---
> Interestingly, create_huge_pmd() is emitted in the assembler output, but
> never called.

I've never seen this before either. I know that early gcc-4 compilers
would do this
when a function is referenced from an unused function pointer, but not with
a compile-time constant evaluation. I guess that transparent_hugepage_enabled
is just slightly more complex than it gcc-4.1 can handle here.

Arnd

\
 
 \ /
  Last update: 2017-07-12 09:23    [W:0.096 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site