aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorDave Hansen <dave@linux.vnet.ibm.com>2011-03-22 19:32:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-22 20:44:04 -0400
commit033193275b3ffcfe7f3fde7b569f3d207f6cd6a0 (patch)
treefc65fa02248f855f0f63e087f35a507b6abb5617 /include/linux/mm.h
parent278df9f451dc71dcd002246be48358a473504ad0 (diff)
pagewalk: only split huge pages when necessary
Right now, if a mm_walk has either ->pte_entry or ->pmd_entry set, it will unconditionally split any transparent huge pages it runs in to. In practice, that means that anyone doing a cat /proc/$pid/smaps will unconditionally break down every huge page in the process and depend on khugepaged to re-collapse it later. This is fairly suboptimal. This patch changes that behavior. It teaches each ->pmd_entry handler (there are five) that they must break down the THPs themselves. Also, the _generic_ code will never break down a THP unless a ->pte_entry handler is actually set. This means that the ->pmd_entry handlers can now choose to deal with THPs without breaking them down. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Dave Hansen <dave@linux.vnet.ibm.com> Acked-by: Mel Gorman <mel@csn.ul.ie> Acked-by: David Rientjes <rientjes@google.com> Reviewed-by: Eric B Munson <emunson@mgebm.net> Tested-by: Eric B Munson <emunson@mgebm.net> Cc: Michael J Wolf <mjwolf@us.ibm.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Matt Mackall <mpm@selenic.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 901435e3a9a9..294104e0891d 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -914,6 +914,9 @@ unsigned long unmap_vmas(struct mmu_gather **tlb,
914 * @pgd_entry: if set, called for each non-empty PGD (top-level) entry 914 * @pgd_entry: if set, called for each non-empty PGD (top-level) entry
915 * @pud_entry: if set, called for each non-empty PUD (2nd-level) entry 915 * @pud_entry: if set, called for each non-empty PUD (2nd-level) entry
916 * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry 916 * @pmd_entry: if set, called for each non-empty PMD (3rd-level) entry
917 * this handler is required to be able to handle
918 * pmd_trans_huge() pmds. They may simply choose to
919 * split_huge_page() instead of handling it explicitly.
917 * @pte_entry: if set, called for each non-empty PTE (4th-level) entry 920 * @pte_entry: if set, called for each non-empty PTE (4th-level) entry
918 * @pte_hole: if set, called for each hole at all levels 921 * @pte_hole: if set, called for each hole at all levels
919 * @hugetlb_entry: if set, called for each hugetlb entry 922 * @hugetlb_entry: if set, called for each hugetlb entry