Skip to contentSkip to conversation

drm/amd: Replace system_unbound_wq with system_dfl_wq

PATCH Applied Marco Crivellari 2 participants 5 messages May 14 – May 18

Subsystems (3)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover drm/amd: Replace system_unbound_wq with system_dfl_wq

Hello,

Months ago we started a refactoring work about workqueue, still ongoing. Recent changes in drm/amd/ code still uses the old workqueue names instead of the newer added. This series addresses this, without introducing change of behavior.

=== 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 ===

Replace system_unbound_wq with system_dfl_wq, without change of behavior. system_unbound_wq will be removed in a future release cycle.

Thanks!

Marco Crivellari (2):
drm/amd/display: Replace use of system_unbound_wq with system_dfl_wq drm/amdgpu: Replace use of system_unbound_wq with system_dfl_wq

 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c      | 2 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
2.54.0
#1 lore raw

PATCH 1/2 drm/amd/display: Replace use of system_unbound_wq with system_dfl_wq

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.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_ism.c +3 -3
index a64e95860e99..e83f7f71e242 100644
@@ -383,7 +383,7 @@ static enum amdgpu_dm_ism_event dm_ism_dispatch_power_state(
 		}
 
 		/* Schedule worker */
-		mod_delayed_work(system_unbound_wq, &ism->delayed_work,
+		mod_delayed_work(system_dfl_wq, &ism->delayed_work,
 				 nsecs_to_jiffies(delay_ns));
 
 		break;
@@ -399,14 +399,14 @@ static enum amdgpu_dm_ism_event dm_ism_dispatch_power_state(
 			 * have a negative power impact. Skip idle allow here,
 			 * and let the sso_delayed_work handle it.
 			 */
-			mod_delayed_work(system_unbound_wq,
+			mod_delayed_work(system_dfl_wq,
 					 &ism->sso_delayed_work,
 					 nsecs_to_jiffies(sso_delay_ns));
 		} else {
 			/* Enable idle optimization without SSO */
 			dm_ism_commit_idle_optimization_state(
 				ism, acrtc_state->stream, false, false);
-			mod_delayed_work(system_unbound_wq,
+			mod_delayed_work(system_dfl_wq,
 					 &ism->sso_delayed_work,
 					 nsecs_to_jiffies(sso_delay_ns));
 		}
Signature · 1 line
2.54.0
#2 lore raw

PATCH 2/2 drm/amdgpu: Replace use of system_unbound_wq with system_dfl_wq

In reply to Marco Crivellari

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.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c +1 -1
index d386bc775d03..0811593fca7f 100644
@@ -586,7 +586,7 @@ void amdgpu_coredump(struct amdgpu_device *adev, bool skip_vram_check,
 	 */
 	adev->coredump = coredump;
 	/* Kick off coredump formatting to a worker thread. */
-	queue_work(system_unbound_wq, &adev->coredump_work);
+	queue_work(system_dfl_wq, &adev->coredump_work);
 
 	drm_info(dev, "AMDGPU device coredump file has been created\n");
 	drm_info(dev, "Check your /sys/class/drm/card%d/device/devcoredump/data\n",
Signature · 1 line
2.54.0
Applied
#3 lore raw

Re: [PATCH 2/2] drm/amdgpu: Replace use of system_unbound_wq with system_dfl_wq

Quoted 17 lines · Marco Crivellari

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
Quoted 6 lines

This way the old obsolete workqueues (system_wq, system_unbound_wq) can be removed in the future.

Applied the series. Thanks!

Alex

Quoted 20 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c +1 -2
index d386bc775d03..0811593fca7f 100644
@@ -586,7 +586,7 @@ void amdgpu_coredump(struct amdgpu_device *adev, bool skip_vram_check,
         */
        adev->coredump = coredump;
        /* Kick off coredump formatting to a worker thread. */
-       queue_work(system_unbound_wq, &adev->coredump_work);
+       queue_work(system_dfl_wq, &adev->coredump_work);
 
        drm_info(dev, "AMDGPU device coredump file has been created\n");
        drm_info(dev, "Check your /sys/class/drm/card%d/device/devcoredump/data\n",
--

2.54.0

#4 lore raw

Re: [PATCH 2/2] drm/amdgpu: Replace use of system_unbound_wq with system_dfl_wq

Quoted 2 lines · Alex Deucher

[...]
Applied the series. Thanks!

Many thanks!

Signature · 3 lines
Marco Crivellari

SUSE Labs