Skip to content

Commit 820c4e2

Browse files
author
Matthew Wilcox (Oracle)
committed
mm/vmscan: Free non-shmem folios without splitting them
We have to allocate memory in order to split a file-backed folio, so it's not a good idea to split them in the memory freeing path. It also doesn't work for XFS because pages have an extra reference count from page_has_private() and split_huge_page() expects that reference to have already been removed. Unfortunately, we still have to split shmem THPs because we can't handle swapping out an entire THP yet. Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
1 parent 84fbbe2 commit 820c4e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/vmscan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,8 +1739,8 @@ static unsigned int shrink_page_list(struct list_head *page_list,
17391739
/* Adding to swap updated mapping */
17401740
mapping = page_mapping(page);
17411741
}
1742-
} else if (unlikely(PageTransHuge(page))) {
1743-
/* Split file THP */
1742+
} else if (PageSwapBacked(page) && PageTransHuge(page)) {
1743+
/* Split shmem THP */
17441744
if (split_folio_to_list(folio, page_list))
17451745
goto keep_locked;
17461746
}

0 commit comments

Comments
 (0)