From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: akpm@linux-foundation.org, hannes@cmpxchg.org
Cc: kasong@tencent.com, qi.zheng@linux.dev, shakeel.butt@linux.dev,
baohua@kernel.org, axelrasmussen@google.com, yuanchu@google.com,
weixugc@google.com, david@kernel.org, mhocko@kernel.org,
ljs@kernel.org, baolin.wang@linux.alibaba.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mm: vmscan: remove the redundant FOLIOREF_RECLAIM_CLEAN logic
Date: Mon, 29 Jun 2026 16:04:06 +0800 [thread overview]
Message-ID: <def70a713e10bcbdf3b9fccc2139ecc07b64f2cb.1782715791.git.baolin.wang@linux.alibaba.com> (raw)
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@linux.alibaba.com>
---
mm/vmscan.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 299b5d9e8836..2f7e5878faa5 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -823,7 +823,6 @@ void folio_putback_lru(struct folio *folio)
enum folio_references {
FOLIOREF_RECLAIM,
- FOLIOREF_RECLAIM_CLEAN,
FOLIOREF_KEEP,
FOLIOREF_ACTIVATE,
};
@@ -920,10 +919,6 @@ static enum folio_references folio_check_references(struct folio *folio,
return FOLIOREF_KEEP;
}
- /* Reclaim if clean, defer dirty folios to writeback */
- if (referenced_folio && folio_is_file_lru(folio))
- return FOLIOREF_RECLAIM_CLEAN;
-
return FOLIOREF_RECLAIM;
}
@@ -1235,7 +1230,6 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
stat->nr_ref_keep += nr_pages;
goto keep_locked;
case FOLIOREF_RECLAIM:
- case FOLIOREF_RECLAIM_CLEAN:
; /* try to reclaim the folio below */
}
@@ -1381,8 +1375,6 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
goto activate_locked;
}
- if (references == FOLIOREF_RECLAIM_CLEAN)
- goto keep_locked;
if (!may_enter_fs(folio, sc->gfp_mask))
goto keep_locked;
if (!sc->may_writepage)
--
2.47.3
next reply other threads:[~2026-06-29 8:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 8:04 Baolin Wang [this message]
2026-06-29 12:43 ` Johannes Weiner
2026-06-29 15:43 ` Shakeel Butt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=def70a713e10bcbdf3b9fccc2139ecc07b64f2cb.1782715791.git.baolin.wang@linux.alibaba.com \
--to=baolin.wang@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=baohua@kernel.org \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=kasong@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@kernel.org \
--cc=qi.zheng@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=weixugc@google.com \
--cc=yuanchu@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome