* [PATCH 1/2] drm/nouveau: replace use of system_unbound_wq with system_dfl_wq
2025-10-31 10:20 [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue Marco Crivellari
@ 2025-10-31 10:20 ` Marco Crivellari
2026-04-28 8:58 ` Thomas Zimmermann
2025-10-31 10:20 ` [PATCH 2/2] drm/nouveau: WQ_PERCPU added to alloc_workqueue users Marco Crivellari
` (5 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Marco Crivellari @ 2025-10-31 10:20 UTC (permalink / raw)
To: linux-kernel, dri-devel, nouveau
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
Lyude Paul, Danilo Krummrich, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Currently if a user enqueue 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.
system_unbound_wq should be the default workqueue so as not to enforce
locality constraints for random work whenever it's not required.
Adding system_dfl_wq to encourage its use when unbound work should be used.
The old system_unbound_wq will be kept for a few release cycles.
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
---
drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index e97e39abf3a2..50b7aade5f0a 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -2474,7 +2474,7 @@ nv50_disp_atomic_commit(struct drm_device *dev,
pm_runtime_get_noresume(dev->dev);
if (nonblock)
- queue_work(system_unbound_wq, &state->commit_work);
+ queue_work(system_dfl_wq, &state->commit_work);
else
nv50_disp_atomic_commit_tail(state);
--
2.51.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 1/2] drm/nouveau: replace use of system_unbound_wq with system_dfl_wq
2025-10-31 10:20 ` [PATCH 1/2] drm/nouveau: replace use of system_unbound_wq with system_dfl_wq Marco Crivellari
@ 2026-04-28 8:58 ` Thomas Zimmermann
0 siblings, 0 replies; 12+ messages in thread
From: Thomas Zimmermann @ 2026-04-28 8:58 UTC (permalink / raw)
To: Marco Crivellari, linux-kernel, dri-devel, nouveau
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Michal Hocko, Lyude Paul,
Danilo Krummrich, Maarten Lankhorst, Maxime Ripard, David Airlie,
Simona Vetter
Am 31.10.25 um 11:20 schrieb Marco Crivellari:
> Currently if a user enqueue 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.
>
> system_unbound_wq should be the default workqueue so as not to enforce
> locality constraints for random work whenever it's not required.
>
> Adding system_dfl_wq to encourage its use when unbound work should be used.
>
> The old system_unbound_wq will be kept for a few release cycles.
>
> Suggested-by: Tejun Heo <tj@kernel.org>
> Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index e97e39abf3a2..50b7aade5f0a 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -2474,7 +2474,7 @@ nv50_disp_atomic_commit(struct drm_device *dev,
> pm_runtime_get_noresume(dev->dev);
>
> if (nonblock)
> - queue_work(system_unbound_wq, &state->commit_work);
> + queue_work(system_dfl_wq, &state->commit_work);
> else
> nv50_disp_atomic_commit_tail(state);
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/2] drm/nouveau: WQ_PERCPU added to alloc_workqueue users
2025-10-31 10:20 [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue Marco Crivellari
2025-10-31 10:20 ` [PATCH 1/2] drm/nouveau: replace use of system_unbound_wq with system_dfl_wq Marco Crivellari
@ 2025-10-31 10:20 ` Marco Crivellari
2025-12-02 13:20 ` [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue Marco Crivellari
` (4 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Marco Crivellari @ 2025-10-31 10:20 UTC (permalink / raw)
To: linux-kernel, dri-devel, nouveau
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
Lyude Paul, Danilo Krummrich, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Currently if a user enqueue 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 consistentcy cannot be addressed without refactoring the API.
alloc_workqueue() treats all queues as per-CPU by default, while unbound
workqueues must opt-in via WQ_UNBOUND.
This default is suboptimal: most workloads benefit from unbound queues,
allowing the scheduler to place worker threads where they’re needed and
reducing noise when CPUs are isolated.
This change adds a new WQ_PERCPU flag to explicitly request
alloc_workqueue() to be per-cpu when WQ_UNBOUND has not been specified.
With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND),
any alloc_workqueue() caller that doesn’t explicitly specify WQ_UNBOUND
must now use WQ_PERCPU.
Once migration is complete, WQ_UNBOUND can be removed and unbound will
become the implicit default.
Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
---
drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_sched.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 1527b801f013..5a2970ef27d4 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -631,7 +631,7 @@ nouveau_drm_device_init(struct nouveau_drm *drm)
struct drm_device *dev = drm->dev;
int ret;
- drm->sched_wq = alloc_workqueue("nouveau_sched_wq_shared", 0,
+ drm->sched_wq = alloc_workqueue("nouveau_sched_wq_shared", WQ_PERCPU,
WQ_MAX_ACTIVE);
if (!drm->sched_wq)
return -ENOMEM;
diff --git a/drivers/gpu/drm/nouveau/nouveau_sched.c b/drivers/gpu/drm/nouveau/nouveau_sched.c
index e60f7892f5ce..79cf157ab2a5 100644
--- a/drivers/gpu/drm/nouveau/nouveau_sched.c
+++ b/drivers/gpu/drm/nouveau/nouveau_sched.c
@@ -416,7 +416,8 @@ nouveau_sched_init(struct nouveau_sched *sched, struct nouveau_drm *drm,
int ret;
if (!wq) {
- wq = alloc_workqueue("nouveau_sched_wq_%d", 0, WQ_MAX_ACTIVE,
+ wq = alloc_workqueue("nouveau_sched_wq_%d", WQ_PERCPU,
+ WQ_MAX_ACTIVE,
current->pid);
if (!wq)
return -ENOMEM;
--
2.51.0
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue
2025-10-31 10:20 [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue Marco Crivellari
2025-10-31 10:20 ` [PATCH 1/2] drm/nouveau: replace use of system_unbound_wq with system_dfl_wq Marco Crivellari
2025-10-31 10:20 ` [PATCH 2/2] drm/nouveau: WQ_PERCPU added to alloc_workqueue users Marco Crivellari
@ 2025-12-02 13:20 ` Marco Crivellari
2026-02-04 10:35 ` Marco Crivellari
2026-03-05 15:10 ` Marco Crivellari
` (3 subsequent siblings)
6 siblings, 1 reply; 12+ messages in thread
From: Marco Crivellari @ 2025-12-02 13:20 UTC (permalink / raw)
To: linux-kernel, dri-devel, nouveau
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Michal Hocko, Lyude Paul,
Danilo Krummrich, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Hi,
On Fri, Oct 31, 2025 at 11:20 AM Marco Crivellari
<marco.crivellari@suse.com> wrote:
> Marco Crivellari (2):
> drm/nouveau: replace use of system_unbound_wq with system_dfl_wq
> drm/nouveau: WQ_PERCPU added to alloc_workqueue users
>
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +-
> drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +-
> drivers/gpu/drm/nouveau/nouveau_sched.c | 3 ++-
> 3 files changed, 4 insertions(+), 3 deletions(-)
Gentle ping.
Thanks!
--
Marco Crivellari
L3 Support Engineer, Technology & Product
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue
2025-12-02 13:20 ` [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue Marco Crivellari
@ 2026-02-04 10:35 ` Marco Crivellari
0 siblings, 0 replies; 12+ messages in thread
From: Marco Crivellari @ 2026-02-04 10:35 UTC (permalink / raw)
To: linux-kernel, dri-devel, nouveau
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Michal Hocko, Lyude Paul,
Danilo Krummrich, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Hi,
On Tue, Dec 2, 2025 at 2:20 PM Marco Crivellari
<marco.crivellari@suse.com> wrote:
> [...]
> > Marco Crivellari (2):
> > drm/nouveau: replace use of system_unbound_wq with system_dfl_wq
> > drm/nouveau: WQ_PERCPU added to alloc_workqueue users
> >
> > drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +-
> > drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +-
> > drivers/gpu/drm/nouveau/nouveau_sched.c | 3 ++-
> > 3 files changed, 4 insertions(+), 3 deletions(-)
>
> Gentle ping.
Hi,
Gentle ping. :-)
Thanks!
--
Marco Crivellari
L3 Support Engineer
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue
2025-10-31 10:20 [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue Marco Crivellari
` (2 preceding siblings ...)
2025-12-02 13:20 ` [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue Marco Crivellari
@ 2026-03-05 15:10 ` Marco Crivellari
2026-03-31 10:16 ` Marco Crivellari
` (2 subsequent siblings)
6 siblings, 0 replies; 12+ messages in thread
From: Marco Crivellari @ 2026-03-05 15:10 UTC (permalink / raw)
To: linux-kernel, dri-devel, nouveau
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Michal Hocko, Lyude Paul,
Danilo Krummrich, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Hi,
On Fri, Oct 31, 2025 at 11:20 AM Marco Crivellari
<marco.crivellari@suse.com> wrote:
> Marco Crivellari (2):
> drm/nouveau: replace use of system_unbound_wq with system_dfl_wq
> drm/nouveau: WQ_PERCPU added to alloc_workqueue users
>
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +-
> drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +-
> drivers/gpu/drm/nouveau/nouveau_sched.c | 3 ++-
> 3 files changed, 4 insertions(+), 3 deletions(-)
Gentle ping.
Thanks!
--
Marco Crivellari
L3 Support Engineer
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue
2025-10-31 10:20 [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue Marco Crivellari
` (3 preceding siblings ...)
2026-03-05 15:10 ` Marco Crivellari
@ 2026-03-31 10:16 ` Marco Crivellari
2026-04-09 9:59 ` Marco Crivellari
2026-04-28 10:59 ` Danilo Krummrich
6 siblings, 0 replies; 12+ messages in thread
From: Marco Crivellari @ 2026-03-31 10:16 UTC (permalink / raw)
To: linux-kernel, dri-devel, nouveau
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Michal Hocko, Lyude Paul,
Danilo Krummrich, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Hi,
On Fri, Oct 31, 2025 at 11:20 AM Marco Crivellari
<marco.crivellari@suse.com> wrote:
> Marco Crivellari (2):
> drm/nouveau: replace use of system_unbound_wq with system_dfl_wq
> drm/nouveau: WQ_PERCPU added to alloc_workqueue users
>
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +-
> drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +-
> drivers/gpu/drm/nouveau/nouveau_sched.c | 3 ++-
> 3 files changed, 4 insertions(+), 3 deletions(-)
Gentle ping.
Thanks!
--
Marco Crivellari
L3 Support Engineer
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue
2025-10-31 10:20 [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue Marco Crivellari
` (4 preceding siblings ...)
2026-03-31 10:16 ` Marco Crivellari
@ 2026-04-09 9:59 ` Marco Crivellari
2026-04-28 10:59 ` Danilo Krummrich
6 siblings, 0 replies; 12+ messages in thread
From: Marco Crivellari @ 2026-04-09 9:59 UTC (permalink / raw)
To: linux-kernel, dri-devel, nouveau
Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
Sebastian Andrzej Siewior, Michal Hocko, Lyude Paul,
Danilo Krummrich, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
On Fri, Oct 31, 2025 at 11:20 AM Marco Crivellari
<marco.crivellari@suse.com> wrote:
> [...]
> Marco Crivellari (2):
> drm/nouveau: replace use of system_unbound_wq with system_dfl_wq
> drm/nouveau: WQ_PERCPU added to alloc_workqueue users
>
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +-
> drivers/gpu/drm/nouveau/nouveau_drm.c | 2 +-
> drivers/gpu/drm/nouveau/nouveau_sched.c | 3 ++-
> 3 files changed, 4 insertions(+), 3 deletions(-)
Hi,
Gentle ping.
Thanks!
--
Marco Crivellari
SUSE Labs
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue
2025-10-31 10:20 [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue Marco Crivellari
` (5 preceding siblings ...)
2026-04-09 9:59 ` Marco Crivellari
@ 2026-04-28 10:59 ` Danilo Krummrich
2026-04-28 11:19 ` Marco Crivellari
6 siblings, 1 reply; 12+ messages in thread
From: Danilo Krummrich @ 2026-04-28 10:59 UTC (permalink / raw)
To: Marco Crivellari
Cc: linux-kernel, dri-devel, nouveau, Tejun Heo, Lai Jiangshan,
Frederic Weisbecker, Sebastian Andrzej Siewior, Michal Hocko,
Lyude Paul, Danilo Krummrich, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
On Fri, 31 Oct 2025 11:20:18 +0100, Marco Crivellari wrote:
> [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue
Applied, thanks!
Branch: drm-misc-next
Tree: https://gitlab.freedesktop.org/drm/misc/kernel.git
[1/2] drm/nouveau: replace use of system_unbound_wq with system_dfl_wq
commit: ef1b53284175
[2/2] drm/nouveau: WQ_PERCPU added to alloc_workqueue users
commit: c82a16b0caac
The patches will appear in the next linux-next integration (typically within 24
hours on weekdays).
The patches are queued up for the upcoming merge window for the next major
kernel release.
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue
2026-04-28 10:59 ` Danilo Krummrich
@ 2026-04-28 11:19 ` Marco Crivellari
2026-04-28 14:12 ` Danilo Krummrich
0 siblings, 1 reply; 12+ messages in thread
From: Marco Crivellari @ 2026-04-28 11:19 UTC (permalink / raw)
To: Danilo Krummrich
Cc: linux-kernel, dri-devel, nouveau, Tejun Heo, Lai Jiangshan,
Frederic Weisbecker, Sebastian Andrzej Siewior, Michal Hocko,
Lyude Paul, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter
On Tue, Apr 28, 2026 at 12:59 PM Danilo Krummrich <dakr@kernel.org> wrote:
>
> On Fri, 31 Oct 2025 11:20:18 +0100, Marco Crivellari wrote:
> > [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue
>
> Applied, thanks!
>
> Branch: drm-misc-next
> Tree: https://gitlab.freedesktop.org/drm/misc/kernel.git
>
> [1/2] drm/nouveau: replace use of system_unbound_wq with system_dfl_wq
> commit: ef1b53284175
> [2/2] drm/nouveau: WQ_PERCPU added to alloc_workqueue users
> commit: c82a16b0caac
Many thanks!
--
Marco Crivellari
SUSE Labs
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] replaced old wq name, added WQ_PERCPU to alloc_workqueue
2026-04-28 11:19 ` Marco Crivellari
@ 2026-04-28 14:12 ` Danilo Krummrich
0 siblings, 0 replies; 12+ messages in thread
From: Danilo Krummrich @ 2026-04-28 14:12 UTC (permalink / raw)
To: Marco Crivellari
Cc: linux-kernel, dri-devel, nouveau, Tejun Heo, Lai Jiangshan,
Frederic Weisbecker, Sebastian Andrzej Siewior, Michal Hocko,
Maarten Lankhorst, Maxime Ripard, Simona Vetter
On 4/28/26 1:19 PM, Marco Crivellari wrote:
> Many thanks!
No worries, sorry for the delay.
- Danilo
^ permalink raw reply [flat|nested] 12+ messages in thread