From: Baoquan He <baoquan.he@linux.dev>
To: Barry Song <baohua@kernel.org>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
kasong@tencent.com, qi.zheng@linux.dev, shakeel.butt@linux.dev,
baolin.wang@linux.alibaba.com, hannes@cmpxchg.org,
mhocko@kernel.org, Baoquan He <hebaoquan@kylinos.cn>
Subject: Re: [PATCH 4/4] mm/mglru: stop counting isolation races as PGSCAN_SKIP in scan_folios()
Date: Thu, 3 Dec 2026 16:22:31 +0800 [thread overview]
Message-ID: <axEmxxavftIJfmyw@fedora> (raw)
In-Reply-To: <CAGsJ_4yLoRA8LFfiA+rtH7TSMUSNcE6cz9t7ZayPcWUitmU6Fg@mail.gmail.com>
On 12/02/26 at 05:22pm, Barry Song wrote:
> On Wed, Dec 2, 2026 at 2:20 PM Baoquan He <baoquan.he@linux.dev> wrote:
> >
> > From: Baoquan He <hebaoquan@kylinos.cn>
> >
> > scan_folios() counted pages it failed to isolate because of a race
> > (folio_try_get() or folio_test_clear_lru() failed) and reported them as
> > PGSCAN_SKIP and nr_skipped.
> >
> > PGSCAN_SKIP is for pages skipped because they sit in zones above the
> > reclaim target. MGLRU only iterates zones at or below that target, so it
> > never has ineligible-zone pages at all; the only thing that fed
> > PGSCAN_SKIP here was isolation races, which misrepresents the counter.
> >
>
> Yes, it doesn't seem particularly useful for MGLRU now, since we have
> separate lists for each zone, whereas CLRU uses
> (folio_zonenum(folio) > sc->reclaim_idx) to skip ineligible folios
> in a shared list.
>
> > Rename skipped_zone to isolate_failed and drop the PGSCAN_SKIP
> > accounting. nr_skipped is passed as 0: the field is kept so the event
> > still lines up with mm_vmscan_lru_isolate, and the races themselves are
> > transient, the folios go back to the generation list and are retried.
>
> [...]
>
> > @@ -4947,10 +4943,10 @@ static int scan_folios(unsigned long nr_to_scan, struct lruvec *lruvec,
> > mod_lruvec_state(lruvec, PGREFILL, sorted);
> > mod_lruvec_state(lruvec, PGSCAN_ANON + type, isolated);
> > trace_mm_vmscan_lru_isolate(sc, nr_to_scan,
> > - scanned, skipped, isolated,
> > + scanned, 0, isolated,
>
> Maybe we could use this argument to trace isolate_failed instead of
> always setting it to 0? The tracepoint is still in mm-new and hasn't
> reached mainline yet, so we should still have time to get your change
> in?
Sounds like a good idea, I will try as suggested. Since Andrew asks
cleanup deferring, this one need be deferred either, right?
By the way, could you help check if this series is OK when it's
convenient to you? I believe it can bring efficiency improvement on
multi-NUMA nodes server, and even benefit small RAM system of one NUMA
node.
[PATCH v6 0/4] skip empty PUD subtrees during aging with a PUD-level Bloom filter
prev parent reply other threads:[~2026-12-03 8:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 6:17 [PATCH 0/4] mm/mglru: cleanup series and a small correctness Baoquan He
2026-12-02 6:17 ` [PATCH 1/4] mm/mglru: use a common helper to check evictable type Baoquan He
2026-12-02 6:41 ` Barry Song
2026-12-02 8:43 ` Baoquan He
2026-12-02 21:49 ` Andrew Morton
2026-12-02 22:40 ` Barry Song
2026-12-03 1:22 ` Baoquan He
2026-12-02 6:17 ` [PATCH 2/4] mm/mglru: rename positive_ctrl_err() to should_reclaim() Baoquan He
2026-12-02 9:59 ` Barry Song (Xiaomi)
2026-12-03 8:13 ` Baoquan He
2026-12-02 6:17 ` [PATCH 3/4] mm/mglru: split reset_ctrl_pos() into _update and _reset Baoquan He
2026-12-02 10:12 ` Barry Song
2026-12-03 8:16 ` Baoquan He
2026-12-02 6:20 ` [PATCH 4/4] mm/mglru: stop counting isolation races as PGSCAN_SKIP in scan_folios() Baoquan He
2026-12-02 9:22 ` Barry Song
2026-12-03 8:22 ` Baoquan He [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=axEmxxavftIJfmyw@fedora \
--to=baoquan.he@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=hannes@cmpxchg.org \
--cc=hebaoquan@kylinos.cn \
--cc=kasong@tencent.com \
--cc=linux-mm@kvack.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