linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Michal Hocko <mhocko@suse.cz>
Cc: linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org, Li Zefan <lizefan@huawei.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Balbir Singh <bsingharora@gmail.com>
Subject: Re: [PATCH 4/6] cgroups: forbid pre_destroy callback to fail
Date: Wed, 24 Oct 2012 12:25:35 -0700	[thread overview]
Message-ID: <20121024192535.GG12182@atj.dyndns.org> (raw)
In-Reply-To: <20121022103021.GA6367@dhcp22.suse.cz>

Hello, Michal.

On Mon, Oct 22, 2012 at 12:30:21PM +0200, Michal Hocko wrote:
> > > We can still fail inn #3 without this patch becasuse there are is no
> > > guarantee that a new task is attached to the group. And I wanted to keep
> > > memcg and generic cgroup parts separated.
> > 
> > Yes, but all other controllers are broken that way too
> 
> It's just hugetlb and memcg that have pre_destroy.
> 
> > and the worst thing which will hapen is triggering WARN_ON_ONCE().
> 
> The patch does BUG_ON(ss->pre_destroy(cgrp)). I am not sure WARN_ON_ONCE is
> appropriate here because we would like to have it at least per
> controller warning. I do not see any reason why to make this more
> complicated but I am open to suggestions.

Once it's dropped from memcg, the next patch can update cgroup core
accordingly and the bug will exist for a single commit and the failure
mode would be triggering of WARN_ON_ONCE().  Seems pretty simple to
me.

> > Let's note the failure in the commit and remove
> > DEPREDATED_clear_css_refs in the previous patch.  Then, I can pull
> > from you, clean up pre_destroy mess and then you can pull back for
> > further cleanups.
> 
> Well this will get complicated as there are dependencies between memcg
> parts (based on Andrew's tree) and your tree. My tree is not pullable as
> all the patches go via Andrew. I am not sure how to get out of this.
> There is only one cgroup patch so what about pushing all of this via
> Andrew and do the follow up cleanups once they get merged? We are not in
> hurry, are we?

Let's create a cgroup branch and build things there.  I don't think
cgroup changes are gonna be a single patch and expect to see at least
some bug fixes afterwards and don't wanna keep them floating separate
from other cgroup changes.  mm being based on top of -next, that
should work, right?

> Anyway does it really make sense to drop DEPREDATED_clear_css_refs
> already in the previous patch when it is _not_ guaranteed that
> pre_destroy succeeds?

It makes things simpler here by decoupling memcg change with core
cgroup changes and the introduced bug isn't too easy to trigger and
even when triggered the failure mode isn't critical.  It's not gonna
break normal common operations or bisection.  As long as the issue is
clearly documented, I think it should be fine.  Just note that this
opens up a race window from deficient cgroup API and the following
commits will address it.

Thanks.

--
tejun

  reply	other threads:[~2012-10-24 19:25 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-17 13:30 [RFC] memcg/cgroup: do not fail fail on pre_destroy callbacks Michal Hocko
2012-10-17 13:30 ` [PATCH 1/6] memcg: split mem_cgroup_force_empty into reclaiming and reparenting parts Michal Hocko
2012-10-18 21:56   ` Tejun Heo
2012-10-17 13:30 ` [PATCH 2/6] memcg: root_cgroup cannot reach mem_cgroup_move_parent Michal Hocko
2012-10-18 21:58   ` Tejun Heo
2012-10-17 13:30 ` [PATCH 3/6] memcg: Simplify mem_cgroup_force_empty_list error handling Michal Hocko
2012-10-18 22:16   ` Tejun Heo
2012-10-19 13:24     ` Michal Hocko
2012-10-19 19:49       ` Tejun Heo
2012-10-17 13:30 ` [PATCH 4/6] cgroups: forbid pre_destroy callback to fail Michal Hocko
2012-10-18 22:41   ` Tejun Heo
2012-10-18 22:46     ` Tejun Heo
2012-10-19 13:34       ` Michal Hocko
2012-10-19 13:32     ` Michal Hocko
2012-10-19 20:24       ` Tejun Heo
2012-10-22 10:30         ` Michal Hocko
2012-10-24 19:25           ` Tejun Heo [this message]
2012-10-25 14:37             ` Michal Hocko
2012-10-25 17:42               ` Tejun Heo
2012-10-25 18:48                 ` Michal Hocko
2012-10-19  9:33   ` Li Zefan
2012-10-19 11:09     ` Michal Hocko
2012-10-19 20:17     ` Tejun Heo
2012-10-17 13:30 ` [PATCH 5/6] memcg: make mem_cgroup_reparent_charges non failing Michal Hocko
2012-10-18  8:30   ` Li Zefan
2012-10-18  8:42     ` Michal Hocko
2012-10-18 22:48   ` Tejun Heo
2012-10-19 13:49   ` Michal Hocko
2012-10-17 13:30 ` [PATCH 6/6] hugetlb: do not fail in hugetlb_cgroup_pre_destroy Michal Hocko
2012-10-18 22:48   ` Tejun Heo
2012-10-17 15:30 ` [RFC] memcg/cgroup: do not fail fail on pre_destroy callbacks Glauber Costa
2012-10-18  0:29 ` Kamezawa Hiroyuki

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=20121024192535.GG12182@atj.dyndns.org \
    --to=tj@kernel.org \
    --cc=bsingharora@gmail.com \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --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 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).