From: "zhaoyang.huang" <zhaoyang.huang@unisoc.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Axel Rasmussen <axelrasmussen@google.com>,
Yuanchu Xie <yuanchu@google.com>, Wei Xu <weixugc@google.com>,
Johannes Weiner <hannes@cmpxchg.org>,
David Hildenbrand <david@kernel.org>,
Michal Hocko <mhocko@kernel.org>,
Qi Zheng <zhengqi.arch@bytedance.com>,
Matthew Wilcox <willy@infradead.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>,
Zhaoyang Huang <huangzhaoyang@gmail.com>, <steve.kang@unisoc.com>
Subject: [PATCH] mm: skip dirty file folios during isolation
Date: Wed, 18 Mar 2026 17:06:56 +0800 [thread overview]
Message-ID: <20260318090656.1748509-1-zhaoyang.huang@unisoc.com> (raw)
From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
Since dirty file folios are no longer writeout in reclaiming after
'commit 84798514db50 ("mm: Remove swap_writepage() and
shmem_writepage()")', there is no need to isolate them from LRU which
could help to improve the scan efficiency.
Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
---
mm/vmscan.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 10f1e7d716ca..3a029dede5ce 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -4507,6 +4507,7 @@ static bool sort_folio(struct lruvec *lruvec, struct folio *folio, struct scan_c
static bool isolate_folio(struct lruvec *lruvec, struct folio *folio, struct scan_control *sc)
{
bool success;
+ struct address_space *mapping = folio_mapping(folio);
/* swap constrained */
if (!(sc->gfp_mask & __GFP_IO) &&
@@ -4514,6 +4515,11 @@ static bool isolate_folio(struct lruvec *lruvec, struct folio *folio, struct sca
(folio_test_anon(folio) && !folio_test_swapcache(folio))))
return false;
+ /* skip dirty file pages since they can't be writeout */
+ if (mapping && !shmem_mapping(mapping) &&
+ !folio_test_anon(folio) && folio_test_dirty(folio))
+ return false;
+
/* raced with release_pages() */
if (!folio_try_get(folio))
return false;
--
2.25.1
next reply other threads:[~2026-03-18 9:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 9:06 zhaoyang.huang [this message]
2026-03-18 13:50 ` Johannes Weiner
2026-03-19 0:46 ` Zhaoyang Huang
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=20260318090656.1748509-1-zhaoyang.huang@unisoc.com \
--to=zhaoyang.huang@unisoc.com \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=david@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=huangzhaoyang@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=steve.kang@unisoc.com \
--cc=weixugc@google.com \
--cc=willy@infradead.org \
--cc=yuanchu@google.com \
--cc=zhengqi.arch@bytedance.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