lkml.org 
[lkml]   [2011]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH pm-freezer 1/4] cgroup_freezer: fix freezer->state setting bug in freezer_change_state()
Hello,

On Fri, Sep 02, 2011 at 06:58:39PM +0200, Oleg Nesterov wrote:
> > This still doesn't look quite right. If the cgroup is FREEZING it should
> > also call try_to_freeze_cgroup(). I think this is what's needed:
> >
> > if (freezer->state == CGROUP_THAWED)
> > atomic_inc(&system_freezing_cnt);
> > freezer->state = CGROUP_FREEZING;
> > retval = try_to_freeze_cgroup(cgroup, freezer);
>
> This is what I mentioned before, to me this looks like a win.
>
> Why do we need try_to_freeze_cgroup() in this case? "for safety"
> could actually mean "hide the bug" ;)

I guess it depends on the viewpoint. A simple analogy would be using
WARN_ON_ONCE() instead of BUG_ON() so that the mode of failure is
softer. This change isn't likely to make bugs significantly more
difficult to discover so why not?

> But I agree either way. Rafael, I think 1-4 are fine, but I think
> we need the simple 5/4, will send in a minute...

Can you please wait a bit? The second one was broken (missing unlock)
and I made some small adjustments. Will repost soon.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2011-09-02 19:11    [W:0.313 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site