[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110829174440.GA12498@redhat.com>
Date: Mon, 29 Aug 2011 19:44:40 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Tejun Heo <tj@...nel.org>
Cc: rjw@...k.pl, menage@...gle.com, linux-kernel@...r.kernel.org,
arnd@...db.de
Subject: Re: [PATCH 09/16] freezer: make freezing indicate freeze condition
in effect
On 08/28, Oleg Nesterov wrote:
>
> > @@ -44,7 +48,7 @@ bool __refrigerator(bool check_kthr_stop)
> >
> > for (;;) {
> > set_current_state(TASK_UNINTERRUPTIBLE);
> > - if (!frozen(current) ||
> > + if (!freezing(current) ||
> > (check_kthr_stop && kthread_should_stop()))
> > break;
> > was_frozen = true;
> > @@ -54,6 +58,11 @@ bool __refrigerator(bool check_kthr_stop)
> > /* Remove the accounting blocker */
> > current->flags &= ~PF_FREEZING;
> >
> > + /* leave FROZEN */
> > + spin_lock_irq(&freezer_lock);
> > + current->flags &= ~PF_FROZEN;
> > + spin_unlock_irq(&freezer_lock);
>
> What if freezing() is true again when we are going to clear
> PF_FROZEN?
And another problem, afaics....
So. With this change frozen(p) == T even after __thaw_task().
PF_FROZEN will be cleared eventually, but we can't know when.
IOW, we can't trust frozen() unless freezing() == T.
This means update_if_frozen() can hit BUG_ON(nfrozen > 0) if
the caller is freezer_write().
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists