lkml.org 
[lkml]   [2013]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: __refrigerator() && saved task->state
On 11/13, Peter Zijlstra wrote:
>
> On Wed, Nov 13, 2013 at 08:11:43PM +0100, Oleg Nesterov wrote:
> > At first glance it would be better to simply kill this logic? If
> > it was called with ->state != 0, the caller is going to schedule()
> > and it probably executes the wait_event-like code, in this case
> > it would me more safe to pretend the task got a spurious wakeup?
>
> Note that in general the kernel cannot deal with spurious wakeups :/
>
> Most proper locks and wait primitives can, but there's enough open-coded
> crap out there that can not.

Oh yes, I understand.

My point is, "restore the old state" in this case looks worse simply
because you miss any wakeup in between which was going to clear that
state. And afaics only kthreads can call __refrigerator() in !RUNNING.

But let me repeat, I am almost sure I missed something else.

Oleg.



\
 
 \ /
  Last update: 2013-11-13 20:41    [W:0.252 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site