mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lance Yang <ioworker0@gmail.com>
To: david@kernel.org
Cc: akpm@linux-foundation.org, axelrasmussen@google.com,
	chenridong@huawei.com, chenridong@huaweicloud.com,
	hannes@cmpxchg.org, jaewon31.kim@samsung.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	lorenzo.stoakes@oracle.com, lujialin4@huawei.com,
	mhocko@kernel.org, shakeel.butt@linux.dev, weixugc@google.com,
	yuanchu@google.com, yuzhao@google.com,
	zhengqi.arch@bytedance.com, Lance Yang <lance.yang@linux.dev>
Subject: Re: [PATCH -next] mm: vmscan: correct nr_requested tracing in
Date: Thu,  4 Dec 2025 17:05:34 +0800	[thread overview]
Message-ID: <20251204090534.22909-1-ioworker0@gmail.com> (raw)
In-Reply-To: <98cbf348-ff21-4c90-af32-b8009c34e5fd@kernel.org>

From: Lance Yang <lance.yang@linux.dev>


On Wed, 3 Dec 2025 12:33:07 +0100, David Hildenbrand (Red Hat) wrote:
> On 12/3/25 10:40, Chen Ridong wrote:
> > From: Chen Ridong <chenridong@huawei.com>
> > 
> > When enabling vmscan tracing, it is observed that nr_requested is always
> > 4096, which is confusing.
> > 
> >          mm_vmscan_lru_isolate: classzone=3 order=0 nr_requested=4096 ...
> >          mm_vmscan_lru_isolate: classzone=3 order=0 nr_requested=4096 ...
> >          mm_vmscan_lru_isolate: classzone=3 order=0 nr_requested=4096 ...
> >          mm_vmscan_lru_isolate: classzone=3 order=0 nr_requested=4096 ...
> >          mm_vmscan_lru_isolate: classzone=3 order=0 nr_requested=4096 ...
> >          mm_vmscan_lru_isolate: classzone=3 order=0 nr_requested=4096 ...
> >          mm_vmscan_lru_isolate: classzone=3 order=0 nr_requested=4096 ...
> > 
> > This is because it prints MAX_LRU_BATCH, which is meaningless as it's a
> > constant. To fix this, modify it to print nr_to_scan as isolate_lru_folios
> > does.
> > 
> > Fixes: 8c2214fc9a47 ("mm: multi-gen LRU: reuse some legacy trace events")
> > Signed-off-by: Chen Ridong <chenridong@huawei.com>
> > ---
> >   mm/vmscan.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/mm/vmscan.c b/mm/vmscan.c
> > index fddd168a9737..8cfafd50a7a8 100644
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -4601,7 +4601,7 @@ static int scan_folios(unsigned long nr_to_scan, struct lruvec *lruvec,
> >   	count_memcg_events(memcg, item, isolated);
> >   	count_memcg_events(memcg, PGREFILL, sorted);
> >   	__count_vm_events(PGSCAN_ANON + type, isolated);
> > -	trace_mm_vmscan_lru_isolate(sc->reclaim_idx, sc->order, MAX_LRU_BATCH,
> > +	trace_mm_vmscan_lru_isolate(sc->reclaim_idx, sc->order, nr_to_scan,
> >   				scanned, skipped, isolated,
> 
> We do that in isolate_lru_folios().
> 
> Given that we do
> 
> 	int remaining = min(nr_to_scan, MAX_LRU_BATCH);
> 
> and effectively cap it, I wonder if we would want to trace that capped 
> valued instead of MAX_LRU_BATCH.

Yeah, since we explicitly clamp the work at MAX_LRU_BATCH, the trace
should reflect that reality :)


      parent reply	other threads:[~2025-12-04  9:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-03  9:40 [PATCH -next] mm: vmscan: correct nr_requested tracing in scan_folios Chen Ridong
2025-12-03 11:33 ` David Hildenbrand (Red Hat)
2025-12-04  0:46   ` Chen Ridong
2025-12-04 11:54     ` David Hildenbrand (Red Hat)
2025-12-04 12:19       ` Chen Ridong
2025-12-04  9:05   ` Lance Yang [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=20251204090534.22909-1-ioworker0@gmail.com \
    --to=ioworker0@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=chenridong@huawei.com \
    --cc=chenridong@huaweicloud.com \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=jaewon31.kim@samsung.com \
    --cc=lance.yang@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=lujialin4@huawei.com \
    --cc=mhocko@kernel.org \
    --cc=shakeel.butt@linux.dev \
    --cc=weixugc@google.com \
    --cc=yuanchu@google.com \
    --cc=yuzhao@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

all inboxes | Powered by JetHome®