linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: David Rientjes <rientjes@google.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch] mm, thp: avoid unlikely branches for split_huge_pmd
Date: Tue, 18 Oct 2016 16:09:59 -0700	[thread overview]
Message-ID: <20161018160959.16187f78b58d76c6087e8491@linux-foundation.org> (raw)
In-Reply-To: <alpine.DEB.2.10.1610181600300.84525@chino.kir.corp.google.com>

On Tue, 18 Oct 2016 16:04:06 -0700 (PDT) David Rientjes <rientjes@google.com> wrote:

> While doing MADV_DONTNEED on a large area of thp memory, I noticed we 
> encountered many unlikely() branches in profiles for each backing 
> hugepage.  This is because zap_pmd_range() would call split_huge_pmd(), 
> which rechecked the conditions that were already validated, but as part of 
> an unlikely() branch.
> 
> Avoid the unlikely() branch when in a context where pmd is known to be 
> good for __split_huge_pmd() directly.

Before:

   text    data     bss     dec     hex filename
  38442      75      48   38565    96a5 mm/memory.o
  21755    2369   18464   42588    a65c mm/mempolicy.o
   4557    1816       0    6373    18e5 mm/mprotect.o

After:

  38362      75      48   38485    9655 mm/memory.o
  21714    2369   18464   42547    a633 mm/mempolicy.o
   4541    1816       0    6357    18d5 mm/mprotect.o


So there's a size improvment too.  gcc-4.4.4.

--
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:[~2016-10-18 23:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18 23:04 [patch] mm, thp: avoid unlikely branches for split_huge_pmd David Rientjes
2016-10-18 23:09 ` Andrew Morton [this message]
2016-10-19  7:34 ` Vlastimil Babka

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=20161018160959.16187f78b58d76c6087e8491@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    /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).