[PATCH 03/12] workqueue: remove WORKER_PREP from rescuer

From: Lai Jiangshan
Date: Wed Sep 26 2012 - 13:18:34 EST


There is no reason to use WORKER_PREP, remove it from rescuer.

And there is no reason to set it so early in alloc_worker(),
move "worker->flags = WORKER_PREP" to start_worker().

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

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index c55884d..e41c562 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1759,8 +1759,6 @@ static struct worker *alloc_worker(void)
INIT_LIST_HEAD(&worker->entry);
INIT_LIST_HEAD(&worker->scheduled);
INIT_WORK(&worker->rebind_work, busy_worker_rebind_fn);
- /* on creation a worker is in !idle && prep state */
- worker->flags = WORKER_PREP;
}
return worker;
}
@@ -1854,6 +1852,7 @@ fail:
static void start_worker(struct worker *worker)
{
worker->flags |= WORKER_STARTED;
+ worker->flags |= WORKER_PREP;
worker->pool->nr_workers++;
worker_enter_idle(worker);
wake_up_process(worker->task);
--
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/