Re: [PATCH 02/10 V4] workqueue: fix deadlock in rebind_workers()

From: Tejun Heo
Date: Tue Sep 04 2012 - 21:34:06 EST


Hello,

On Wed, Sep 05, 2012 at 09:28:38AM +0800, Lai Jiangshan wrote:
> I see that this patch's idea is same as mine but reuses
> @idle_rebind.cnt and @idle_rebind.done.
>
> I don't think it is consistent to avoid adding new field
> and to reuse old field for different purpose

It's not necessarily the reuse which seems more consistent to me but
where the driving logic is. It's now better contained in
rebind_workers().

> > - /*
> > - * All idle workers are rebound and waiting for %WORKER_REBIND to
> > - * be cleared inside idle_worker_rebind(). Clear and release.
> > - * Clearing %WORKER_REBIND from this foreign context is safe
> > - * because these workers are still guaranteed to be idle.
> > - */
> > - for_each_worker_pool(pool, gcwq)
> > - list_for_each_entry(worker, &pool->idle_list, entry)
> > - worker->flags &= ~WORKER_REBIND;
> > -
> > - wake_up_all(&gcwq->rebind_hold);
>
> don't need to move down.

Yeap, but cleaner that way. With the moving separated into another
patch, the addition of another handshake stage becomes easier to
follow.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/