| From: Baolin Wang <baolin.wang@linux.alibaba.com> |
| Subject: mm-vmscan-simplify-the-folio-refcount-check-in-pageout-fix |
| Date: Mon, 22 Sep 2025 14:02:28 +0800 |
| |
| 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 <baolin.wang@linux.alibaba.com> |
| Cc: David Hildenbrand <david@redhat.com> |
| Cc: Shakeel Butt <shakeel.butt@linux.dev> |
| Cc: Hugh Dickins <hughd@google.com> |
| Cc: Johannes Weiner <hannes@cmpxchg.org> |
| Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> |
| Cc: Matthew Wilcox (Oracle) <willy@infradead.org> |
| Cc: Michal Hocko <mhocko@kernel.org> |
| Cc: Qi Zheng <zhengqi.arch@bytedance.com> |
| Signed-off-by: Andrew Morton <akpm@linux-foundation.org> |
| --- |
| |
| mm/vmscan.c | 10 +--------- |
| 1 file changed, 1 insertion(+), 9 deletions(-) |
| |
| --- a/mm/vmscan.c~mm-vmscan-simplify-the-folio-refcount-check-in-pageout-fix |
| +++ a/mm/vmscan.c |
| @@ -689,16 +689,8 @@ static pageout_t pageout(struct folio *f |
| * 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; |
| _ |