lkml.org 
[lkml]   [2012]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/7] workqueue: wait on manager_mutex instead of rebind_hold
Hello, Lai.

On Tue, Aug 28, 2012 at 01:58:21AM +0800, Lai Jiangshan wrote:
> this thread is finally scheduled, .
> sees the WORKER_REBIND is not cleared, .
> go to sleep again waiting for (another) .
> rebind_workers() to wake up me. <--bug-> waiting for the idles' ACK.
>
> The two thread wait each other. It is bug.

Ooh, nice catch. Has this actually happened in the wild? Can you
reproduce it?

> This fix:
> The idle_worker_rebind() don't wait on rebind_hold, it waits on manager_mutex
> instead. When mutex_lock(manager_mutex) returns, the idles know that
> the corresponding rebind_workers() is finish up, the idle_worker_rebind() can
> returns.

Hmm... I can't really see how this change makes any difference tho.
While the exact wait condition changes, the mechanics doesn't.

IDLE WORKER HOTPLUG
- online
- rebind and kicks completion
- wait on manager_mutex
- finishes onlining
- offline
- online again, re-enters rebind_workers()
- wakes up but blocked on
manager_mutex

So, we're just deadlocked on a different thing. It seems what we need
is another interlocked step to make hotplug onlining wait for idle
worker finishes the last step, no?

Thanks.

--
tejun


\
 
 \ /
  Last update: 2012-08-27 21:41    [W:0.083 / U:1.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site