History

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.

Tejun Heo committed 14 years ago

Commit 90beca51 parent 96e65301 file · +13 −13Browse files

Showing the changes to kernel/workqueue.c (1 of 1 file). Show all

Unified · Split

kernel/workqueue.c+13−13
@@ -1422,19 +1422,7 @@ retry: · 1421 unmodified lines
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: · 13 unmodified lines
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)