linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH next] mm/thp: fix collapse_file()'s try_to_unmap(folio,)
@ 2022-02-27  2:22 Hugh Dickins
  2022-03-01  4:18 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: Hugh Dickins @ 2022-02-27  2:22 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Andrew Morton, linux-kernel, linux-mm

The foliation of THP collapse_file()'s call to try_to_unmap() is
currently wrong, crashing on a test in rmap_walk() when xas_next()
delivered a value (after which page has been loaded independently).

Fixes: c3b522d9a698 ("mm/rmap: Convert try_to_unmap() to take a folio")
Signed-off-by: Hugh Dickins <hughd@google.com>
---
Please just fold in if you agree.

 mm/khugepaged.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- mmotm/mm/khugepaged.c
+++ linux/mm/khugepaged.c
@@ -1824,7 +1824,8 @@ static void collapse_file(struct mm_stru
 		}
 
 		if (page_mapped(page))
-			try_to_unmap(folio, TTU_IGNORE_MLOCK | TTU_BATCH_FLUSH);
+			try_to_unmap(page_folio(page),
+				     TTU_IGNORE_MLOCK | TTU_BATCH_FLUSH);
 
 		xas_lock_irq(&xas);
 		xas_set(&xas, index);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-01  4:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-27  2:22 [PATCH next] mm/thp: fix collapse_file()'s try_to_unmap(folio,) Hugh Dickins
2022-03-01  4:18 ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox