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
14221422 goto retry;
14231423 }
14241424
1425− /*
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 */
1425+ /* all idle workers are rebound, rebind busy workers */
14381426 for_each_busy_worker(worker, i, pos, gcwq) {
14391427 struct work_struct *rebind_work = &worker->rebind_work;
14401428 unsigned long worker_flags = worker->flags;
@@ -1454,6 +1442,18 @@ retry: · 13 unmodified lines
14541442 worker->scheduled.next,
14551443 work_color_to_flags(WORK_NO_COLOR));
14561444 }
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);
14571457 }
14581458
14591459 static struct worker *alloc_worker(void)