* [PATCH v3 0/2] Replace system_unbound_wq with system_dfl_wq
@ 2026-04-02 13:41 Marco Crivellari
2026-04-02 13:41 ` [PATCH v3 1/2] sched: replace use of " Marco Crivellari
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Marco Crivellari @ 2026-04-02 13:41 UTC (permalink / raw)
To: linux-kernel
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot
Hi,
Recently the workqueue code has been changed introducing two new workqueue,
system_percpu_wq and system_dfl_wq, as a future replacement for system_wq and
system_unbound_wq respectively.
The following, address the aforementioned changes in the Workqueue API:
- commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq")
- commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag")
The old workqueues will be removed in a future release cycle.
=== Introduced Changes by this series ===
1) [P 1-2] Replace uses of system_wq and system_unbound_wq
system_unbound_wq is to be used when locality is not required.
Nothing in its name make clear this should be used when locality is not
required, so system_unbound_wq has been replaced with system_dfl_wq.
Thanks!
---
Changes in v3:
- rebased on v7.0-rc6
- commit split in two: sched (kernel/sched/core.c) and sched_ext (kernel/sched/ext.c).
- improved commit logs
Changes in v2:
- rebase and improved commit logs
Marco Crivellari (2):
sched: replace use of system_unbound_wq with system_dfl_wq
sched_ext: Replace use of system_unbound_wq with system_dfl_wq
kernel/sched/core.c | 4 ++--
kernel/sched/ext.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3 1/2] sched: replace use of system_unbound_wq with system_dfl_wq
2026-04-02 13:41 [PATCH v3 0/2] Replace system_unbound_wq with system_dfl_wq Marco Crivellari
@ 2026-04-02 13:41 ` Marco Crivellari
2026-04-02 13:41 ` [PATCH v3 2/2] sched_ext: Replace " Marco Crivellari
2026-04-09 10:06 ` [PATCH v3 0/2] Replace " Marco Crivellari
2 siblings, 0 replies; 4+ messages in thread
From: Marco Crivellari @ 2026-04-02 13:41 UTC (permalink / raw)
To: linux-kernel
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot
This patch continues the effort to refactor workqueue APIs, which has begun
with the changes introducing new workqueues and a new alloc_workqueue flag:
commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq")
commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag")
The point of the refactoring is to eventually alter the default behavior of
workqueues to become unbound by default so that their workload placement is
optimized by the scheduler.
Before that to happen, workqueue users must be converted to the better named
new workqueues with no intended behaviour changes:
system_wq -> system_percpu_wq
system_unbound_wq -> system_dfl_wq
This way the old obsolete workqueues (system_wq, system_unbound_wq) can be
removed in the future.
Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
---
kernel/sched/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 496dff740dca..aaef6f5292aa 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5681,7 +5681,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)
@@ -5700,7 +5700,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);
}
}
--
2.53.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v3 2/2] sched_ext: Replace use of system_unbound_wq with system_dfl_wq
2026-04-02 13:41 [PATCH v3 0/2] Replace system_unbound_wq with system_dfl_wq Marco Crivellari
2026-04-02 13:41 ` [PATCH v3 1/2] sched: replace use of " Marco Crivellari
@ 2026-04-02 13:41 ` Marco Crivellari
2026-04-09 10:06 ` [PATCH v3 0/2] Replace " Marco Crivellari
2 siblings, 0 replies; 4+ messages in thread
From: Marco Crivellari @ 2026-04-02 13:41 UTC (permalink / raw)
To: linux-kernel
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot
This patch continues the effort to refactor workqueue APIs, which has begun
with the changes introducing new workqueues and a new alloc_workqueue flag:
commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq")
commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag")
The point of the refactoring is to eventually alter the default behavior of
workqueues to become unbound by default so that their workload placement is
optimized by the scheduler.
Before that to happen, workqueue users must be converted to the better named
new workqueues with no intended behaviour changes:
system_wq -> system_percpu_wq
system_unbound_wq -> system_dfl_wq
This way the old obsolete workqueues (system_wq, system_unbound_wq) can be
removed in the future.
Link: https://lore.kernel.org/all/20250221112003.1dSuoGyc@linutronix.de/
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
---
kernel/sched/ext.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c
index 26a6ac2f8826..95791a5ebb0d 100644
--- a/kernel/sched/ext.c
+++ b/kernel/sched/ext.c
@@ -2765,7 +2765,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),
READ_ONCE(scx_watchdog_timeout) / 2);
}
@@ -3704,7 +3704,7 @@ static void scx_kobj_release(struct kobject *kobj)
struct scx_sched *sch = container_of(kobj, struct scx_sched, kobj);
INIT_RCU_WORK(&sch->rcu_work, scx_sched_free_rcu_work);
- queue_rcu_work(system_unbound_wq, &sch->rcu_work);
+ queue_rcu_work(system_dfl_wq, &sch->rcu_work);
}
static ssize_t scx_attr_ops_show(struct kobject *kobj,
@@ -5087,7 +5087,7 @@ static void scx_enable_workfn(struct kthread_work *work)
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,
READ_ONCE(scx_watchdog_timeout) / 2);
/*
--
2.53.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 0/2] Replace system_unbound_wq with system_dfl_wq
2026-04-02 13:41 [PATCH v3 0/2] Replace system_unbound_wq with system_dfl_wq Marco Crivellari
2026-04-02 13:41 ` [PATCH v3 1/2] sched: replace use of " Marco Crivellari
2026-04-02 13:41 ` [PATCH v3 2/2] sched_ext: Replace " Marco Crivellari
@ 2026-04-09 10:06 ` Marco Crivellari
2 siblings, 0 replies; 4+ messages in thread
From: Marco Crivellari @ 2026-04-09 10:06 UTC (permalink / raw)
To: linux-kernel
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Michal Hocko, Ingo Molnar,
Peter Zijlstra, Juri Lelli, Vincent Guittot
On Thu, Apr 2, 2026 at 3:41 PM Marco Crivellari
<marco.crivellari@suse.com> wrote:
> [...]
> Marco Crivellari (2):
> sched: replace use of system_unbound_wq with system_dfl_wq
> sched_ext: Replace use of system_unbound_wq with system_dfl_wq
>
> kernel/sched/core.c | 4 ++--
> kernel/sched/ext.c | 6 +++---
> 2 files changed, 5 insertions(+), 5 deletions(-)
Hi,
Gentle ping.
Thanks!
--
Marco Crivellari
SUSE Labs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-04-09 10:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-02 13:41 [PATCH v3 0/2] Replace system_unbound_wq with system_dfl_wq Marco Crivellari
2026-04-02 13:41 ` [PATCH v3 1/2] sched: replace use of " Marco Crivellari
2026-04-02 13:41 ` [PATCH v3 2/2] sched_ext: Replace " Marco Crivellari
2026-04-09 10:06 ` [PATCH v3 0/2] Replace " Marco Crivellari
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®