lkml.org 
[lkml]   [2014]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] workqueue: rescuer_thread() processes all pwqs before exit
On Fri, Apr 18, 2014 at 12:21:51AM +0800, Lai Jiangshan wrote:
> > Hmmm? Isn't this the same race condition that you tried to remove by
> > relocating the test? It doesn't matter what destroy_workqueue() does,
> > the rescuer may get preempted inbetween and anything can happen
> > inbetween including someone maydaying and initiation of
> > destroy_workqueue(). Your patch doesn't change the situation at all.
> > It can still return with non-empty mayday list.
>
> You are right. We need a additional atomic check.

I don't think increasing the number of checks will do anything. We
just need to keep the test where it is now and exit after doing the
loop. ie.

set TASK_INTRRUPTIBLE
test should_stop and cache the result

spin_lock_irq();

while () {
process the list
}

spin_unlock_irq();

if (was should_stop asserted?)
exit;

schedule();

Should do, no?

--
tejun


\
 
 \ /
  Last update: 2014-04-17 18:41    [W:0.093 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site