• Tejun Heo's avatar
    workqueue: drop WQ_RESCUER and test workqueue->rescuer for NULL instead · 493008a8
    Tejun Heo authored
    WQ_RESCUER is superflous.  WQ_MEM_RECLAIM indicates that the user
    wants a rescuer and testing wq->rescuer for NULL can answer whether a
    given workqueue has a rescuer or not.  Drop WQ_RESCUER and test
    wq->rescuer directly.
    
    This will help simplifying __alloc_workqueue_key() failure path by
    allowing it to use destroy_workqueue() on a partially constructed
    workqueue, which in turn will help implementing dynamic management of
    pool_workqueues.
    
    While at it, clear wq->rescuer after freeing it in
    destroy_workqueue().  This is a precaution as scheduled changes will
    make destruction more complex.
    
    This patch doesn't introduce any functional changes.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Reviewed-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
    493008a8
workqueue.c 110 KB