[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F7427E4.2020307@parallels.com>
Date: Thu, 29 Mar 2012 11:14:12 +0200
From: Glauber Costa <glommer@...allels.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
CC: <netdev@...r.kernel.org>, David Miller <davem@...emloft.net>,
"Andrew Morton" <akpm@...ux-foundation.org>
Subject: Re: [PATCH 1/3] [BUGFIX] memcg/tcp : fix to see use_hierarchy in
tcp memcontrol cgroup
On 03/29/2012 09:03 AM, KAMEZAWA Hiroyuki wrote:
>
> Now, tcp memory control cgroup ignores memcg's use_hierarchy value
> and act as use_hierarchy=1 always. After this patch, tcp memcontrol will
> work as memcg is designed.
>
> Note:
> I know there is a discussion to remove use_hierarchy but this is BUG, now.
>
Kame,
Are you sure about that?
I just tried it myself, and it seems to work:
root@...5072-11:~/glommer-temporary/a/b# cat memory.kmem.tcp.usage_in_bytes
724992
root@...5072-11:~/glommer-temporary/a/b# cat
../memory.kmem.tcp.usage_in_bytes
0
Did you got this conclusion through testing or code inspection?
As a matter of fact, that's why I believe the current behavior is indeed
correct:
the res_counter is initialized as:
parent_cg = tcp_prot.proto_cgroup(parent);
if (parent_cg)
res_parent = parent_cg->memory_allocated;
res_counter_init(&tcp->tcp_memory_allocated, res_parent);
now, parent is drawn from parent_mem_cgroup(), that reads as follows:
struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg)
{
if (!memcg->res.parent)
return NULL;
return mem_cgroup_from_res_counter(memcg->res.parent, res);
}
so if we have use_hierarchy = 0, res.parent should be NULL (because that
is the way we initialize it)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists