Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sched: Replace use of system_unbound_wq with system_dfl_wq

Currently if a user enqueues a work item using schedule_delayed_work() the
used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use
WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to
schedule_work() that is using system_wq and queue_work(), that makes use
again of WORK_CPU_UNBOUND.

This lack of consistency cannot be addressed without refactoring the API.
For more details see the Link tag below.

This continues the effort to refactor workqueue APIs, which began with
the introduction of new workqueues and a new alloc_workqueue flag in:

commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq")
commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag")

Switch to using system_dfl_wq because system_unbound_wq is going away as part of
a workqueue restructuring.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/
Link: https://patch.msgid.link/20251107092452.43399-1-marco.crivellari@suse.com

authored by

Marco Crivellari and committed by
Peter Zijlstra
c2a57380 c0e1832b

+4 -4
+2 -2
kernel/sched/core.c
··· 5678 5678 os = atomic_fetch_add_unless(&twork->state, -1, TICK_SCHED_REMOTE_RUNNING); 5679 5679 WARN_ON_ONCE(os == TICK_SCHED_REMOTE_OFFLINE); 5680 5680 if (os == TICK_SCHED_REMOTE_RUNNING) 5681 - queue_delayed_work(system_unbound_wq, dwork, HZ); 5681 + queue_delayed_work(system_dfl_wq, dwork, HZ); 5682 5682 } 5683 5683 5684 5684 static void sched_tick_start(int cpu) ··· 5697 5697 if (os == TICK_SCHED_REMOTE_OFFLINE) { 5698 5698 twork->cpu = cpu; 5699 5699 INIT_DELAYED_WORK(&twork->work, sched_tick_remote); 5700 - queue_delayed_work(system_unbound_wq, &twork->work, HZ); 5700 + queue_delayed_work(system_dfl_wq, &twork->work, HZ); 5701 5701 } 5702 5702 } 5703 5703
+2 -2
kernel/sched/ext.c
··· 2762 2762 2763 2763 cond_resched(); 2764 2764 } 2765 - queue_delayed_work(system_unbound_wq, to_delayed_work(work), 2765 + queue_delayed_work(system_dfl_wq, to_delayed_work(work), 2766 2766 scx_watchdog_timeout / 2); 2767 2767 } 2768 2768 ··· 5059 5059 5060 5060 WRITE_ONCE(scx_watchdog_timeout, timeout); 5061 5061 WRITE_ONCE(scx_watchdog_timestamp, jiffies); 5062 - queue_delayed_work(system_unbound_wq, &scx_watchdog_work, 5062 + queue_delayed_work(system_dfl_wq, &scx_watchdog_work, 5063 5063 scx_watchdog_timeout / 2); 5064 5064 5065 5065 /*