mirror of
https://github.com/torvalds/linux.git
synced 2026-05-13 00:28:54 +02:00
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: commit128ea9f6cc("workqueue: Add system_percpu_wq and system_dfl_wq") commit930c2ea566("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
This commit is contained in:
parent
c0e1832ba6
commit
c2a57380df
|
|
@ -5678,7 +5678,7 @@ static void sched_tick_remote(struct work_struct *work)
|
|||
os = atomic_fetch_add_unless(&twork->state, -1, TICK_SCHED_REMOTE_RUNNING);
|
||||
WARN_ON_ONCE(os == TICK_SCHED_REMOTE_OFFLINE);
|
||||
if (os == TICK_SCHED_REMOTE_RUNNING)
|
||||
queue_delayed_work(system_unbound_wq, dwork, HZ);
|
||||
queue_delayed_work(system_dfl_wq, dwork, HZ);
|
||||
}
|
||||
|
||||
static void sched_tick_start(int cpu)
|
||||
|
|
@ -5697,7 +5697,7 @@ static void sched_tick_start(int cpu)
|
|||
if (os == TICK_SCHED_REMOTE_OFFLINE) {
|
||||
twork->cpu = cpu;
|
||||
INIT_DELAYED_WORK(&twork->work, sched_tick_remote);
|
||||
queue_delayed_work(system_unbound_wq, &twork->work, HZ);
|
||||
queue_delayed_work(system_dfl_wq, &twork->work, HZ);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2762,7 +2762,7 @@ static void scx_watchdog_workfn(struct work_struct *work)
|
|||
|
||||
cond_resched();
|
||||
}
|
||||
queue_delayed_work(system_unbound_wq, to_delayed_work(work),
|
||||
queue_delayed_work(system_dfl_wq, to_delayed_work(work),
|
||||
scx_watchdog_timeout / 2);
|
||||
}
|
||||
|
||||
|
|
@ -5059,7 +5059,7 @@ static int scx_enable(struct sched_ext_ops *ops, struct bpf_link *link)
|
|||
|
||||
WRITE_ONCE(scx_watchdog_timeout, timeout);
|
||||
WRITE_ONCE(scx_watchdog_timestamp, jiffies);
|
||||
queue_delayed_work(system_unbound_wq, &scx_watchdog_work,
|
||||
queue_delayed_work(system_dfl_wq, &scx_watchdog_work,
|
||||
scx_watchdog_timeout / 2);
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user