mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Hui Zhu <hui.zhu@linux.dev>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kairui Song <kasong@tencent.com>, Qi Zheng <qi.zheng@linux.dev>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	Barry Song <baohua@kernel.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>,
	Lorenzo Stoakes <ljs@kernel.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: Hui Zhu <zhuhui@kylinos.cn>
Subject: Re: [PATCH mm-unstable v2 1/2] mm/vmscan: fix missing NR_ISOLATED counter update in MGLRU reclaim path
Date: Tue, 18 Aug 2026 11:19:39 +0800	[thread overview]
Message-ID: <7e99b10a-183c-446b-9fbe-8db8cfc0acca@linux.alibaba.com> (raw)
In-Reply-To: <9635d3c027bb8a5a416df04ea891a482beb3de9e.1786950138.git.zhuhui@kylinos.cn>



On 8/17/26 3:11 PM, Hui Zhu wrote:
> From: Hui Zhu <zhuhui@kylinos.cn>
> 
> MGLRU evict_folios() isolates folios from the LRU without updating
> the NR_ISOLATED_ANON/FILE counters, unlike the legacy
> shrink_inactive_list() path. This causes compaction's
> too_many_isolated() check to under-count isolated pages when MGLRU
> reclaim is active.
> 
> Add NR_ISOLATED counter updates in evict_folios(): increment after
> isolate_folios() and decrement after all retry passes complete, using
> the existing nr_isolated which holds the original isolated count.
> 
> Signed-off-by: Hui Zhu <zhuhui@kylinos.cn>
> ---

Changes look good to me with one nit below.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

>   mm/vmscan.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index c1404a59523d..fdc45d7d8fba 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -4892,6 +4892,9 @@ static int evict_folios(unsigned long nr_to_scan, struct lruvec *lruvec,
>   	scanned = isolate_folios(nr_to_scan, lruvec, sc, swappiness,
>   				 &list, &isolated, &type, &type_scanned);
>   	nr_isolated = isolated;
> +	if (nr_isolated)
> +		__mod_node_page_state(pgdat, NR_ISOLATED_ANON + type,
> +				      nr_isolated);
>   
>   	/* Scanning may have emptied the oldest gen, flush it */
>   	if (scanned)
> @@ -4954,6 +4957,10 @@ static int evict_folios(unsigned long nr_to_scan, struct lruvec *lruvec,
>   		goto retry;
>   	}
>   
> +	if (nr_isolated)

Nit: we can remove this check, since we never reach here if nr_isolated 
is 0.

> +		mod_node_page_state(pgdat, NR_ISOLATED_ANON + type,
> +				    -nr_isolated);
> +
>   	if (nr_isolated > total_reclaimed)
>   		mod_lruvec_state(lruvec, PGROTATE_ANON + type,
>   				 nr_isolated - total_reclaimed);


  reply	other threads:[~2026-08-18  3:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17  7:11 [PATCH mm-unstable v2 0/2] mm/vmscan: fix NR_ISOLATED accounting and throttling for MGLRU Hui Zhu
2026-08-17  7:11 ` [PATCH mm-unstable v2 1/2] mm/vmscan: fix missing NR_ISOLATED counter update in MGLRU reclaim path Hui Zhu
2026-08-18  3:19   ` Baolin Wang [this message]
2026-08-17  7:11 ` [PATCH mm-unstable v2 2/2] mm/vmscan: apply too_many_isolated() throttling to MGLRU eviction Hui Zhu
2026-08-18  3:36   ` Baolin Wang

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=7e99b10a-183c-446b-9fbe-8db8cfc0acca@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=hui.zhu@linux.dev \
    --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 \
    --cc=zhuhui@kylinos.cn \
    /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

all inboxes | Powered by JetHome®