OpenVZ Forum


Home » Mailing lists » Devel » [RFC 0/4] bypass charges if memcg is not used
[RFC 4/4] memcg: do not walk all the way to the root for memcg [message #48024 is a reply to message #48022] Tue, 25 September 2012 08:52 Go to previous messageGo to previous message
Glauber Costa is currently offline  Glauber Costa
Messages: 916
Registered: October 2011
Senior Member
Since the root is special anyway, and we always get its figures from
global counters anyway, there is no make all cgroups its descendants,
wrt res_counters. The sad effect of doing that is that we need to lock
the root for all allocations, since it is a common ancestor of
everybody.

Not having the root as a common ancestor should lead to better
scalability for not-uncommon case of tasks in the cgroup being
node-bound to different nodes in NUMA systems.

Signed-off-by: Glauber Costa <glommer@parallels.com>
CC: Michal Hocko <mhocko@suse.cz>
CC: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
CC: Johannes Weiner <hannes@cmpxchg.org>
CC: Mel Gorman <mgorman@suse.de>
CC: Andrew Morton <akpm@linux-foundation.org>
---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index f8115f0..829ea9e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5720,7 +5720,7 @@ mem_cgroup_create(struct cgroup *cont)
static_key_slow_inc(&memcg_in_use_key);
}

- if (parent && parent->use_hierarchy) {
+ if (parent && !mem_cgroup_is_root(parent) && parent->use_hierarchy) {
struct mem_cgroup __maybe_unused *p;

res_counter_init(&memcg->res, &parent->res);
--
1.7.11.4
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH v3 02/13] memcg: Reclaim when more than one page needed.
Next Topic: [PATCH 0/5] nfs: few cleanup patches inspired by sparse
Goto Forum:
  


Current Time: Mon Jul 22 22:21:35 GMT 2024

Total time taken to generate the page: 0.02375 seconds