linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Dan Williams <dan.j.williams@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux-MM <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm: Mark create_huge_pmd() inline to prevent build failure
Date: Wed, 12 Jul 2017 09:22:51 +0200	[thread overview]
Message-ID: <CAK8P3a3J8uyTW2_iDpOi2Y5ONf7z3TR0zk3igp2uBrL8xsQd8Q@mail.gmail.com> (raw)
In-Reply-To: <1499842660-10665-1-git-send-email-geert@linux-m68k.org>

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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-07-12  7:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-12  6:57 [PATCH] mm: Mark create_huge_pmd() inline to prevent build failure Geert Uytterhoeven
2017-07-12  7:22 ` Arnd Bergmann [this message]
2017-07-12  7:37   ` Geert Uytterhoeven
2017-07-12  8:00     ` Arnd Bergmann
2017-07-13  0:29 ` Dan Williams
2017-07-13  4:01   ` Dan Williams
2017-07-13  7:04   ` Geert Uytterhoeven
2017-07-13  7:49     ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK8P3a3J8uyTW2_iDpOi2Y5ONf7z3TR0zk3igp2uBrL8xsQd8Q@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).