Skip to content

Commit

Permalink
workqueue: Fold rebind_worker() within rebind_workers()
Browse files Browse the repository at this point in the history
!CONFIG_SMP builds complain about rebind_worker() being unused. Its only
user, rebind_workers() is indeed only defined for CONFIG_SMP, so just fold
the two lines back up there.

Link: http://lore.kernel.org/r/20230113143102.2e94d74f@canb.auug.org.au
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Valentin Schneider authored and Tejun Heo committed Jan 13, 2023
1 parent e02b931 commit c63a2e5
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1990,12 +1990,6 @@ static void unbind_worker(struct worker *worker)
WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task, cpu_possible_mask) < 0);
}

static void rebind_worker(struct worker *worker, struct worker_pool *pool)
{
kthread_set_per_cpu(worker->task, pool->cpu);
WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task, pool->attrs->cpumask) < 0);
}

static void wake_dying_workers(struct list_head *cull_list)
{
struct worker *worker, *tmp;
Expand Down Expand Up @@ -5192,8 +5186,11 @@ static void rebind_workers(struct worker_pool *pool)
* of all workers first and then clear UNBOUND. As we're called
* from CPU_ONLINE, the following shouldn't fail.
*/
for_each_pool_worker(worker, pool)
rebind_worker(worker, pool);
for_each_pool_worker(worker, pool) {
kthread_set_per_cpu(worker->task, pool->cpu);
WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task,
pool->attrs->cpumask) < 0);
}

raw_spin_lock_irq(&pool->lock);

Expand Down

0 comments on commit c63a2e5

Please sign in to comment.