lkml.org 
[lkml]   [2016]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] mm, thp: avoid unlikely branches for split_huge_pmd
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.

\
 
 \ /
  Last update: 2016-10-19 01:11    [W:0.046 / U:2.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site