]> Git Repo - linux.git/commit - mm/memory.c
mm, thp: avoid unlikely branches for split_huge_pmd
authorDavid Rientjes <[email protected]>
Tue, 13 Dec 2016 00:42:20 +0000 (16:42 -0800)
committerLinus Torvalds <[email protected]>
Tue, 13 Dec 2016 02:55:07 +0000 (18:55 -0800)
commitfd60775aea802beef444881ddfa111a4b73b1bbc
treedb96e02edd1a97205c8b420d7309d2956e6f0e3a
parent3f5000693f80e014fa577b67b93a0de945a4338d
mm, thp: avoid unlikely branches for split_huge_pmd

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.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: David Rientjes <[email protected]>
Acked-by: Vlastimil Babka <[email protected]>
Cc: "Kirill A. Shutemov" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/huge_mm.h
mm/memory.c
mm/mempolicy.c
mm/mprotect.c
This page took 0.064101 seconds and 4 git commands to generate.