Skip to content

Commit

Permalink
workqueue: Initialize wq_isolated_cpumask in workqueue_init_early()
Browse files Browse the repository at this point in the history
[ Upstream commit 261dce3 ]

Now when isolcpus is enabled via the cmdline, wq_isolated_cpumask does
not include these isolated CPUs, even wq_unbound_cpumask has already
excluded them. It is only when we successfully configure an isolate cpuset
partition that wq_isolated_cpumask gets overwritten by
workqueue_unbound_exclude_cpumask(), including both the cmdline-specified
isolated CPUs and the isolated CPUs within the cpuset partitions.

Fix this issue by initializing wq_isolated_cpumask properly in
workqueue_init_early().

Fixes: fe28f63 ("workqueue: Add workqueue_unbound_exclude_cpumask() to exclude CPUs from wq_unbound_cpumask")
Signed-off-by: Chuyi Zhou <zhouchuyi@bytedance.com>
Reviewed-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Chuyi Zhou authored and Greg Kroah-Hartman committed Jun 27, 2025
1 parent b8aaf2b commit e20f4eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -7756,7 +7756,8 @@ void __init workqueue_init_early(void)
restrict_unbound_cpumask("workqueue.unbound_cpus", &wq_cmdline_cpumask);

cpumask_copy(wq_requested_unbound_cpumask, wq_unbound_cpumask);

cpumask_andnot(wq_isolated_cpumask, cpu_possible_mask,
housekeeping_cpumask(HK_TYPE_DOMAIN));
pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC);

unbound_wq_update_pwq_attrs_buf = alloc_workqueue_attrs();
Expand Down

0 comments on commit e20f4eb

Please sign in to comment.