Skip to content

Commit 343b288

Browse files
author
Matthew Wilcox (Oracle)
committed
mm/vmscan: Optimise shrink_page_list for non-PMD-sized folios
A large folio which is smaller than a PMD does not need to do the extra work in try_to_unmap() of trying to split a PMD entry. Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
1 parent 820c4e2 commit 343b288

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mm/vmscan.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1765,7 +1765,8 @@ static unsigned int shrink_page_list(struct list_head *page_list,
17651765
enum ttu_flags flags = TTU_BATCH_FLUSH;
17661766
bool was_swapbacked = PageSwapBacked(page);
17671767

1768-
if (unlikely(PageTransHuge(page)))
1768+
if (PageTransHuge(page) &&
1769+
thp_order(page) >= HPAGE_PMD_ORDER)
17691770
flags |= TTU_SPLIT_HUGE_PMD;
17701771

17711772
try_to_unmap(folio, flags);

0 commit comments

Comments
 (0)