diff options
author | Shaohua Li <shli@kernel.org> | 2013-04-29 18:08:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 18:54:38 -0400 |
commit | 5bc7b8aca942d03bf2716ddcfcb4e0b57e43a1b8 (patch) | |
tree | c76049e13755609ecbd4c4066fddd8bbfdd9f650 /include/linux/huge_mm.h | |
parent | 1eec6702a80e04416d528846a5ff2122484d95ec (diff) |
mm: thp: add split tail pages to shrink page list in page reclaim
In page reclaim, huge page is split. split_huge_page() adds tail pages
to LRU list. Since we are reclaiming a huge page, it's better we
reclaim all subpages of the huge page instead of just the head page.
This patch adds split tail pages to shrink page list so the tail pages
can be reclaimed soon.
Before this patch, run a swap workload:
thp_fault_alloc 3492
thp_fault_fallback 608
thp_collapse_alloc 6
thp_collapse_alloc_failed 0
thp_split 916
With this patch:
thp_fault_alloc 4085
thp_fault_fallback 16
thp_collapse_alloc 90
thp_collapse_alloc_failed 0
thp_split 1272
fallback allocation is reduced a lot.
[akpm@linux-foundation.org: fix CONFIG_SWAP=n build]
Signed-off-by: Shaohua Li <shli@fusionio.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/huge_mm.h')
-rw-r--r-- | include/linux/huge_mm.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index ee1c244a62a1..528454c2caa9 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h | |||
@@ -99,7 +99,11 @@ extern int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, | |||
99 | extern int handle_pte_fault(struct mm_struct *mm, | 99 | extern int handle_pte_fault(struct mm_struct *mm, |
100 | struct vm_area_struct *vma, unsigned long address, | 100 | struct vm_area_struct *vma, unsigned long address, |
101 | pte_t *pte, pmd_t *pmd, unsigned int flags); | 101 | pte_t *pte, pmd_t *pmd, unsigned int flags); |
102 | extern int split_huge_page(struct page *page); | 102 | extern int split_huge_page_to_list(struct page *page, struct list_head *list); |
103 | static inline int split_huge_page(struct page *page) | ||
104 | { | ||
105 | return split_huge_page_to_list(page, NULL); | ||
106 | } | ||
103 | extern void __split_huge_page_pmd(struct vm_area_struct *vma, | 107 | extern void __split_huge_page_pmd(struct vm_area_struct *vma, |
104 | unsigned long address, pmd_t *pmd); | 108 | unsigned long address, pmd_t *pmd); |
105 | #define split_huge_page_pmd(__vma, __address, __pmd) \ | 109 | #define split_huge_page_pmd(__vma, __address, __pmd) \ |
@@ -186,6 +190,11 @@ extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vm | |||
186 | #define transparent_hugepage_enabled(__vma) 0 | 190 | #define transparent_hugepage_enabled(__vma) 0 |
187 | 191 | ||
188 | #define transparent_hugepage_flags 0UL | 192 | #define transparent_hugepage_flags 0UL |
193 | static inline int | ||
194 | split_huge_page_to_list(struct page *page, struct list_head *list) | ||
195 | { | ||
196 | return 0; | ||
197 | } | ||
189 | static inline int split_huge_page(struct page *page) | 198 | static inline int split_huge_page(struct page *page) |
190 | { | 199 | { |
191 | return 0; | 200 | return 0; |