lkml.org 
[lkml]   [2011]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH pm] freezer: fix wait_event_freezable/__thaw_task races
On Thu, Nov 03, 2011 at 01:20:41AM +0100, Rafael J. Wysocki wrote:
> On Tuesday, November 01, 2011, Tejun Heo wrote:
> > From: Oleg Nesterov <oleg@redhat.com>
> >
> > wait_event_freezable() and friends stop the waiting if try_to_freeze()
> > fails. This is not right, we can race with __thaw_task() and in this
> > case
> >
> > - wait_event_freezable() returns the wrong ERESTARTSYS
> >
> > - wait_event_freezable_timeout() can return the positive
> > value while condition == F
> >
> > Change the code to always check __retval/condition before return.
> >
> > Note: with or without this patch the timeout logic looks strange,
> > probably we should recalc timeout if try_to_freeze() returns T.
> >
> > tj: Updated to apply to wait_event_freezekillable() too.
> >
> > Signed-off-by: Oleg Nesterov <oleg@redhat.com>
> > Acked-by: Tejun Heo <tj@kernel.org>
>
> Applied to linux-pm/linux-next.

Just in case, this patch isn't correct with preceding patches (the
freezer update patchset), so should only be applied after them.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2011-11-03 01:47    [W:0.052 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site