lkml.org 
[lkml]   [2012]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 6/7] workqueue: init 0 for idle_rebind.cnt
Date
Access idle_rebind.cnt is always protected by gcwq->lock,
don't need to init it as 1.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
kernel/workqueue.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index ed23c9a..9f38a65 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1394,7 +1394,7 @@ static void rebind_workers(struct global_cwq *gcwq)
* us to finish up by competing on pool->manager_mutex.
*/
init_completion(&idle_rebind.done);
- idle_rebind.cnt = 1;
+ idle_rebind.cnt = 0;
INIT_COMPLETION(idle_rebind.done);

/* set REBIND and kick idle ones, we'll wait for these later */
@@ -1435,7 +1435,7 @@ static void rebind_workers(struct global_cwq *gcwq)
}

/* waiting for all idle workers to be rebound */
- if (--idle_rebind.cnt) {
+ if (idle_rebind.cnt) {
spin_unlock_irq(&gcwq->lock);
wait_for_completion(&idle_rebind.done);
spin_lock_irq(&gcwq->lock);
--
1.7.4.4


\
 
 \ /
  Last update: 2012-08-27 20:41    [W:0.110 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site