From: Baolin Wang Date: Mon, 22 Sep 2025 06:02:28 +0000 (+0800) Subject: mm-vmscan-simplify-the-folio-refcount-check-in-pageout-fix X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5790cb7c5a065583324f403e2bb7caee5ac39b8b;p=users%2Fjedix%2Flinux-maple.git mm-vmscan-simplify-the-folio-refcount-check-in-pageout-fix remove warning and comment, per Hugh Link: https://lkml.kernel.org/r/392a9ca3-31ac-4447-bd44-3c656d63e4ca@linux.alibaba.com Signed-off-by: Baolin Wang Cc: David Hildenbrand Cc: Shakeel Butt Cc: Hugh Dickins Cc: Johannes Weiner Cc: Lorenzo Stoakes Cc: Matthew Wilcox (Oracle) Cc: Michal Hocko Cc: Qi Zheng Signed-off-by: Andrew Morton --- diff --git a/mm/vmscan.c b/mm/vmscan.c index 4907e255857a..aadbee50a851 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -689,16 +689,8 @@ static pageout_t pageout(struct folio *folio, struct address_space *mapping, * A freeable shmem or swapcache folio is referenced only by the * caller that isolated the folio and the page cache. */ - if (folio_ref_count(folio) != 1 + folio_nr_pages(folio)) + if (folio_ref_count(folio) != 1 + folio_nr_pages(folio) || !mapping) return PAGE_KEEP; - if (!mapping) { - /* - * We should no longer have dirty folios with clean buffers and - * a NULL mapping. However, let's be careful for now. - */ - VM_WARN_ON_FOLIO(true, folio); - return PAGE_KEEP; - } if (!shmem_mapping(mapping) && !folio_test_anon(folio)) return PAGE_ACTIVATE;