All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/memcontrol: Skip root memcg in memcg_memory_event_mm
@ 2022-12-15  9:19 Haifeng Xu
  2022-12-15 18:18 ` Shakeel Butt
  0 siblings, 1 reply; 9+ messages in thread
From: Haifeng Xu @ 2022-12-15  9:19 UTC (permalink / raw)
  To: akpm
  Cc: shakeelb, roman.gushchin, songmuchun, hannes, vbabka, willy,
	vasily.averin, linux-kernel, Haifeng Xu

The memory events aren't supported on root cgroup, so there is no need
to account MEMCG_OOM_KILL on root memcg.

Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
---
 include/linux/memcontrol.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 567f12323f55..09f75161a3bc 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -1142,7 +1142,7 @@ static inline void memcg_memory_event_mm(struct mm_struct *mm,
 
 	rcu_read_lock();
 	memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
-	if (likely(memcg))
+	if (likely(memcg && !mem_cgroup_is_root(memcg)))
 		memcg_memory_event(memcg, event);
 	rcu_read_unlock();
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-12-16  8:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-15  9:19 [PATCH] mm/memcontrol: Skip root memcg in memcg_memory_event_mm Haifeng Xu
2022-12-15 18:18 ` Shakeel Butt
2022-12-16  1:43   ` Haifeng Xu
2022-12-16  6:42     ` Shakeel Butt
2022-12-16  7:28       ` Haifeng Xu
2022-12-16  7:36         ` Shakeel Butt
2022-12-16  7:50           ` Haifeng Xu
2022-12-16  8:17             ` Shakeel Butt
2022-12-16  8:37               ` Haifeng Xu

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.