lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <308c809e-160a-4829-a8b9-9c7682fcd251@kernel.org>
Date: Thu, 4 Dec 2025 13:42:18 +0100
From: "David Hildenbrand (Red Hat)" <david@...nel.org>
To: Chen Ridong <chenridong@...weicloud.com>, akpm@...ux-foundation.org,
 axelrasmussen@...gle.com, yuanchu@...gle.com, weixugc@...gle.com,
 hannes@...xchg.org, mhocko@...nel.org, zhengqi.arch@...edance.com,
 shakeel.butt@...ux.dev, lorenzo.stoakes@...cle.com, yuzhao@...gle.com,
 jaewon31.kim@...sung.com, ioworker0@...il.com
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org, lujialin4@...wei.com,
 chenridong@...wei.com
Subject: Re: [PATCH -next v2] mm: vmscan: correct nr_requested tracing in
 scan_folios

On 12/4/25 13:23, Chen Ridong wrote:
> From: Chen Ridong <chenridong@...wei.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 capped valued.
> 
> Fixes: 8c2214fc9a47 ("mm: multi-gen LRU: reuse some legacy trace events")
> Signed-off-by: Chen Ridong <chenridong@...wei.com>
> ---
>   mm/vmscan.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 584f41eb4c14..a0a74cac947b 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -4404,7 +4404,8 @@ static int scan_folios(unsigned long nr_to_scan, struct lruvec *lruvec,
>   	int scanned = 0;
>   	int isolated = 0;
>   	int skipped = 0;
> -	int remaining = min(nr_to_scan, MAX_LRU_BATCH);
> +	int scan_batch = min(nr_to_scan, MAX_LRU_BATCH);
> +	int remaining = scan_batch;
>   	struct lru_gen_folio *lrugen = &lruvec->lrugen;
>   	struct mem_cgroup *memcg = lruvec_memcg(lruvec);
>   
> @@ -4464,7 +4465,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, scan_batch,
>   				scanned, skipped, isolated,
>   				type ? LRU_INACTIVE_FILE : LRU_INACTIVE_ANON);
>   	if (type == LRU_GEN_FILE)

Acked-by: David Hildenbrand (Red Hat) <david@...nel.org>

-- 
Cheers

David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ