]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm: vmscan: simplify the folio refcount check in pageout()
authorBaolin Wang <baolin.wang@linux.alibaba.com>
Thu, 18 Sep 2025 03:46:54 +0000 (11:46 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 20 Nov 2025 21:43:56 +0000 (13:43 -0800)
commit4f8961b29501f40a044bba56f61cc9b7e9bbdf94
treebd499f388ede97d4d764b7fe8cfc658a4ce1d42b
parentd94d9293a1ecde99514026950ded294dd5562e30
mm: vmscan: simplify the folio refcount check in pageout()

Since we no longer attempt to write back filesystem folios in pageout()
(they will be filtered out by the following check in pageout()), and only
tmpfs/shmem folios and anonymous swapcache folios can be written back, we
can remove the redundant folio_test_private() when checking the folio's
refcount, as tmpfs/shmem and swapcache folios do not use the PG_private
flag.

While we're at it, we can open-code the folio refcount check instead of
adding a simple helper that has only one user.

Link: https://lkml.kernel.org/r/4cbbec5bb92397aa4597105f1f499aabf7a1901c.1758166683.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: 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