linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.cz>
To: Hugh Dickins <hughd@google.com>
Cc: Li Zefan <lizefan@huawei.com>, Tejun Heo <tj@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	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: Tue, 17 Dec 2013 14:11:19 +0100	[thread overview]
Message-ID: <20131217131119.GD28991@dhcp22.suse.cz> (raw)
In-Reply-To: <alpine.LNX.2.00.1312162300410.16426@eggly.anvils>

On Mon 16-12-13 23:09:23, Hugh Dickins wrote:
> On Tue, 17 Dec 2013, Li Zefan wrote:
> > On 2013/12/17 9:41, Hugh Dickins wrote:
> > > On Mon, 16 Dec 2013, Tejun Heo wrote:
> > >> On Mon, Dec 16, 2013 at 06:19:37PM +0100, Michal Hocko wrote:
> > >>> I have to think about it some more (the brain is not working anymore
> > >>> today). But what we really need is that nobody gets the same id while
> > >>> the css is alive.
> > 
> > That's what I meant to do in my last reply.
> > 
> > But I'm confused by
> > 
> > "How would this work? .. the swap will be there
> > after the last reference to css as well."
> > 
> > >>> So css_from_id returning NULL doesn't seem to be
> > >>> enough.
> > >>
> > >> Oh, I meant whether it's necessary to keep css_from_id() working
> > >> (ie. doing successful lookups) between offline and release, because
> > >> that's where lifetimes are coupled.  IOW, if it's enough for cgroup to
> > >> not recycle the ID until all css's are released && fail css_from_id()
> > >> lookup after the css is offlined, I can make a five liner quick fix.
> > > 
> > > Don't take my word on it, I'm too fuzzy on this: but although it would
> > > be good to refrain from recycling the ID until all css's are released,
> > > I believe that it would not be good enough to fail css_from_id() once
> > > the css is offlined - mem_cgroup_uncharge_swap() needs to uncharge the
> > > hierarchy of the dead memcg (for example, when tmpfs file is removed).
> > > 
> > > Uncharging the dead memcg itself is presumably irrelevant, but it does
> > > need to locate the right parent to uncharge, and NULL css_from_id()
> > > would make that impossible.  It would be easy if we said those charges
> > > migrate to root rather than to parent, but that's inconsistent with
> > > what we have happily converged upon doing elsewhere (in the preferred
> > > use_hierarchy case), and it would be a change in behaviour.
> > > 
> > > I'm not nearly as enthusiastic for my patch as Michal is: I really
> > > would prefer a five-liner from you or from Zefan. 
> > 
> > I've come up with a fix. Though it's more than five-line, it mostly moves
> > a few lines from one place to another. I've tested it with your script.
> 
> It seems to be working very well for me.  I'm inclined to forgive you for
> taking more than five lines, given that there are almost as many -s as +s ;)
> 
> In my opinion, your patch is greatly preferable to mine - if there are
> good things in mine, memcg can incorporate them at leisure later on,
> but right now this seems a much better 3.13 solution.  I'm guessing
> Tejun and Hannes will feel the same way: how about you, Michal?

OK, let's go with this for now but I would like swap accounting less
tricky and confusing and explicit reparenting should help there I
believe.

And sorry for distracting you from the css based approach. I have
totally misinterpreted the comment above idr_remove.
-- 
Michal Hocko
SUSE Labs

--
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-17 13:11 UTC|newest]

Thread overview: 25+ 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  9:36 ` Li Zefan
2013-12-16  9:53   ` Michal Hocko
2013-12-16 10:40     ` Michal Hocko
2013-12-16 16:35       ` Tejun Heo
2013-12-16 17:19         ` Michal Hocko
2013-12-16 17:21           ` Tejun Heo
2013-12-17  1:41             ` Hugh Dickins
2013-12-17  3:13               ` Li Zefan
2013-12-17  7:09                 ` Hugh Dickins
2013-12-17 13:11                   ` Michal Hocko [this message]
2013-12-17 13:14                     ` Tejun Heo
2013-12-17 12:29                 ` Tejun Heo
2013-12-17 13:12                   ` Michal Hocko
2013-12-17 12:48                 ` 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:14               ` 3.13-rc breaks MEMCG_SWAP Michal Hocko
2013-12-16 16:41       ` Johannes Weiner
2013-12-16 17:15         ` Michal Hocko
2013-12-16 17:19           ` Tejun Heo
2013-12-16  9:49 ` Michal Hocko
2013-12-16 16:20 ` Michal Hocko
2013-12-17  2:26   ` Hugh Dickins
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=20131217131119.GD28991@dhcp22.suse.cz \
    --to=mhocko@suse.cz \
    --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=tj@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).