Messages in this thread | | | Date | Mon, 27 Aug 2012 11:53:12 -0700 | From | Tejun Heo <> | Subject | Re: [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
| |