[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120827185312.GA13094@dhcp-172-17-108-109.mtv.corp.google.com>
Date: Mon, 27 Aug 2012 11:53:12 -0700
From: Tejun Heo <tj@...nel.org>
To: Lai Jiangshan <laijs@...fujitsu.com>
Cc: linux-kernel@...r.kernel.org
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists