Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1685565

Re: [PATCH] mm: Mark create_huge_pmd() inline to prevent build failure

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH] mm: Mark create_huge_pmd() inline to prevent build failure
Date 2017-07-12 09:30 +0200
Message-ID <u2kfT-5aW-13@gated-at.bofh.it> (permalink)
References <u2jMR-4Kj-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm: Mark create_huge_pmd() inline to prevent build failure Geert Uytterhoeven <geert@linux-m68k.org> - 2017-07-12 09:00 +0200
  Re: [PATCH] mm: Mark create_huge_pmd() inline to prevent build failure Arnd Bergmann <arnd@arndb.de> - 2017-07-12 09:30 +0200
    Re: [PATCH] mm: Mark create_huge_pmd() inline to prevent build failure Geert Uytterhoeven <geert@linux-m68k.org> - 2017-07-12 09:40 +0200
      Re: [PATCH] mm: Mark create_huge_pmd() inline to prevent build failure Arnd Bergmann <arnd@arndb.de> - 2017-07-12 10:10 +0200
  Re: [PATCH] mm: Mark create_huge_pmd() inline to prevent build failure Dan Williams <dan.j.williams@intel.com> - 2017-07-13 02:30 +0200
    Re: [PATCH] mm: Mark create_huge_pmd() inline to prevent build failure Dan Williams <dan.j.williams@intel.com> - 2017-07-13 06:10 +0200
    Re: [PATCH] mm: Mark create_huge_pmd() inline to prevent build failure Geert Uytterhoeven <geert@linux-m68k.org> - 2017-07-13 09:10 +0200
      Re: [PATCH] mm: Mark create_huge_pmd() inline to prevent build failure Dan Williams <dan.j.williams@intel.com> - 2017-07-13 10:00 +0200

csiph-web