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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAOUHufZ3B5FyfqwgB04gys_5yhatzcE_hFh-sedzFUpQFVA+Nw@mail.gmail.com>
Date: Wed, 15 Jan 2025 14:51:41 -0700
From: Yu Zhao <yuzhao@...gle.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, Kaiyang Zhao <kaiyang2@...cmu.edu>, linux-kernel@...r.kernel.org, 
	Li Zhijian <lizhijian@...itsu.com>
Subject: Re: [PATCH 2/2] mm/vmscan: Fix pgdemote_* accounting with lru_gen_enabled

On Fri, Jan 10, 2025 at 5:20 AM Li Zhijian <lizhijian@...itsu.com> wrote:
>
> Commit f77f0c751478 ("mm,memcg: provide per-cgroup counters for NUMA balancing operations")
> moved the accounting of PGDEMOTE_* statistics to shrink_inactive_list().
> However, shrink_inactive_list() is not called when lrugen_enabled is true,
> leading to incorrect demotion statistics despite actual demotion events
> occurring.
>
> Add the PGDEMOTE_* accounting in evict_folios(), ensuring that demotion
> statistics are correctly updated regardless of the lru_gen_enabled state.
> This fix is crucial for systems that rely on accurate NUMA balancing
> metrics for performance tuning and resource management.
>
> Fixes: f77f0c751478 ("mm,memcg: provide per-cgroup counters for NUMA balancing operations")
> Signed-off-by: Li Zhijian <lizhijian@...itsu.com>
> ---
>  mm/vmscan.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index 430d580e37dd..f2d279de06c4 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -4642,6 +4642,8 @@ 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);

The mm-hotfixes-stable already has the same fix from Donet:
https://lore.kernel.org/linux-mm/20250109060540.451261-1-donettom@linux.ibm.com/

Andew, can you please drop this one from mm-unstable so that we won't
increment the counter twice?

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ