Skip to content

Commit

Permalink
mm/vmscan: Optimise shrink_page_list for non-PMD-sized folios
Browse files Browse the repository at this point in the history
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) <willy@infradead.org>
  • Loading branch information
Matthew Wilcox (Oracle) committed Mar 21, 2022
1 parent 820c4e2 commit 343b288
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,8 @@ static unsigned int shrink_page_list(struct list_head *page_list,
enum ttu_flags flags = TTU_BATCH_FLUSH;
bool was_swapbacked = PageSwapBacked(page);

if (unlikely(PageTransHuge(page)))
if (PageTransHuge(page) &&
thp_order(page) >= HPAGE_PMD_ORDER)
flags |= TTU_SPLIT_HUGE_PMD;

try_to_unmap(folio, flags);
Expand Down

0 comments on commit 343b288

Please sign in to comment.