From: Mathieu Desnoyers Date: Fri, 24 Oct 2014 11:07:48 +0000 (-0400) Subject: workqueue: steal all: only steal from workers when steal flag is set X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2e1ced1f1ec38b5c9e85fe407a6e8390b9ac6416;p=userspace-rcu.git workqueue: steal all: only steal from workers when steal flag is set Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu/workqueue-fifo.h b/urcu/workqueue-fifo.h index ff0c650..c2766e5 100644 --- a/urcu/workqueue-fifo.h +++ b/urcu/workqueue-fifo.h @@ -514,13 +514,15 @@ bool urcu_workqueue_steal_all(struct urcu_workqueue *queue, struct urcu_worker *sibling; bool has_work = false; - rcu_read_lock(); - /* Steal from each worker */ - cds_list_for_each_entry_rcu(sibling, &queue->sibling_head, - sibling_node) - has_work |= ___urcu_grab_work(worker, &sibling->head, - &sibling->tail, 1); - rcu_read_unlock(); + if (worker->flags & URCU_WORKER_STEAL) { + rcu_read_lock(); + /* Steal from each worker */ + cds_list_for_each_entry_rcu(sibling, &queue->sibling_head, + sibling_node) + has_work |= ___urcu_grab_work(worker, &sibling->head, + &sibling->tail, 1); + rcu_read_unlock(); + } /* Steal from global workqueue */ has_work |= ___urcu_grab_work(worker, &queue->head, &queue->tail, 0);