diff options
author | Hugh Dickins <hughd@google.com> | 2020-05-27 22:20:43 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-06-03 08:23:25 +0200 |
commit | 33beda31816e47f4aa54a863c81285c1ba6460a8 (patch) | |
tree | 052357da46a68958dd03a25754e8d83f158af5f9 | |
parent | 908a3f0488376fb0a3709f9b8c2985d63a2e175a (diff) |
mm,thp: stop leaking unreleased file pages
[ Upstream commit 2f33a706027c94cd4f70fcd3e3f4a17c1ce4ea4b ]
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: 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS")
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Rik van Riel <riel@surriel.com>
Cc: <stable@vger.kernel.org> [5.4+]
Link: http://lkml.kernel.org/r/alpine.LSU.2.11.2005231837500.1766@eggly.anvils
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | mm/khugepaged.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/khugepaged.c b/mm/khugepaged.c index b679908743cb2..ba059e68cf50c 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -1673,6 +1673,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; } |