Skip to contentSkip to conversation

mm-memcontrol-refactor-mod_memcg_state-and-mod_memcg_lruvec_state.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: memcontrol: refactor mod_memcg_state() and mod_memcg_lruvec_state()
has been removed from the -mm tree. Its filename was
mm-memcontrol-refactor-mod_memcg_state-and-mod_memcg_lruvec_state.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: memcontrol: refactor mod_memcg_state() and mod_memcg_lruvec_state()
Date: Thu, 5 Mar 2026 19:52:47 +0800

Refactor the memcg_reparent_objcgs() to facilitate subsequent reparenting non-hierarchical stats.

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 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 Yuanchu Xie <[email protected]>
Cc Zi Yan <[email protected]>

---

 mm/memcontrol.c |   50 ++++++++++++++++++++++++++++------------------
 1 file changed, 31 insertions(+), 19 deletions(-)
mm/memcontrol.c renamed from mm/memcontrol.c~mm-memcontrol-refactor-mod_memcg_state-and-mod_memcg_lruvec_state +31 -19
@@ -717,21 +717,12 @@ static int memcg_state_val_in_pages(int
 		return max(val * unit / PAGE_SIZE, 1UL);
 }
 
-/**
- * mod_memcg_state - update cgroup memory statistics
- * @memcg: the memory cgroup
- * @idx: the stat item - can be enum memcg_stat_item or enum node_stat_item
- * @val: delta to add to the counter, can be negative
- */
-void mod_memcg_state(struct mem_cgroup *memcg, enum memcg_stat_item idx,
-		       int val)
+static void __mod_memcg_state(struct mem_cgroup *memcg,
+			      enum memcg_stat_item idx, int val)
 {
 	int i = memcg_stats_index(idx);
 	int cpu;
 
-	if (mem_cgroup_disabled())
-		return;
-
 	if (WARN_ONCE(BAD_STAT_IDX(i), "%s: missing stat item %d\n", __func__, idx))
 		return;
 
@@ -745,6 +736,21 @@ void mod_memcg_state(struct mem_cgroup *
 	put_cpu();
 }
 
+/**
+ * mod_memcg_state - update cgroup memory statistics
+ * @memcg: the memory cgroup
+ * @idx: the stat item - can be enum memcg_stat_item or enum node_stat_item
+ * @val: delta to add to the counter, can be negative
+ */
+void mod_memcg_state(struct mem_cgroup *memcg, enum memcg_stat_item idx,
+		       int val)
+{
+	if (mem_cgroup_disabled())
+		return;
+
+	__mod_memcg_state(memcg, idx, val);
+}
+
 #ifdef CONFIG_MEMCG_V1
 /* idx can be of type enum memcg_stat_item or node_stat_item. */
 unsigned long memcg_page_state_local(struct mem_cgroup *memcg, int idx)
@@ -764,21 +770,16 @@ unsigned long memcg_page_state_local(str
 }
 #endif
 
-static void mod_memcg_lruvec_state(struct lruvec *lruvec,
-				     enum node_stat_item idx,
-				     int val)
+static void __mod_memcg_lruvec_state(struct mem_cgroup_per_node *pn,
+				     enum node_stat_item idx, int val)
 {
-	struct mem_cgroup_per_node *pn;
-	struct mem_cgroup *memcg;
+	struct mem_cgroup *memcg = pn->memcg;
 	int i = memcg_stats_index(idx);
 	int cpu;
 
 	if (WARN_ONCE(BAD_STAT_IDX(i), "%s: missing stat item %d\n", __func__, idx))
 		return;
 
-	pn = container_of(lruvec, struct mem_cgroup_per_node, lruvec);
-	memcg = pn->memcg;
-
 	cpu = get_cpu();
 
 	/* Update memcg */
@@ -794,6 +795,17 @@ static void mod_memcg_lruvec_state(struc
 	put_cpu();
 }
 
+static void mod_memcg_lruvec_state(struct lruvec *lruvec,
+				     enum node_stat_item idx,
+				     int val)
+{
+	struct mem_cgroup_per_node *pn;
+
+	pn = container_of(lruvec, struct mem_cgroup_per_node, lruvec);
+
+	__mod_memcg_lruvec_state(pn, idx, val);
+}
+
 /**
  * mod_lruvec_state - update lruvec memory statistics
  * @lruvec: the lruvec

_

Patches currently in -mm which might be from [email protected] are