lkml.org 
[lkml]   [2022]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm/memcontrol: Skip root memcg in memcg_memory_event_mm
Date
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
\
 
 \ /
  Last update: 2022-12-15 10:20    [W:0.057 / U:3.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site