From: Bo Zhang <zhangbo0325@gmail.com>
To: baohua@kernel.org
Cc: akpm@linux-foundation.org, hannes@cmpxchg.org,
kasong@tencent.com, qi.zheng@linux.dev, shakeel.butt@linux.dev,
david@kernel.org, mhocko@kernel.org, ljs@kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm: vmscan: avoid anon scanning for GFP_NOIO with low swapcache
Date: Sun, 6 Sep 2026 13:04:11 +0800 [thread overview]
Message-ID: <20260906050411.405850-1-zhangbo56@xiaomi.com> (raw)
In-Reply-To: <CAGsJ_4wC78QDTrETC0WpnouN=8aF8ae6Yxgb+oKiOP3A76ATLg@mail.gmail.com>
Thanks Barry.
On Sun, Sep 6, 2026 at 12:53 PM Barry Song <baohua@kernel.org> wrote:
>
> I notice this only fixes the active/inactive LRU case. To address the
> MGLRU case, it seems we may need a more fundamental change.
>
> I'm fine with starting by fixing the active/inactive LRU case first.
> However, could we mention in the changelog that this patch only
> addresses the active/inactive LRU case, and that fixing the MGLRU case
> is on the TODO list?
You're right - MGLRU decides anon vs file scanning in its own path
(get_type_to_scan()/isolate_folios()) and does not go through this
can_reclaim_anon_pages() check for normal reclaim, so it is not covered
here. I'll note in the changelog that this patch only addresses the
active/inactive LRU case and that the MGLRU case is left as a TODO.
> > - if (get_nr_swap_pages() > 0)
> > + if (get_nr_swap_pages() > 0 &&
> > + !reclaimable_anon_is_low(memcg, nid, sc))
>
> Can we also update the comment above accordingly?
>
> /*
> * For non-memcg reclaim, do we have space on any swap device?
> * For GFP_NOIO, do we also have sufficient swapcache anon folios
> * to reclaim?
> */
Will do in v3.
> > - if (mem_cgroup_get_nr_swap_pages(memcg) > 0)
> > + if (mem_cgroup_get_nr_swap_pages(memcg) > 0 &&
> > + !reclaimable_anon_is_low(memcg, nid, sc))
>
> Do we also need to update the comment?
>
> /*
> * Is the memcg above its swap limit, and does it have enough
> * swapcache anon folios to reclaim for GFP_NOIO?
> */
Yes, updated both comments in v3.
Thanks,
Bo
next prev parent reply other threads:[~2026-09-06 5:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 4:01 [RFC PATCH] mm: vmscan: avoid anon scanning for GFP_NOIO with low swapcache Bo Zhang
2026-09-03 10:35 ` Barry Song
2026-09-03 12:49 ` Bo Zhang
2026-09-03 13:03 ` Johannes Weiner
2026-09-04 2:07 ` Bo Zhang
2026-09-04 16:38 ` Johannes Weiner
2026-09-06 1:18 ` [PATCH v2] " Bo Zhang
2026-09-06 2:46 ` Andrew Morton
2026-09-06 3:56 ` Bo Zhang
2026-09-06 4:53 ` Barry Song
2026-09-06 5:04 ` Bo Zhang [this message]
2026-09-06 5:49 ` Kairui Song
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=20260906050411.405850-1-zhangbo56@xiaomi.com \
--to=zhangbo0325@gmail.com \
--cc=akpm@linux-foundation.org \
--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 \
/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