Re: [PATCH 14/16] freezer: make freezing() test freeze conditionsin effect instead of TIF_FREEZE

From: Oleg Nesterov
Date: Mon Aug 29 2011 - 12:34:20 EST


On 08/29, Oleg Nesterov wrote:
>
> I'm afraid I wasn't clear....
>
> On 08/29, Oleg Nesterov wrote:
> >
> > On 08/19, Tejun Heo wrote:
> > >
> > > @@ -311,9 +315,11 @@ static int freezer_change_state(struct cgroup *cgroup,
> > >
> > > switch (goal_state) {
> > > case CGROUP_THAWED:
> > > + atomic_dec(&system_freezing_cnt);
> > > unfreeze_cgroup(cgroup, freezer);
> > > break;
> > > case CGROUP_FROZEN:
> > > + atomic_inc(&system_freezing_cnt);
> >
> > This is harmless, but afaics is not exactly right. CGROUP_FROZEN doesn't
> > need system_freezing_cnt != 0, everything is already frozen and we just
> > provoke freezing_slow_path() without any reason. Right?
>
> Of course, this atomic_inc() is right, we are going to call
> try_to_freeze_cgroup(). But probably it makes sense to do atomic_dec()
> when freezer->state becomes CGROUP_FROZEN.

Damn, I was wrong again.

No, we can't do this. __refrigerator() should handle the spurious
wakeups correctly, it checks checks freezing() in the main loop.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/