Skip to content

Commit 2f33a70

Browse files
Hugh Dickinstorvalds
authored andcommitted
mm,thp: stop leaking unreleased file pages
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]>
1 parent af4798a commit 2f33a70

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mm/khugepaged.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1692,6 +1692,7 @@ static void collapse_file(struct mm_struct *mm,
16921692
if (page_has_private(page) &&
16931693
!try_to_release_page(page, GFP_KERNEL)) {
16941694
result = SCAN_PAGE_HAS_PRIVATE;
1695+
putback_lru_page(page);
16951696
goto out_unlock;
16961697
}
16971698

0 commit comments

Comments
 (0)