Skip to content

Commit

Permalink
mm/vmscan: Free non-shmem folios without splitting them
Browse files Browse the repository at this point in the history
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) <willy@infradead.org>
  • Loading branch information
Matthew Wilcox (Oracle) committed Mar 21, 2022
1 parent 84fbbe2 commit 820c4e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
@@ -1739,8 +1739,8 @@ static unsigned int shrink_page_list(struct list_head *page_list,
/* Adding to swap updated mapping */
mapping = page_mapping(page);
}
} else if (unlikely(PageTransHuge(page))) {
/* Split file THP */
} else if (PageSwapBacked(page) && PageTransHuge(page)) {
/* Split shmem THP */
if (split_folio_to_list(folio, page_list))
goto keep_locked;
}

0 comments on commit 820c4e2

Please sign in to comment.