lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F742877.10402@jp.fujitsu.com>
Date:	Thu, 29 Mar 2012 18:16:39 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	Glauber Costa <glommer@...allels.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

(2012/03/29 18:14), Glauber Costa wrote:

> 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)
> 


Ah, sorry. you're right. please forget this patch.

To be honest, I wrote this after seeing WARN_ON in patch 2 and 3 and
misunderstood the code at writing patch 2 and 3.

Thanks,
-Kame


--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ