Skip to contentSkip to conversation

mm-memcontrol-convert-objcg-to-be-per-memcg-per-node-type.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: convert objcg to be per-memcg per-node type
has been removed from the -mm tree. Its filename was
mm-memcontrol-convert-objcg-to-be-per-memcg-per-node-type.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: convert objcg to be per-memcg per-node type
Date: Thu, 5 Mar 2026 19:52:49 +0800

Convert objcg to be per-memcg per-node type, so that when reparent LRU folios later, we can hold the lru lock at the node level, thus avoiding holding too many lru locks at once.

[[email protected]: reset pn->orig_objcg to NULL]
[[email protected]: fix comment typo, per Usama. Reflow comment to 80 cols]
[[email protected]: fix obj_cgroup leak in mem_cgroup_css_online() error path]
[[email protected]: add newline, per Qi Zheng]
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 Yosry Ahmed <[email protected]>
Cc Yuanchu Xie <[email protected]>
Cc Zi Yan <[email protected]>
Cc Usama Arif <[email protected]>

---

 include/linux/memcontrol.h |   23 ++++----
 include/linux/sched.h      |    2 
 mm/memcontrol.c            |   92 +++++++++++++++++++++++------------
 3 files changed, 75 insertions(+), 42 deletions(-)
include/linux/memcontrol.h renamed from include/linux/memcontrol.h~mm-memcontrol-convert-objcg-to-be-per-memcg-per-node-type +12 -11
@@ -115,6 +115,16 @@ struct mem_cgroup_per_node {
 	unsigned long		lru_zone_size[MAX_NR_ZONES][NR_LRU_LISTS];
 	struct mem_cgroup_reclaim_iter	iter;
 
+	/*
+	 * objcg is wiped out as a part of the objcg repaprenting process.
+	 * orig_objcg preserves a pointer (and a reference) to the original
+	 * objcg until the end of live of memcg.
+	 */
+	struct obj_cgroup __rcu	*objcg;
+	struct obj_cgroup	*orig_objcg;
+	/* list of inherited objcgs, protected by objcg_lock */
+	struct list_head objcg_list;
+
 #ifdef CONFIG_MEMCG_NMI_SAFETY_REQUIRES_ATOMIC
 	/* slab stats for nmi context */
 	atomic_t		slab_reclaimable;
@@ -179,6 +189,7 @@ struct obj_cgroup {
 		struct list_head list; /* protected by objcg_lock */
 		struct rcu_head rcu;
 	};
+	bool is_root;
 };
 
 /*
@@ -257,15 +268,6 @@ struct mem_cgroup {
 	seqlock_t		socket_pressure_seqlock;
 #endif
 	int kmemcg_id;
-	/*
-	 * memcg->objcg is wiped out as a part of the objcg repaprenting
-	 * process. memcg->orig_objcg preserves a pointer (and a reference)
-	 * to the original objcg until the end of live of memcg.
-	 */
-	struct obj_cgroup __rcu	*objcg;
-	struct obj_cgroup	*orig_objcg;
-	/* list of inherited objcgs, protected by objcg_lock */
-	struct list_head objcg_list;
 
 	struct memcg_vmstats_percpu __percpu *vmstats_percpu;
 
@@ -332,7 +334,6 @@ struct mem_cgroup {
 #define MEMCG_CHARGE_BATCH 64U
 
 extern struct mem_cgroup *root_mem_cgroup;
-extern struct obj_cgroup *root_obj_cgroup;
 
 enum page_memcg_data_flags {
 	/* page->memcg_data is a pointer to an slabobj_ext vector */
@@ -551,7 +552,7 @@ static inline bool mem_cgroup_is_root(st
 
 static inline bool obj_cgroup_is_root(const struct obj_cgroup *objcg)
 {
-	return objcg == root_obj_cgroup;
+	return objcg->is_root;
 }
 
 static inline bool mem_cgroup_disabled(void)
include/linux/sched.h renamed from include/linux/sched.h~mm-memcontrol-convert-objcg-to-be-per-memcg-per-node-type +1 -1
@@ -1533,7 +1533,7 @@ struct task_struct {
 	/* Used by memcontrol for targeted memcg charge: */
 	struct mem_cgroup		*active_memcg;
 
-	/* Cache for current->cgroups->memcg->objcg lookups: */
+	/* Cache for current->cgroups->memcg->nodeinfo[nid]->objcg lookups: */
 	struct obj_cgroup		*objcg;
 #endif
 
mm/memcontrol.c renamed from mm/memcontrol.c~mm-memcontrol-convert-objcg-to-be-per-memcg-per-node-type +62 -30

195 lines not on this page · raw message

_

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