From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Michal Hocko <mhocko@suse.com>
Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, david@redhat.com,
zhengqi.arch@bytedance.com, shakeel.butt@linux.dev,
lorenzo.stoakes@oracle.com, hughd@google.com,
willy@infradead.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] mm: vmscan: simplify the logic for activating dirty file folios
Date: Mon, 20 Oct 2025 15:34:59 +0800 [thread overview]
Message-ID: <3971f97e-399c-425b-979f-55334eacd925@linux.alibaba.com> (raw)
In-Reply-To: <aPIwafJOKUh3N4zX@tiehlicka>
On 2025/10/17 20:02, Michal Hocko wrote:
> On Fri 17-10-25 15:53:07, Baolin Wang wrote:
>> After commit 6b0dfabb3555 ("fs: Remove aops->writepage"), we no longer
>> attempt to write back filesystem folios through reclaim.
>>
>> However, in the shrink_folio_list() function, there still remains some
>> logic related to writeback control of dirty file folios. The original
>> logic was that, for direct reclaim, or when folio_test_reclaim() is false,
>> or the PGDAT_DIRTY flag is not set, the dirty file folios would be directly
>> activated to avoid being scanned again; otherwise, it will try to writeback
>> the dirty file folios. However, since we can no longer perform writeback on
>> dirty folios, the dirty file folios will still be activated.
>>
>> Additionally, under the original logic, if we continue to try writeback dirty
>> file folios, we will also check the references flag, sc->may_writepage, and
>> may_enter_fs(), which may result in dirty file folios being left in the inactive
>> list. This is unreasonable. Even if these dirty folios are scanned again, we
>> still cannot clean them.
>>
>> Therefore, the checks on these dirty file folios appear to be redundant and can
>> be removed. Dirty file folios should be directly moved to the active list to
>> avoid being scanned again. Since we set the PG_reclaim flag for the dirty folios,
>> once the writeback is completed, they will be moved back to the tail of the
>> inactive list to be retried for quick reclaim.
>
> Is there any actual problem you are trying to address or is this a code
> clean up? How have you evaluated this change?
This patch is more of a cleanup patch, since dirty file folios are also
activated in pageout(), so there are essentially no significant logical
changes. Moreover, this patch set is a continuation of the previous
cleanup work[1] for dirty file folios, and further cleanup and
optimization work for file folios reclamation is still ongoing.
I conducted some evaluations (such as building the kernel in memcg to
reclaim file folios and running thpcompact to reclaim file folios), and
I did not observe any obvious changes in reclaim efficiency.
[1]
https://lore.kernel.org/all/cover.1758166683.git.baolin.wang@linux.alibaba.com/T/#u
prev parent reply other threads:[~2025-10-20 7:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-17 7:53 [PATCH v2 0/2] optimize the logic for handling dirty file folios during reclaim Baolin Wang
2025-10-17 7:53 ` [PATCH v2 1/2] mm: vmscan: filter out the dirty file folios for node_reclaim() Baolin Wang
2025-10-17 7:53 ` [PATCH v2 2/2] mm: vmscan: simplify the logic for activating dirty file folios Baolin Wang
2025-10-17 12:02 ` Michal Hocko
2025-10-20 7:34 ` Baolin Wang [this message]
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=3971f97e-399c-425b-979f-55334eacd925@linux.alibaba.com \
--to=baolin.wang@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=shakeel.butt@linux.dev \
--cc=willy@infradead.org \
--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