Loading kernel/workqueue.c +13 −6 Original line number Diff line number Diff line Loading @@ -4494,10 +4494,13 @@ static void wq_unbind_fn(struct work_struct *work) /** * rebind_workers - rebind all workers of a pool to the associated CPU * @pool: pool of interest * @force: if it is true, replace WORKER_UNBOUND with WORKER_REBOUND * irrespective of flags of workers. Otherwise, replace the flags only * when workers have WORKER_UNBOUND flag. * * @pool->cpu is coming online. Rebind all workers to the CPU. */ static void rebind_workers(struct worker_pool *pool) static void rebind_workers(struct worker_pool *pool, bool force) { struct worker *worker; Loading Loading @@ -4546,11 +4549,13 @@ static void rebind_workers(struct worker_pool *pool) * fail incorrectly leading to premature concurrency * management operations. */ if (force || (worker_flags & WORKER_UNBOUND)) { WARN_ON_ONCE(!(worker_flags & WORKER_UNBOUND)); worker_flags |= WORKER_REBOUND; worker_flags &= ~WORKER_UNBOUND; ACCESS_ONCE(worker->flags) = worker_flags; } } spin_unlock_irq(&pool->lock); } Loading Loading @@ -4618,7 +4623,9 @@ static int workqueue_cpu_up_callback(struct notifier_block *nfb, mutex_lock(&pool->attach_mutex); if (pool->cpu == cpu) rebind_workers(pool); rebind_workers(pool, (action & ~CPU_TASKS_FROZEN) != CPU_DOWN_FAILED); else if (pool->cpu < 0) restore_unbound_workers_cpumask(pool, cpu); Loading Loading
kernel/workqueue.c +13 −6 Original line number Diff line number Diff line Loading @@ -4494,10 +4494,13 @@ static void wq_unbind_fn(struct work_struct *work) /** * rebind_workers - rebind all workers of a pool to the associated CPU * @pool: pool of interest * @force: if it is true, replace WORKER_UNBOUND with WORKER_REBOUND * irrespective of flags of workers. Otherwise, replace the flags only * when workers have WORKER_UNBOUND flag. * * @pool->cpu is coming online. Rebind all workers to the CPU. */ static void rebind_workers(struct worker_pool *pool) static void rebind_workers(struct worker_pool *pool, bool force) { struct worker *worker; Loading Loading @@ -4546,11 +4549,13 @@ static void rebind_workers(struct worker_pool *pool) * fail incorrectly leading to premature concurrency * management operations. */ if (force || (worker_flags & WORKER_UNBOUND)) { WARN_ON_ONCE(!(worker_flags & WORKER_UNBOUND)); worker_flags |= WORKER_REBOUND; worker_flags &= ~WORKER_UNBOUND; ACCESS_ONCE(worker->flags) = worker_flags; } } spin_unlock_irq(&pool->lock); } Loading Loading @@ -4618,7 +4623,9 @@ static int workqueue_cpu_up_callback(struct notifier_block *nfb, mutex_lock(&pool->attach_mutex); if (pool->cpu == cpu) rebind_workers(pool); rebind_workers(pool, (action & ~CPU_TASKS_FROZEN) != CPU_DOWN_FAILED); else if (pool->cpu < 0) restore_unbound_workers_cpumask(pool, cpu); Loading