* [merged mm-stable] mm-workingset-use-lruvec_page_state_local-to-count-lru-pages.patch removed from -mm tree
@ 2026-10-09 5:57 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-10-09 5:57 UTC (permalink / raw)
To: mm-commits, yuanchu, weixugc, stable, shakeel.butt,
roman.gushchin, muchun.song, mhocko, ljs, kasong, hannes, david,
baohua, axelrasmussen, zhuhui, akpm
The quilt patch titled
Subject: mm: workingset: use lruvec_page_state_local() to count lru pages
has been removed from the -mm tree. Its filename was
mm-workingset-use-lruvec_page_state_local-to-count-lru-pages.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Hui Zhu <zhuhui@kylinos.cn>
Subject: mm: workingset: use lruvec_page_state_local() to count lru pages
Date: Fri, 11 Sep 2026 16:00:49 +0800
Commit 7404bd37cfbe ("mm: workingset: use lruvec_lru_size() to get the
number of lru pages") switched count_shadow_nodes() to lruvec_lru_size().
With CONFIG_MEMCG enabled, lruvec_lru_size() reads mz->lru_zone_size,
which only the classic LRU paths maintain. MGLRU accounts its pages
through __update_lru_size(), which skips that array, so with MGLRU on the
four evictable LRU lists are always seen as empty. The shadow node budget
(pages >> 3) then collapses to slab plus unevictable pages, and the
workingset shadow shrinker reclaims eviction tokens almost as fast as they
are created, losing thrashing protection.
lruvec_page_state_local() reads lruvec_stats->state_local instead, which
both classic LRU and MGLRU maintain. Switch back to it. The reparenting
race this re-exposes on cgroup v2 is closed by the preceding patch that
redirects dying-memcg stat updates for all hierarchies.
Link: https://lore.kernel.org/2ed42f96aca124856ea30f774afb55cbe6d8ba58.1789096175.git.zhuhui@kylinos.cn
Fixes: 7404bd37cfbe ("mm: workingset: use lruvec_lru_size() to get the number of lru pages")
Signed-off-by: Hui Zhu <zhuhui@kylinos.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Reviewed-by: Barry Song <baohua@kernel.org>
Reviewed-by: Kairui Song <kasong@tencent.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Wei Xu <weixugc@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Cc: <stable@vger.kernel.org>
---
mm/workingset.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
--- a/mm/workingset.c~mm-workingset-use-lruvec_page_state_local-to-count-lru-pages
+++ a/mm/workingset.c
@@ -688,10 +688,9 @@ static unsigned long count_shadow_nodes(
mem_cgroup_flush_stats_ratelimited(sc->memcg);
lruvec = mem_cgroup_lruvec(sc->memcg, NODE_DATA(sc->nid));
-
for (pages = 0, i = 0; i < NR_LRU_LISTS; i++)
- pages += lruvec_lru_size(lruvec, i, MAX_NR_ZONES - 1);
-
+ pages += lruvec_page_state_local(lruvec,
+ NR_LRU_BASE + i);
pages += lruvec_page_state_local(
lruvec, NR_SLAB_RECLAIMABLE_B) >> PAGE_SHIFT;
pages += lruvec_page_state_local(
_
Patches currently in -mm which might be from zhuhui@kylinos.cn are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-09 5:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-09 5:57 [merged mm-stable] mm-workingset-use-lruvec_page_state_local-to-count-lru-pages.patch removed from -mm tree Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.