lkml.org 
[lkml]   [2012]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 03/11 V5] workqueue: new day don't need WORKER_REBIND for busy rebinding
Date
because old busy_worker_rebind_fn() have to wait until all idle worker finish.
so we have to use two flags WORKER_UNBOUND and WORKER_REBIND to avoid
prematurely clear all NOT_RUNNING bit when highly frequent offline/online.

but current code don't need to wait idle workers. so we don't need to
use two flags, just one is enough. remove WORKER_REBIND from busy rebinding.

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

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 3dd7ce2..ba0ba33 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1638,7 +1638,7 @@ static void busy_worker_rebind_fn(struct work_struct *work)
struct global_cwq *gcwq = worker->pool->gcwq;

if (worker_maybe_bind_and_lock(worker))
- worker_clr_flags(worker, WORKER_REBIND);
+ worker_clr_flags(worker, WORKER_UNBOUND);

spin_unlock_irq(&gcwq->lock);
}
@@ -1691,13 +1691,6 @@ static void rebind_workers(struct global_cwq *gcwq)
for_each_busy_worker(worker, i, pos, gcwq) {
struct work_struct *rebind_work = &worker->rebind_work;
struct workqueue_struct *wq;
- unsigned long worker_flags = worker->flags;
-
- /* morph UNBOUND to REBIND */
- worker_flags &= ~WORKER_UNBOUND;
- worker_flags |= WORKER_REBIND;
- /* ensure the wq_worker_sleeping() see the right flags */
- ACCESS_ONCE(worker->flags) = worker_flags;

if (test_and_set_bit(WORK_STRUCT_PENDING_BIT,
work_data_bits(rebind_work)))
--
1.7.4.4


\
 
 \ /
  Last update: 2012-09-05 13:04    [W:0.174 / U:0.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site