All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glauber Costa <glommer@parallels.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: <netdev@vger.kernel.org>, David Miller <davem@davemloft.net>,
	"Andrew Morton" <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/3] [BUGFIX] memcg/tcp : fix to see use_hierarchy in tcp memcontrol cgroup
Date: Thu, 29 Mar 2012 11:14:12 +0200	[thread overview]
Message-ID: <4F7427E4.2020307@parallels.com> (raw)
In-Reply-To: <4F74095B.70105@jp.fujitsu.com>

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@inf5072-11:~/glommer-temporary/a/b# cat memory.kmem.tcp.usage_in_bytes
724992
root@inf5072-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)

  reply	other threads:[~2012-03-29  9:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29  7:01 [BUGFIX][PATCH 0/3] memcg: tcp memcontrol fixes KAMEZAWA Hiroyuki
2012-03-29  7:03 ` [PATCH 1/3] [BUGFIX] memcg/tcp : fix to see use_hierarchy in tcp memcontrol cgroup KAMEZAWA Hiroyuki
2012-03-29  9:14   ` Glauber Costa [this message]
2012-03-29  9:16     ` KAMEZAWA Hiroyuki
2012-03-29  7:07 ` [BUGFIX][PATCH 2/3] memcg/tcp: remove static_branch_slow_dec() at changing limit KAMEZAWA Hiroyuki
2012-03-29 10:58   ` Glauber Costa
2012-03-29 23:51     ` KAMEZAWA Hiroyuki
2012-03-30  6:18       ` Glauber Costa
2012-03-29  7:10 ` [BUGFIX][PATCH 3/3] memcg/tcp: ignore tcp usage before accounting started KAMEZAWA Hiroyuki
2012-03-29  9:21   ` Glauber Costa
2012-03-30  1:44     ` [PATCH] memcg/tcp: fix warning caused b res->usage go to negative KAMEZAWA Hiroyuki
2012-04-06 15:49       ` Glauber Costa
2012-04-10  2:37         ` KAMEZAWA Hiroyuki
2012-04-10  2:51           ` Glauber Costa
2012-04-10  3:01             ` Glauber Costa
2012-04-10  4:15               ` KAMEZAWA Hiroyuki
2012-04-11  2:22                 ` Glauber Costa
2012-04-10  3:21             ` KAMEZAWA Hiroyuki
2012-04-13 17:33           ` Glauber Costa
2012-04-18  8:02             ` KAMEZAWA Hiroyuki
2012-04-18 16:32               ` Glauber Costa
2012-04-02  3:41     ` [BUGFIX][PATCH 3/3] memcg/tcp: ignore tcp usage before accounting started David Miller
2012-04-03 22:31       ` Glauber Costa
2012-04-09  0:58         ` KAMEZAWA Hiroyuki
2012-04-09  1:44           ` Glauber Costa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F7427E4.2020307@parallels.com \
    --to=glommer@parallels.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.