From: Matt Helsley <matthltc@us.ibm.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Matt Helsley <matthltc@us.ibm.com>, Tejun Heo <tj@kernel.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Paul Menage <paul@paulmenage.org>,
containers@lists.linux-foundation.org,
linux-pm@lists.linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH pm-freezer 1/4] cgroup_freezer: fix freezer->state setting bug in freezer_change_state()
Date: Fri, 2 Sep 2011 11:31:38 -0700 [thread overview]
Message-ID: <20110902183138.GA27179@count0.beaverton.ibm.com> (raw)
In-Reply-To: <20110902165839.GA7478@redhat.com>
On Fri, Sep 02, 2011 at 06:58:39PM +0200, Oleg Nesterov wrote:
> On 09/01, Matt Helsley wrote:
> >
> > On Wed, Aug 31, 2011 at 12:21:07PM +0200, Tejun Heo wrote:
> > > case CGROUP_FROZEN:
> > > - atomic_inc(&system_freezing_cnt);
> > > - retval = try_to_freeze_cgroup(cgroup, freezer);
> > > + if (freezer->state == CGROUP_THAWED) {
> > > + freezer->state = CGROUP_FREEZING;
> > > + atomic_inc(&system_freezing_cnt);
> > > + retval = try_to_freeze_cgroup(cgroup, freezer);
> >
> > 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" ;)
Well, I need to check Tejun's latest freezer bits to see if this is
still the case but it was possible to get to the FREEZING state and
not enter FROZEN before returning to userspace. So you could come back
into the state change function in the FREEZING state with FROZEN as
the goal state. Note that for the cgroup freezer the FREEZING state is
optional -- so skipping it is fine so long was we guarantee that by the
time we exit to userspace with a FROZEN state all the tasks in the cgroup
are actually frozen (in the refrigerator loop) or frozen enough (about to
enter the refrigerator loop without causing more IO -- e.g. stopped).
Cheers,
-Matt
next prev parent reply other threads:[~2011-09-02 18:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-31 10:21 Tejun Heo
2011-08-31 10:21 ` [PATCH pm-freezer 2/4] freezer: set PF_NOFREEZE on a dying task right before TASK_DEAD " Tejun Heo
2011-08-31 10:22 ` [PATCH pm-freezer 3/4] freezer: restructure __refrigerator() Tejun Heo
2011-08-31 10:22 ` [PATCH pm-freezer 4/4] freezer: use lock_task_sighand() in fake_signal_wake_up() Tejun Heo
2011-09-02 17:08 ` [PATCH pm-freezer 3/4] freezer: restructure __refrigerator() Oleg Nesterov
2011-08-31 18:08 ` [PATCH pm-freezer 1/4] cgroup_freezer: fix freezer->state setting bug in freezer_change_state() Oleg Nesterov
2011-09-02 0:42 ` Matt Helsley
2011-09-02 2:50 ` Tejun Heo
2011-09-02 16:58 ` Oleg Nesterov
2011-09-02 17:08 ` Tejun Heo
2011-09-02 17:15 ` Oleg Nesterov
2011-09-02 17:31 ` Tejun Heo
2011-09-02 17:30 ` Oleg Nesterov
2011-09-02 18:31 ` Matt Helsley [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-08-29 14:04 Tejun Heo
2011-08-29 16:00 ` Oleg Nesterov
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=20110902183138.GA27179@count0.beaverton.ibm.com \
--to=matthltc@us.ibm.com \
--cc=containers@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=oleg@redhat.com \
--cc=paul@paulmenage.org \
--cc=rjw@sisk.pl \
--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
all inboxes | Powered by JetHome®