Skip to content

Commit

Permalink
mm,thp: stop leaking unreleased file pages
Browse files Browse the repository at this point in the history
When collapse_file() calls try_to_release_page(), it has already isolated
the page: so if releasing buffers happens to fail (as it sometimes does),
remember to putback_lru_page(): otherwise that page is left unreclaimable
and unfreeable, and the file extent uncollapsible.

Fixes: 99cb0db ("mm,thp: add read-only THP support for (non-shmem) FS")
Signed-off-by: Hugh Dickins <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Acked-by: Song Liu <[email protected]>
Acked-by: Kirill A. Shutemov <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: <[email protected]>	[5.4+]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Hugh Dickins authored and torvalds committed May 28, 2020
1 parent af4798a commit 2f33a70
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/khugepaged.c
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,7 @@ static void collapse_file(struct mm_struct *mm,
if (page_has_private(page) &&
!try_to_release_page(page, GFP_KERNEL)) {
result = SCAN_PAGE_HAS_PRIVATE;
putback_lru_page(page);
goto out_unlock;
}

Expand Down

0 comments on commit 2f33a70

Please sign in to comment.