linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Li Zhijian <zhijianli88.lz@gmail.com>
To: donettom@linux.ibm.com
Cc: akpm@linux-foundation.org, aneesh.kumar@kernel.org,
	hannes@cmpxchg.org, kaiyang2@cs.cmu.edu,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	mhocko@kernel.org, muchun.song@linux.dev, rientjes@google.com,
	ritesh.list@gmail.com, roman.gushchin@linux.dev,
	shakeel.butt@linux.dev, weixugc@google.com, yuzhao@google.com
Subject: Re: [PATCH] mm: vmscan : pgdemote vmstat is not getting updated when MGLRU is enabled.
Date: Sat, 11 Jan 2025 10:07:14 +0800	[thread overview]
Message-ID: <a96f3c1f-442c-c394-0ce9-73ae6386cff8@gmail.com> (raw)
In-Reply-To: <20250109060540.451261-1-donettom@linux.ibm.com>

> When MGLRU is enabled, the pgdemote_kswapd, pgdemote_direct, and
> pgdemote_khugepaged stats in vmstat are not being updated.
>
> 'Commit f77f0c751478 ("mm,memcg: provide per-cgroup counters for
> NUMA balancing operations")' moved the pgdemote vmstat update
> from demote_folio_list() to shrink_inactive_list(), which is in
> the normal LRU path. As a result, the pgdemote stats are updated
> correctly for the normal LRU but not for MGLRU.
>
> To address this, we have added the pgdemote stat update in the
> evict_folios() function, which is in the MGLRU path. With this
> patch, the pgdemote stats will now be updated correctly when MGLRU
> is enabled.
>
> Without this patch vmstat output when MGLRU is enabled
> ======================================================
> pgdemote_kswapd 0
> pgdemote_direct 0
> pgdemote_khugepaged 0
>
> With this patch vmstat output when MGLRU is enabled
> ===================================================
> pgdemote_kswapd 43234
> pgdemote_direct 4691
> pgdemote_khugepaged 0
>
> Fixes: f77f0c751478 ("mm,memcg: provide per-cgroup counters for NUMA balancing operations")
> Signed-off-by: Donet Tom <donettom@linux.ibm.com>


Great minds think alike, It's excatly same with mine[0] :)

There is another bug[1] as well.
[0] 
https://lore.kernel.org/linux-mm/20250110122133.423481-2-lizhijian@fujitsu.com/ 
[1] 
https://lore.kernel.org/linux-mm/20250110122133.423481-1-lizhijian@fujitsu.com/ 

Feel free to add vvv if your patch is accepted at last.
Tested-by: Li Zhijian <lizhijian@fujitsu.com> Reviewed-by: Li Zhijian 
<lizhijian@fujitsu.com>


> ---
>   mm/vmscan.c  <https://lore.kernel.org/lkml/20250109060540.451261-1-donettom@linux.ibm.com/#Z31mm:vmscan.c>  | 3 +++
>   1 filechanged  <https://lore.kernel.org/lkml/20250109060540.451261-1-donettom@linux.ibm.com/#related>, 3 insertions(+)
>
> diff 
> <https://lore.kernel.org/lkml/20250109060540.451261-1-donettom@linux.ibm.com/#iZ31mm:vmscan.c> 
> --git a/mm/vmscan.c b/mm/vmscan.c index 9a859b7d18d7..b1ec5ece067e 
> 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4642,6 +4642,9 @@ 
> static int evict_folios(struct lruvec *lruvec, struct scan_control 
> *sc, int swap   		reset_batch_size(walk);
>   	}
>   
> + __mod_lruvec_state(lruvec, PGDEMOTE_KSWAPD + reclaimer_offset(), + 
> stat.nr_demoted); +   	item = PGSTEAL_KSWAPD + reclaimer_offset();
>   	if (!cgroup_reclaim(sc))
>   		__count_vm_events(item, reclaimed);
> -- 



  parent reply	other threads:[~2025-01-11  2:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-09  6:05 Donet Tom
2025-01-09  6:46 ` Yu Zhao
2025-01-11  2:07 ` Li Zhijian [this message]
2025-01-11  2:10 ` Li Zhijian

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=a96f3c1f-442c-c394-0ce9-73ae6386cff8@gmail.com \
    --to=zhijianli88.lz@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@kernel.org \
    --cc=donettom@linux.ibm.com \
    --cc=hannes@cmpxchg.org \
    --cc=kaiyang2@cs.cmu.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=rientjes@google.com \
    --cc=ritesh.list@gmail.com \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    --cc=weixugc@google.com \
    --cc=yuzhao@google.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