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


Groups > linux.kernel > #1503435

Re: [patch] mm, thp: avoid unlikely branches for split_huge_pmd

From Andrew Morton <akpm@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [patch] mm, thp: avoid unlikely branches for split_huge_pmd
Date 2016-10-19 01:20 +0200
Message-ID <stLPQ-zw-33@gated-at.bofh.it> (permalink)
References <stLG9-vI-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

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


Thread

[patch] mm, thp: avoid unlikely branches for split_huge_pmd David Rientjes <rientjes@google.com> - 2016-10-19 01:10 +0200
  Re: [patch] mm, thp: avoid unlikely branches for split_huge_pmd Andrew Morton <akpm@linux-foundation.org> - 2016-10-19 01:20 +0200
  Re: [patch] mm, thp: avoid unlikely branches for split_huge_pmd Vlastimil Babka <vbabka@suse.cz> - 2016-10-19 16:20 +0200

csiph-web