Messages in this thread Patch in this message | | | From | Lai Jiangshan <> | Subject | [PATCH 02/10] workqueue: remove unneeded check | Date | Mon, 24 Sep 2012 18:07:04 +0800 |
| |
Since we always pass flush responsibility to next, we will not deprive it, now the ->first_flusher can only be changed by the first_flusher, no one can change it, no race as 4ce48b37 said.
Remove the check introduced by 4ce48b37, use BUG_ON() instead.
Also move "wq->first_flusher = NULL;" later.
This patch doesn't make any functional difference.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> --- kernel/workqueue.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 360b7e2..acd9e2f 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -2682,12 +2682,7 @@ void flush_workqueue(struct workqueue_struct *wq) mutex_lock(&wq->flush_mutex); - /* we might have raced, check again with mutex held */ - if (wq->first_flusher != &this_flusher) - goto out_unlock; - - wq->first_flusher = NULL; - + BUG_ON(wq->first_flusher != &this_flusher); BUG_ON(!list_empty(&this_flusher.list)); BUG_ON(wq->flush_color != this_flusher.flush_color); @@ -2728,6 +2723,7 @@ void flush_workqueue(struct workqueue_struct *wq) if (list_empty(&wq->flusher_queue)) { BUG_ON(wq->flush_color != wq->work_color); + wq->first_flusher = NULL; break; } -- 1.7.4.4
| |