mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND to alloc_workqueue users
@ 2025-12-24 14:47 Marco Crivellari
  2025-12-24 14:47 ` [PATCH v3 1/4] drm/amdgpu: replace use of system_unbound_wq with system_dfl_wq Marco Crivellari
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Marco Crivellari @ 2025-12-24 14:47 UTC (permalink / raw)
  To: linux-kernel, amd-gfx, dri-devel
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
	Alex Deucher, Christian Konig, David Airlie, Simona Vetter,
	Philip Yang

Hi,

=== Current situation: problems ===

Let's consider a nohz_full system with isolated CPUs: wq_unbound_cpumask is
set to the housekeeping CPUs, for !WQ_UNBOUND the local CPU is selected.

This leads to different scenarios if a work item is scheduled on an
isolated CPU where "delay" value is 0 or greater then 0:
        schedule_delayed_work(, 0);

This will be handled by __queue_work() that will queue the work item on the
current local (isolated) CPU, while:

        schedule_delayed_work(, 1);

Will move the timer on an housekeeping CPU, and schedule the work there.

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.

=== Recent changes to the WQ API ===

The following, address the recent 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_wq is a per-CPU workqueue, but his name is not clear.
    system_unbound_wq is to be used when locality is not required.

    Because these specific workloads have no benefits from a per-cpu wq,
    both have been replaced with system_dfl_wq.

2) [P 3] WQ_UNBOUND added to alloc_workqueue (amdfk)
    This change make sure alloc_workqueue in amd/amdfkd is unbound,
    explicitly adding WQ_UNBOUND to the alloc_workqueue() user.

3) [P 4] WQ_PERCPU added to alloc_workqueue()

    This change adds a new WQ_PERCPU flag to explicitly request
    alloc_workqueue() to be per-cpu when WQ_UNBOUND has not been specified.


Thanks!

---
Changes in v3:
- improved message commits
- rebased on v6.19-rc2

Changes in v2:
- system_wq replaced with system_dfl_wq instead of system_percpu_wq, because
  a per-cpu workload is not strictly needed.

- use WQ_UNBOUND instead of WQ_PERCPU, because this workload will benefit
  from unbound work.

- commits log integrated with commits about recent Workqueue API changes.

- work rebased on v6.18-rc4


Marco Crivellari (4):
  drm/amdgpu: replace use of system_unbound_wq with system_dfl_wq
  drm/amdgpu: replace use of system_wq with system_dfl_wq
  amd/amdkfd: add WQ_UNBOUND to alloc_workqueue users
  drm/radeon: add WQ_PERCPU to alloc_workqueue users

 drivers/gpu/drm/amd/amdgpu/aldebaran.c     | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
 drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c  | 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_process.c   | 3 ++-
 drivers/gpu/drm/radeon/radeon_display.c    | 3 ++-
 5 files changed, 9 insertions(+), 7 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v3 1/4] drm/amdgpu: replace use of system_unbound_wq with system_dfl_wq
  2025-12-24 14:47 [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND to alloc_workqueue users Marco Crivellari
@ 2025-12-24 14:47 ` Marco Crivellari
  2026-03-31 14:55   ` Alex Deucher
  2025-12-24 14:47 ` [PATCH v3 2/4] drm/amdgpu: replace use of system_wq " Marco Crivellari
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Marco Crivellari @ 2025-12-24 14:47 UTC (permalink / raw)
  To: linux-kernel, amd-gfx, dri-devel
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
	Alex Deucher, Christian Konig, David Airlie, Simona Vetter,
	Philip Yang

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 after a careful review and conversion of each individual
case, 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.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
---
 drivers/gpu/drm/amd/amdgpu/aldebaran.c     | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
index daa7b23bc775..a7bc65099755 100644
--- a/drivers/gpu/drm/amd/amdgpu/aldebaran.c
+++ b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
@@ -179,7 +179,7 @@ aldebaran_mode2_perform_reset(struct amdgpu_reset_control *reset_ctl,
 	list_for_each_entry(tmp_adev, reset_device_list, reset_list) {
 		/* For XGMI run all resets in parallel to speed up the process */
 		if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) {
-			if (!queue_work(system_unbound_wq,
+			if (!queue_work(system_dfl_wq,
 					&tmp_adev->reset_cntl->reset_work))
 				r = -EALREADY;
 		} else
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 12201b8e99b3..2ee416c36ca3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -6173,7 +6173,7 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,
 		list_for_each_entry(tmp_adev, device_list_handle, reset_list) {
 			/* For XGMI run all resets in parallel to speed up the process */
 			if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) {
-				if (!queue_work(system_unbound_wq,
+				if (!queue_work(system_dfl_wq,
 						&tmp_adev->xgmi_reset_work))
 					r = -EALREADY;
 			} else
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
index 28c4ad62f50e..9c4631608526 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
@@ -116,7 +116,7 @@ static int amdgpu_reset_xgmi_reset_on_init_perform_reset(
 	/* Mode1 reset needs to be triggered on all devices together */
 	list_for_each_entry(tmp_adev, reset_device_list, reset_list) {
 		/* For XGMI run all resets in parallel to speed up the process */
-		if (!queue_work(system_unbound_wq, &tmp_adev->xgmi_reset_work))
+		if (!queue_work(system_dfl_wq, &tmp_adev->xgmi_reset_work))
 			r = -EALREADY;
 		if (r) {
 			dev_err(tmp_adev->dev,
-- 
2.52.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v3 2/4] drm/amdgpu: replace use of system_wq with system_dfl_wq
  2025-12-24 14:47 [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND to alloc_workqueue users Marco Crivellari
  2025-12-24 14:47 ` [PATCH v3 1/4] drm/amdgpu: replace use of system_unbound_wq with system_dfl_wq Marco Crivellari
@ 2025-12-24 14:47 ` Marco Crivellari
  2025-12-24 14:47 ` [PATCH v3 3/4] amd/amdkfd: add WQ_UNBOUND to alloc_workqueue users Marco Crivellari
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Marco Crivellari @ 2025-12-24 14:47 UTC (permalink / raw)
  To: linux-kernel, amd-gfx, dri-devel
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
	Alex Deucher, Christian Konig, David Airlie, Simona Vetter,
	Philip Yang

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 after a careful review and conversion of each individual
case, 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.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 2ee416c36ca3..39170c04a519 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -4922,7 +4922,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 		}
 		/* must succeed. */
 		amdgpu_ras_resume(adev);
-		queue_delayed_work(system_wq, &adev->delayed_init_work,
+		queue_delayed_work(system_dfl_wq, &adev->delayed_init_work,
 				   msecs_to_jiffies(AMDGPU_RESUME_MS));
 	}
 
@@ -5469,7 +5469,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool notify_clients)
 	if (r)
 		goto exit;
 
-	queue_delayed_work(system_wq, &adev->delayed_init_work,
+	queue_delayed_work(system_dfl_wq, &adev->delayed_init_work,
 			   msecs_to_jiffies(AMDGPU_RESUME_MS));
 exit:
 	if (amdgpu_sriov_vf(adev)) {
-- 
2.52.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v3 3/4] amd/amdkfd: add WQ_UNBOUND to alloc_workqueue users
  2025-12-24 14:47 [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND to alloc_workqueue users Marco Crivellari
  2025-12-24 14:47 ` [PATCH v3 1/4] drm/amdgpu: replace use of system_unbound_wq with system_dfl_wq Marco Crivellari
  2025-12-24 14:47 ` [PATCH v3 2/4] drm/amdgpu: replace use of system_wq " Marco Crivellari
@ 2025-12-24 14:47 ` Marco Crivellari
  2025-12-24 14:47 ` [PATCH v3 4/4] drm/radeon: add WQ_PERCPU " Marco Crivellari
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 13+ messages in thread
From: Marco Crivellari @ 2025-12-24 14:47 UTC (permalink / raw)
  To: linux-kernel, amd-gfx, dri-devel
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
	Alex Deucher, Christian Konig, David Airlie, Simona Vetter,
	Philip Yang

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")

The refactoring is going to alter the default behavior of
alloc_workqueue() to be unbound by default.

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. For more details see the Link tag below.

This specific workload has no benefit being per-cpu, so its behavior has
been changed using explicitly WQ_UNBOUND.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_process.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
index a085faac9fe1..5ecdb338b390 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
@@ -690,7 +690,8 @@ void kfd_procfs_del_queue(struct queue *q)
 int kfd_process_create_wq(void)
 {
 	if (!kfd_process_wq)
-		kfd_process_wq = alloc_workqueue("kfd_process_wq", 0, 0);
+		kfd_process_wq = alloc_workqueue("kfd_process_wq", WQ_UNBOUND,
+						 0);
 	if (!kfd_restore_wq)
 		kfd_restore_wq = alloc_ordered_workqueue("kfd_restore_wq",
 							 WQ_FREEZABLE);
-- 
2.52.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v3 4/4] drm/radeon: add WQ_PERCPU to alloc_workqueue users
  2025-12-24 14:47 [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND to alloc_workqueue users Marco Crivellari
                   ` (2 preceding siblings ...)
  2025-12-24 14:47 ` [PATCH v3 3/4] amd/amdkfd: add WQ_UNBOUND to alloc_workqueue users Marco Crivellari
@ 2025-12-24 14:47 ` Marco Crivellari
  2026-03-31 14:49   ` Alex Deucher
  2026-02-04 16:23 ` [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND " Marco Crivellari
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 13+ messages in thread
From: Marco Crivellari @ 2025-12-24 14:47 UTC (permalink / raw)
  To: linux-kernel, amd-gfx, dri-devel
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Marco Crivellari, Michal Hocko,
	Alex Deucher, Christian Konig, David Airlie, Simona Vetter,
	Philip Yang

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")

The refactoring is going to alter the default behavior of
alloc_workqueue() to be unbound by default.

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. For more details see the Link tag below.

In order to keep alloc_workqueue() behavior identical, explicitly request
WQ_PERCPU.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
---
 drivers/gpu/drm/radeon/radeon_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 35fb99bcd9a7..99a3e4c480c1 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -685,7 +685,8 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
 	if (radeon_crtc == NULL)
 		return;
 
-	radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0);
+	radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc",
+						  WQ_HIGHPRI | WQ_PERCPU, 0);
 	if (!radeon_crtc->flip_queue) {
 		kfree(radeon_crtc);
 		return;
-- 
2.52.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND to alloc_workqueue users
  2025-12-24 14:47 [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND to alloc_workqueue users Marco Crivellari
                   ` (3 preceding siblings ...)
  2025-12-24 14:47 ` [PATCH v3 4/4] drm/radeon: add WQ_PERCPU " Marco Crivellari
@ 2026-02-04 16:23 ` Marco Crivellari
  2026-02-23  8:52 ` Marco Crivellari
  2026-03-31 10:39 ` Marco Crivellari
  6 siblings, 0 replies; 13+ messages in thread
From: Marco Crivellari @ 2026-02-04 16:23 UTC (permalink / raw)
  To: linux-kernel, amd-gfx, dri-devel
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Michal Hocko, Alex Deucher,
	Christian Konig, David Airlie, Simona Vetter, Philip Yang

On Wed, Dec 24, 2025 at 3:47 PM Marco Crivellari
<marco.crivellari@suse.com> wrote:
>[ ...]
> Marco Crivellari (4):
>   drm/amdgpu: replace use of system_unbound_wq with system_dfl_wq
>   drm/amdgpu: replace use of system_wq with system_dfl_wq
>   amd/amdkfd: add WQ_UNBOUND to alloc_workqueue users
>   drm/radeon: add WQ_PERCPU to alloc_workqueue users
>
>  drivers/gpu/drm/amd/amdgpu/aldebaran.c     | 2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c  | 2 +-
>  drivers/gpu/drm/amd/amdkfd/kfd_process.c   | 3 ++-
>  drivers/gpu/drm/radeon/radeon_display.c    | 3 ++-
>  5 files changed, 9 insertions(+), 7 deletions(-)

Gentle ping.

Thanks!



--

Marco Crivellari

L3 Support Engineer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND to alloc_workqueue users
  2025-12-24 14:47 [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND to alloc_workqueue users Marco Crivellari
                   ` (4 preceding siblings ...)
  2026-02-04 16:23 ` [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND " Marco Crivellari
@ 2026-02-23  8:52 ` Marco Crivellari
  2026-02-23 10:51   ` Christian König
  2026-03-31 10:39 ` Marco Crivellari
  6 siblings, 1 reply; 13+ messages in thread
From: Marco Crivellari @ 2026-02-23  8:52 UTC (permalink / raw)
  To: linux-kernel, amd-gfx, dri-devel
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Michal Hocko, Alex Deucher,
	Christian Konig, David Airlie, Simona Vetter, Philip Yang

On Wed, Dec 24, 2025 at 3:47 PM Marco Crivellari
<marco.crivellari@suse.com> wrote:
> [...]
> Marco Crivellari (4):
>   drm/amdgpu: replace use of system_unbound_wq with system_dfl_wq
>   drm/amdgpu: replace use of system_wq with system_dfl_wq
>   amd/amdkfd: add WQ_UNBOUND to alloc_workqueue users
>   drm/radeon: add WQ_PERCPU to alloc_workqueue users
>
>  drivers/gpu/drm/amd/amdgpu/aldebaran.c     | 2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c  | 2 +-
>  drivers/gpu/drm/amd/amdkfd/kfd_process.c   | 3 ++-
>  drivers/gpu/drm/radeon/radeon_display.c    | 3 ++-
>  5 files changed, 9 insertions(+), 7 deletions(-)

Gentle ping.

Thanks.

-- 

Marco Crivellari

L3 Support Engineer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND to alloc_workqueue users
  2026-02-23  8:52 ` Marco Crivellari
@ 2026-02-23 10:51   ` Christian König
  2026-03-13 14:30     ` Marco Crivellari
  0 siblings, 1 reply; 13+ messages in thread
From: Christian König @ 2026-02-23 10:51 UTC (permalink / raw)
  To: Marco Crivellari, linux-kernel, amd-gfx, dri-devel
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Michal Hocko, Alex Deucher,
	David Airlie, Simona Vetter, Philip Yang, Kuehling, Felix

On 2/23/26 09:52, Marco Crivellari wrote:
> On Wed, Dec 24, 2025 at 3:47 PM Marco Crivellari
> <marco.crivellari@suse.com> wrote:
>> [...]
>> Marco Crivellari (4):
>>   drm/amdgpu: replace use of system_unbound_wq with system_dfl_wq
>>   drm/amdgpu: replace use of system_wq with system_dfl_wq
>>   amd/amdkfd: add WQ_UNBOUND to alloc_workqueue users
>>   drm/radeon: add WQ_PERCPU to alloc_workqueue users
>>
>>  drivers/gpu/drm/amd/amdgpu/aldebaran.c     | 2 +-
>>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
>>  drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c  | 2 +-
>>  drivers/gpu/drm/amd/amdkfd/kfd_process.c   | 3 ++-
>>  drivers/gpu/drm/radeon/radeon_display.c    | 3 ++-
>>  5 files changed, 9 insertions(+), 7 deletions(-)
> 
> Gentle ping.

I don't have time to go over that again in detail, but skimming over it looks good to me.

Feel free to add Acked-by: Christian König <christian.koenig@amd.com> to the radeon and amdgpu patches.

Felix or Philip might want to check the amdkfd patches.

Regards,
Christian.

> 
> Thanks.
> 


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND to alloc_workqueue users
  2026-02-23 10:51   ` Christian König
@ 2026-03-13 14:30     ` Marco Crivellari
  0 siblings, 0 replies; 13+ messages in thread
From: Marco Crivellari @ 2026-03-13 14:30 UTC (permalink / raw)
  To: Christian König
  Cc: linux-kernel, amd-gfx, dri-devel, Tejun Heo, Lai Jiangshan,
	Frederic Weisbecker, Sebastian Andrzej Siewior, Michal Hocko,
	Alex Deucher, David Airlie, Simona Vetter, Philip Yang, Kuehling,
	Felix

On Mon, Feb 23, 2026 at 11:51 AM Christian König
<christian.koenig@amd.com> wrote:
> [...]
> I don't have time to go over that again in detail, but skimming over it looks good to me.
>
> Feel free to add Acked-by: Christian König <christian.koenig@amd.com> to the radeon and amdgpu patches.
>
> Felix or Philip might want to check the amdkfd patches.

Thanks for the ack, Christian!

-- 

Marco Crivellari

L3 Support Engineer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND to alloc_workqueue users
  2025-12-24 14:47 [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND to alloc_workqueue users Marco Crivellari
                   ` (5 preceding siblings ...)
  2026-02-23  8:52 ` Marco Crivellari
@ 2026-03-31 10:39 ` Marco Crivellari
  6 siblings, 0 replies; 13+ messages in thread
From: Marco Crivellari @ 2026-03-31 10:39 UTC (permalink / raw)
  To: linux-kernel, amd-gfx, dri-devel
  Cc: Tejun Heo, Lai Jiangshan, Frederic Weisbecker,
	Sebastian Andrzej Siewior, Michal Hocko, Alex Deucher,
	Christian Konig, David Airlie, Simona Vetter, Philip Yang

On Wed, Dec 24, 2025 at 3:47 PM Marco Crivellari
<marco.crivellari@suse.com> wrote:
> [...]
>
> Marco Crivellari (4):
>   drm/amdgpu: replace use of system_unbound_wq with system_dfl_wq
>   drm/amdgpu: replace use of system_wq with system_dfl_wq
>   amd/amdkfd: add WQ_UNBOUND to alloc_workqueue users
>   drm/radeon: add WQ_PERCPU to alloc_workqueue users
>
>  drivers/gpu/drm/amd/amdgpu/aldebaran.c     | 2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c  | 2 +-
>  drivers/gpu/drm/amd/amdkfd/kfd_process.c   | 3 ++-
>  drivers/gpu/drm/radeon/radeon_display.c    | 3 ++-
>  5 files changed, 9 insertions(+), 7 deletions(-)

Hi,

Gentle ping.

Thanks!

-- 

Marco Crivellari

L3 Support Engineer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 4/4] drm/radeon: add WQ_PERCPU to alloc_workqueue users
  2025-12-24 14:47 ` [PATCH v3 4/4] drm/radeon: add WQ_PERCPU " Marco Crivellari
@ 2026-03-31 14:49   ` Alex Deucher
  0 siblings, 0 replies; 13+ messages in thread
From: Alex Deucher @ 2026-03-31 14:49 UTC (permalink / raw)
  To: Marco Crivellari
  Cc: linux-kernel, amd-gfx, dri-devel, Tejun Heo, Lai Jiangshan,
	Frederic Weisbecker, Sebastian Andrzej Siewior, Michal Hocko,
	Alex Deucher, Christian Konig, David Airlie, Simona Vetter,
	Philip Yang

Applied.  Thanks!

Alex

On Wed, Dec 24, 2025 at 10:26 AM Marco Crivellari
<marco.crivellari@suse.com> wrote:
>
> 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")
>
> The refactoring is going to alter the default behavior of
> alloc_workqueue() to be unbound by default.
>
> 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. For more details see the Link tag below.
>
> In order to keep alloc_workqueue() behavior identical, explicitly request
> WQ_PERCPU.
>
> Suggested-by: Tejun Heo <tj@kernel.org>
> Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
> ---
>  drivers/gpu/drm/radeon/radeon_display.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
> index 35fb99bcd9a7..99a3e4c480c1 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -685,7 +685,8 @@ static void radeon_crtc_init(struct drm_device *dev, int index)
>         if (radeon_crtc == NULL)
>                 return;
>
> -       radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc", WQ_HIGHPRI, 0);
> +       radeon_crtc->flip_queue = alloc_workqueue("radeon-crtc",
> +                                                 WQ_HIGHPRI | WQ_PERCPU, 0);
>         if (!radeon_crtc->flip_queue) {
>                 kfree(radeon_crtc);
>                 return;
> --
> 2.52.0
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/4] drm/amdgpu: replace use of system_unbound_wq with system_dfl_wq
  2025-12-24 14:47 ` [PATCH v3 1/4] drm/amdgpu: replace use of system_unbound_wq with system_dfl_wq Marco Crivellari
@ 2026-03-31 14:55   ` Alex Deucher
  2026-03-31 14:56     ` Marco Crivellari
  0 siblings, 1 reply; 13+ messages in thread
From: Alex Deucher @ 2026-03-31 14:55 UTC (permalink / raw)
  To: Marco Crivellari
  Cc: linux-kernel, amd-gfx, dri-devel, Tejun Heo, Lai Jiangshan,
	Frederic Weisbecker, Sebastian Andrzej Siewior, Michal Hocko,
	Alex Deucher, Christian Konig, David Airlie, Simona Vetter,
	Philip Yang

Applied the series.  Thanks!

Alex

On Wed, Dec 24, 2025 at 10:06 AM Marco Crivellari
<marco.crivellari@suse.com> wrote:
>
> 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 after a careful review and conversion of each individual
> case, 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.
>
> Suggested-by: Tejun Heo <tj@kernel.org>
> Signed-off-by: Marco Crivellari <marco.crivellari@suse.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/aldebaran.c     | 2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c  | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
> index daa7b23bc775..a7bc65099755 100644
> --- a/drivers/gpu/drm/amd/amdgpu/aldebaran.c
> +++ b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
> @@ -179,7 +179,7 @@ aldebaran_mode2_perform_reset(struct amdgpu_reset_control *reset_ctl,
>         list_for_each_entry(tmp_adev, reset_device_list, reset_list) {
>                 /* For XGMI run all resets in parallel to speed up the process */
>                 if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) {
> -                       if (!queue_work(system_unbound_wq,
> +                       if (!queue_work(system_dfl_wq,
>                                         &tmp_adev->reset_cntl->reset_work))
>                                 r = -EALREADY;
>                 } else
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 12201b8e99b3..2ee416c36ca3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -6173,7 +6173,7 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,
>                 list_for_each_entry(tmp_adev, device_list_handle, reset_list) {
>                         /* For XGMI run all resets in parallel to speed up the process */
>                         if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) {
> -                               if (!queue_work(system_unbound_wq,
> +                               if (!queue_work(system_dfl_wq,
>                                                 &tmp_adev->xgmi_reset_work))
>                                         r = -EALREADY;
>                         } else
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
> index 28c4ad62f50e..9c4631608526 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
> @@ -116,7 +116,7 @@ static int amdgpu_reset_xgmi_reset_on_init_perform_reset(
>         /* Mode1 reset needs to be triggered on all devices together */
>         list_for_each_entry(tmp_adev, reset_device_list, reset_list) {
>                 /* For XGMI run all resets in parallel to speed up the process */
> -               if (!queue_work(system_unbound_wq, &tmp_adev->xgmi_reset_work))
> +               if (!queue_work(system_dfl_wq, &tmp_adev->xgmi_reset_work))
>                         r = -EALREADY;
>                 if (r) {
>                         dev_err(tmp_adev->dev,
> --
> 2.52.0
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/4] drm/amdgpu: replace use of system_unbound_wq with system_dfl_wq
  2026-03-31 14:55   ` Alex Deucher
@ 2026-03-31 14:56     ` Marco Crivellari
  0 siblings, 0 replies; 13+ messages in thread
From: Marco Crivellari @ 2026-03-31 14:56 UTC (permalink / raw)
  To: Alex Deucher
  Cc: linux-kernel, amd-gfx, dri-devel, Tejun Heo, Lai Jiangshan,
	Frederic Weisbecker, Sebastian Andrzej Siewior, Michal Hocko,
	Alex Deucher, Christian Konig, David Airlie, Simona Vetter,
	Philip Yang

On Tue, Mar 31, 2026 at 4:55 PM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> Applied the series.  Thanks!
>
> Alex

Many thanks!

-- 

Marco Crivellari

L3 Support Engineer

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-03-31 14:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-24 14:47 [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND to alloc_workqueue users Marco Crivellari
2025-12-24 14:47 ` [PATCH v3 1/4] drm/amdgpu: replace use of system_unbound_wq with system_dfl_wq Marco Crivellari
2026-03-31 14:55   ` Alex Deucher
2026-03-31 14:56     ` Marco Crivellari
2025-12-24 14:47 ` [PATCH v3 2/4] drm/amdgpu: replace use of system_wq " Marco Crivellari
2025-12-24 14:47 ` [PATCH v3 3/4] amd/amdkfd: add WQ_UNBOUND to alloc_workqueue users Marco Crivellari
2025-12-24 14:47 ` [PATCH v3 4/4] drm/radeon: add WQ_PERCPU " Marco Crivellari
2026-03-31 14:49   ` Alex Deucher
2026-02-04 16:23 ` [PATCH v3 0/4] Replace old wq name and add WQ_PERCPU and WQ_UNBOUND " Marco Crivellari
2026-02-23  8:52 ` Marco Crivellari
2026-02-23 10:51   ` Christian König
2026-03-13 14:30     ` Marco Crivellari
2026-03-31 10:39 ` 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®