Re: [PATCH] workqueue: detach rescuer from pool until the last

From: Tejun Heo
Date: Fri Jul 18 2014 - 18:52:09 EST


Hello,

On Wed, Jul 16, 2014 at 02:56:50PM +0800, Lai Jiangshan wrote:
> @@ -2300,11 +2300,6 @@ repeat:
> move_linked_works(work, scheduled, &n);
>
> process_scheduled_works(rescuer);
> - spin_unlock_irq(&pool->lock);
> -
> - worker_detach_from_pool(rescuer, pool);
> -
> - spin_lock_irq(&pool->lock);
>
> /*
> * Put the reference grabbed by send_mayday(). @pool won't
> @@ -2322,8 +2317,11 @@ repeat:
> wake_up_worker(pool);
>
> rescuer->pool = NULL;
> - spin_unlock(&pool->lock);
> - spin_lock(&wq_mayday_lock);
> + spin_unlock_irq(&pool->lock);
> +
> + worker_detach_from_pool(rescuer, pool);
> +
> + spin_lock_irq(&wq_mayday_lock);

Can you please also update the comment above put_pwq() and explain
above detach that @pool will stay around till detach is complete?

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/