aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-09-05 02:12:33 -0400
committerTejun Heo <tj@kernel.org>2012-09-05 19:10:14 -0400
commit90beca5de591e12482a812f23a7f10690962ed4a (patch)
tree39e6a6e4e22ba49908d5542b4de6c01fbff48744 /kernel/workqueue.c
parent96e65306b81351b656835c15931d1d237b252f27 (diff)
workqueue: move WORKER_REBIND clearing in rebind_workers() to the end of the function
This doesn't make any functional difference and is purely to help the next patch to be simpler. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index c462cd60c374..d79a18d0c42e 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -1422,19 +1422,7 @@ retry:
1422 goto retry; 1422 goto retry;
1423 } 1423 }
1424 1424
1425 /* 1425 /* all idle workers are rebound, rebind busy workers */
1426 * All idle workers are rebound and waiting for %WORKER_REBIND to
1427 * be cleared inside idle_worker_rebind(). Clear and release.
1428 * Clearing %WORKER_REBIND from this foreign context is safe
1429 * because these workers are still guaranteed to be idle.
1430 */
1431 for_each_worker_pool(pool, gcwq)
1432 list_for_each_entry(worker, &pool->idle_list, entry)
1433 worker->flags &= ~WORKER_REBIND;
1434
1435 wake_up_all(&gcwq->rebind_hold);
1436
1437 /* rebind busy workers */
1438 for_each_busy_worker(worker, i, pos, gcwq) { 1426 for_each_busy_worker(worker, i, pos, gcwq) {
1439 struct work_struct *rebind_work = &worker->rebind_work; 1427 struct work_struct *rebind_work = &worker->rebind_work;
1440 unsigned long worker_flags = worker->flags; 1428 unsigned long worker_flags = worker->flags;
@@ -1454,6 +1442,18 @@ retry:
1454 worker->scheduled.next, 1442 worker->scheduled.next,
1455 work_color_to_flags(WORK_NO_COLOR)); 1443 work_color_to_flags(WORK_NO_COLOR));
1456 } 1444 }
1445
1446 /*
1447 * All idle workers are rebound and waiting for %WORKER_REBIND to
1448 * be cleared inside idle_worker_rebind(). Clear and release.
1449 * Clearing %WORKER_REBIND from this foreign context is safe
1450 * because these workers are still guaranteed to be idle.
1451 */
1452 for_each_worker_pool(pool, gcwq)
1453 list_for_each_entry(worker, &pool->idle_list, entry)
1454 worker->flags &= ~WORKER_REBIND;
1455
1456 wake_up_all(&gcwq->rebind_hold);
1457} 1457}
1458 1458
1459static struct worker *alloc_worker(void) 1459static struct worker *alloc_worker(void)