All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Michal Hocko <mhocko@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Li Zefan <lizefan@huawei.com>, Hugh Dickins <hughd@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: 3.13-rc breaks MEMCG_SWAP
Date: Mon, 16 Dec 2013 12:19:41 -0500	[thread overview]
Message-ID: <20131216171941.GI32509@htj.dyndns.org> (raw)
In-Reply-To: <20131216171527.GF26797@dhcp22.suse.cz>

Hello, Michal, Johannes.

On Mon, Dec 16, 2013 at 06:15:27PM +0100, Michal Hocko wrote:
> > We already do that, swap records hold a css reference.  We do the put
> > in mem_cgroup_uncharge_swap().
> 
> Dohh! You are right I have totally missed that the css_get is burried in
> __mem_cgroup_uncharge_common and the counterpart is in mem_cgroup_uncharge_swap
> (which is less unexpected).
> 
> > It really strikes me as odd that we recycle the cgroup ID while there
> > are still references to the cgroup in circulation.
> 
> That is true but even with this fixed I still think that the Hugh's
> approach makes a lot of sense.

I thought about this a bit and I think the id really should be per
subsystem - ie. like css_id but just a dumb id as cgrp->id.  The
reason is that cgroup's lifetime and css's lifetime will soon be
decoupled.  ie. if a css is disabled and re-enabled on the same
cgroup, there can be two css's associated with a single cgroup.
cgroup_css() and css iterators should block accesses to css's which
are being drained but it does make sense for id lookup to work until
the css is actually released.

That said, for now, whatever works is fine and if Hugh's suggested
change is desirable anyway, that should do for now.

Thanks.

-- 
tejun

WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj@kernel.org>
To: Michal Hocko <mhocko@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Li Zefan <lizefan@huawei.com>, Hugh Dickins <hughd@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: 3.13-rc breaks MEMCG_SWAP
Date: Mon, 16 Dec 2013 12:19:41 -0500	[thread overview]
Message-ID: <20131216171941.GI32509@htj.dyndns.org> (raw)
In-Reply-To: <20131216171527.GF26797@dhcp22.suse.cz>

Hello, Michal, Johannes.

On Mon, Dec 16, 2013 at 06:15:27PM +0100, Michal Hocko wrote:
> > We already do that, swap records hold a css reference.  We do the put
> > in mem_cgroup_uncharge_swap().
> 
> Dohh! You are right I have totally missed that the css_get is burried in
> __mem_cgroup_uncharge_common and the counterpart is in mem_cgroup_uncharge_swap
> (which is less unexpected).
> 
> > It really strikes me as odd that we recycle the cgroup ID while there
> > are still references to the cgroup in circulation.
> 
> That is true but even with this fixed I still think that the Hugh's
> approach makes a lot of sense.

I thought about this a bit and I think the id really should be per
subsystem - ie. like css_id but just a dumb id as cgrp->id.  The
reason is that cgroup's lifetime and css's lifetime will soon be
decoupled.  ie. if a css is disabled and re-enabled on the same
cgroup, there can be two css's associated with a single cgroup.
cgroup_css() and css iterators should block accesses to css's which
are being drained but it does make sense for id lookup to work until
the css is actually released.

That said, for now, whatever works is fine and if Hugh's suggested
change is desirable anyway, that should do for now.

Thanks.

-- 
tejun

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2013-12-16 17:19 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16  8:36 3.13-rc breaks MEMCG_SWAP Hugh Dickins
2013-12-16  8:36 ` Hugh Dickins
2013-12-16  9:36 ` Li Zefan
2013-12-16  9:36   ` Li Zefan
2013-12-16  9:53   ` Michal Hocko
2013-12-16  9:53     ` Michal Hocko
2013-12-16 10:40     ` Michal Hocko
2013-12-16 10:40       ` Michal Hocko
2013-12-16 16:35       ` Tejun Heo
2013-12-16 16:35         ` Tejun Heo
2013-12-16 17:19         ` Michal Hocko
2013-12-16 17:19           ` Michal Hocko
2013-12-16 17:21           ` Tejun Heo
2013-12-16 17:21             ` Tejun Heo
2013-12-17  1:41             ` Hugh Dickins
2013-12-17  1:41               ` Hugh Dickins
2013-12-17  3:13               ` Li Zefan
2013-12-17  3:13                 ` Li Zefan
2013-12-17  7:09                 ` Hugh Dickins
2013-12-17  7:09                   ` Hugh Dickins
2013-12-17 13:11                   ` Michal Hocko
2013-12-17 13:11                     ` Michal Hocko
2013-12-17 13:14                     ` Tejun Heo
2013-12-17 13:14                       ` Tejun Heo
2013-12-17 12:29                 ` Tejun Heo
2013-12-17 12:29                   ` Tejun Heo
2013-12-17 13:12                   ` Michal Hocko
2013-12-17 13:12                     ` Michal Hocko
2013-12-17 13:12                     ` Michal Hocko
2013-12-17 12:48                 ` Michal Hocko
2013-12-17 12:48                   ` Michal Hocko
2013-12-17 13:05                 ` Michal Hocko
2013-12-17 13:05                   ` Michal Hocko
2013-12-17 13:15                 ` [PATCH cgroup/for-3.13-fixes] cgroup: don't recycle cgroup id until all csses' have been destroyed Tejun Heo
2013-12-17 13:15                   ` Tejun Heo
2013-12-17 13:15                   ` Tejun Heo
2013-12-17 13:14               ` 3.13-rc breaks MEMCG_SWAP Michal Hocko
2013-12-17 13:14                 ` Michal Hocko
2013-12-16 16:41       ` Johannes Weiner
2013-12-16 16:41         ` Johannes Weiner
2013-12-16 17:15         ` Michal Hocko
2013-12-16 17:15           ` Michal Hocko
2013-12-16 17:15           ` Michal Hocko
2013-12-16 17:19           ` Tejun Heo [this message]
2013-12-16 17:19             ` Tejun Heo
2013-12-16  9:49 ` Michal Hocko
2013-12-16  9:49   ` Michal Hocko
2013-12-16 16:20 ` Michal Hocko
2013-12-16 16:20   ` Michal Hocko
2013-12-17  2:26   ` Hugh Dickins
2013-12-17  2:26     ` Hugh Dickins
2013-12-17 10:25     ` Michal Hocko
2013-12-17 10:25       ` Michal Hocko
2013-12-17 10:25       ` Michal Hocko

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=20131216171941.GI32509@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lizefan@huawei.com \
    --cc=mhocko@suse.cz \
    /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.