Re: [PATCH] mm: vmscan: remove the redundant FOLIOREF_RECLAIM_CLEAN logic

From: Shakeel Butt

Date: Mon Jun 29 2026 - 11:58:29 EST


On Mon, Jun 29, 2026 at 04:04:06PM +0800, Baolin Wang wrote:
> folio_check_references() will return FOLIOREF_RECLAIM_CLEAN for referenced
> file folios, indicating that we can proceed to reclaim clean file folios
> or keep them if they are dirty file folios. However, after commit 6b0dfabb3555
> ("fs: Remove aops->writepage"), we no longer attempt to write back filesystem
> folios through reclaim. Instead, we always activate dirty file folios and wakeup
> the flush workers to write them back. As a result, the FOLIOREF_RECLAIM_CLEAN
> logic is now redundant: for dirty file folios, we will no longer reach the
> 'references == FOLIOREF_RECLAIM_CLEAN' branch in shrink_folio_list().
>
> Additionally, lazyfree folios are also placed on the file LRU list, but if a
> lazyfree folio becomes dirty, try_to_unmap() will fail and thus prevent reclaim
> of the re-dirtied lazyfree folios.
>
> Therefore, we can drop the FOLIOREF_RECLAIM_CLEAN-related logic.
>
> Signed-off-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>

Reviewed-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>