Skip to contentSkip to conversation

mm-workingset-use-lruvec_lru_size-to-get-the-number-of-lru-pages.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Apr 18

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: workingset: use lruvec_lru_size() to get the number of lru pages
has been removed from the -mm tree. Its filename was
mm-workingset-use-lruvec_lru_size-to-get-the-number-of-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: Qi Zheng <[email protected]>
Subject: mm: workingset: use lruvec_lru_size() to get the number of lru pages
Date: Thu, 5 Mar 2026 19:52:46 +0800

For cgroup v2, count_shadow_nodes() is the only place to read non-hierarchical stats (lruvec_stats->state_local). To avoid the need to consider cgroup v2 during subsequent non-hierarchical stats reparenting, use lruvec_lru_size() instead of lruvec_page_state_local() to get the number of lru pages.

For NR_SLAB_RECLAIMABLE_B and NR_SLAB_UNRECLAIMABLE_B cases, it appears that the statistics here have already been problematic for a while since slab pages have been reparented. So just ignore it for now.

Cc Allen Pais <[email protected]>
Cc Axel Rasmussen <[email protected]>
Cc Baoquan He <[email protected]>
Cc Chengming Zhou <[email protected]>
Cc Chen Ridong <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Hamza Mahfooz <[email protected]>
Cc Harry Yoo <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Imran Khan <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Kamalesh Babulal <[email protected]>
Cc Lance Yang <[email protected]>
Cc Liam Howlett <[email protected]>
Cc Lorenzo Stoakes (Oracle) <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Michal Koutný <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Muchun Song <[email protected]>
Cc Nhat Pham <[email protected]>
Cc Roman Gushchin <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Usama Arif <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Wei Xu <[email protected]>
Cc Yosry Ahmed <[email protected]>
Cc Yuanchu Xie <[email protected]>
Cc Zi Yan <[email protected]>

---

 include/linux/swap.h |    1 +
 mm/vmscan.c          |    3 +--
 mm/workingset.c      |    5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)
include/linux/swap.h renamed from include/linux/swap.h~mm-workingset-use-lruvec_lru_size-to-get-the-number-of-lru-pages +1 -0
@@ -352,6 +352,7 @@ extern void swap_setup(void);
 extern unsigned long zone_reclaimable_pages(struct zone *zone);
 extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
 					gfp_t gfp_mask, nodemask_t *mask);
+unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru, int zone_idx);
 
 #define MEMCG_RECLAIM_MAY_SWAP (1 << 1)
 #define MEMCG_RECLAIM_PROACTIVE (1 << 2)
mm/vmscan.c renamed from mm/vmscan.c~mm-workingset-use-lruvec_lru_size-to-get-the-number-of-lru-pages +1 -2
@@ -390,8 +390,7 @@ unsigned long zone_reclaimable_pages(str
  * @lru: lru to use
  * @zone_idx: zones to consider (use MAX_NR_ZONES - 1 for the whole LRU list)
  */
-static unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru,
-				     int zone_idx)
+unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru, int zone_idx)
 {
 	unsigned long size = 0;
 	int zid;
mm/workingset.c renamed from mm/workingset.c~mm-workingset-use-lruvec_lru_size-to-get-the-number-of-lru-pages +3 -2
@@ -691,9 +691,10 @@ 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_page_state_local(lruvec,
-							 NR_LRU_BASE + i);
+			pages += lruvec_lru_size(lruvec, i, MAX_NR_ZONES - 1);
+
 		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 [email protected] are