Re: [PATCH] workqueue: Handle race between wake up and rebind

2018-01-18 Thread Neeraj Upadhyay
On 01/18/2018 08:32 AM, Lai Jiangshan wrote: On Wed, Jan 17, 2018 at 4:08 AM, Neeraj Upadhyay wrote: On 01/16/2018 11:05 PM, Tejun Heo wrote: Hello, Neeraj. On Mon, Jan 15, 2018 at 02:08:12PM +0530, Neeraj Upadhyay wrote: - kworker/0:0 gets chance to run on cpu1; while processing a wo

Re: [PATCH] workqueue: Handle race between wake up and rebind

2018-01-17 Thread Lai Jiangshan
On Wed, Jan 17, 2018 at 4:08 AM, Neeraj Upadhyay wrote: > > > On 01/16/2018 11:05 PM, Tejun Heo wrote: >> >> Hello, Neeraj. >> >> On Mon, Jan 15, 2018 at 02:08:12PM +0530, Neeraj Upadhyay wrote: >>> >>> - kworker/0:0 gets chance to run on cpu1; while processing >>>a work, it goes to sleep. How

Re: [PATCH] workqueue: Handle race between wake up and rebind

2018-01-16 Thread Neeraj Upadhyay
On 01/16/2018 11:05 PM, Tejun Heo wrote: Hello, Neeraj. On Mon, Jan 15, 2018 at 02:08:12PM +0530, Neeraj Upadhyay wrote: - kworker/0:0 gets chance to run on cpu1; while processing a work, it goes to sleep. However, it does not decrement pool->nr_running. This is because WORKER_REBOUND (

Re: [PATCH] workqueue: Handle race between wake up and rebind

2018-01-16 Thread Tejun Heo
Hello, Neeraj. On Mon, Jan 15, 2018 at 02:08:12PM +0530, Neeraj Upadhyay wrote: > - kworker/0:0 gets chance to run on cpu1; while processing > a work, it goes to sleep. However, it does not decrement > pool->nr_running. This is because WORKER_REBOUND (NOT_ > RUNNING) flag was cleared, when w

[PATCH] workqueue: Handle race between wake up and rebind

2018-01-15 Thread Neeraj Upadhyay
There is a potential race b/w rebind_workers() and wakeup of a worker thread, which can result in workqueue lockup for a bounder worker pool. Below is the potential race: - cpu0 is a bounded worker pool, which is unbound from its cpu. A new work is queued on this pool, which causes its worker