Skip to contentSkip to conversation

drm/amdkfd: Disable MQD queue priority

PATCH Superseded Andrew Martin 2 participants 4 messages Feb 2 – Feb 11

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdkfd: Disable MQD queue priority

This solves a "priority inversion" issue, caused by the language runtime making high-priority queues wait for activity on lower-priority queues.

---
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +1 -1
index dcf4bbfa641b..bc4ceba35908 100644
@@ -106,7 +106,7 @@ static void update_cu_mask(struct mqd_manager *mm, void *mqd,
 static void set_priority(struct v9_mqd *m, struct queue_properties *q)
 {
 	m->cp_hqd_pipe_priority = pipe_priority_map[q->priority];
-	m->cp_hqd_queue_priority = q->priority;
+	/* m->cp_hqd_queue_priority = q->priority; */
 }
 
 static bool mqd_on_vram(struct amdgpu_device *adev)
Signature · 1 line
2.43.0
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Greetings @Kuehling, Felix, sending peace.

I want to draw your attention to this 1-line change, multiple customers would love to have it in. Lot of details are on SWDEV-548025.

One love!

Quoted 32 lines

-----Original Message-----
From: Martin, Andrew <[email protected]>
Sent: Monday, February 2, 2026 5:53 AM
To: [email protected]
Cc: Cornwall, Jay <[email protected]>; Greathouse, Joseph <[email protected]>; Martin, Andrew <[email protected]>
Subject: [PATCH] drm/amdkfd: Disable MQD queue priority

This solves a "priority inversion" issue, caused by the language runtime making high-priority queues wait for activity on lower-priority queues.

---
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +1 -2
index dcf4bbfa641b..bc4ceba35908 100644
@@ -106,7 +106,7 @@ static void update_cu_mask(struct mqd_manager
 *mm, void *mqd,  static void set_priority(struct v9_mqd *m, struct
 queue_properties *q)  {
      m->cp_hqd_pipe_priority = pipe_priority_map[q->priority];
-     m->cp_hqd_queue_priority = q->priority;
+     /* m->cp_hqd_queue_priority = q->priority; */
 }
 
 static bool mqd_on_vram(struct amdgpu_device *adev)
--

2.43.0

maintainer
#2 lore raw
In reply to Andrew Martin
Quoted 1 line · Andrew Martin

This solves a "priority inversion" issue, caused by the language

Why the quotes?

Quoted 2 lines

runtime making high-priority queues wait for activity on lower-priority queues.

Is this problem specific to GFX9? Otherwise, an equivalent fix should be implemented in other versions of the MQD manager as well.

Quoted 11 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +0 -0
index dcf4bbfa641b..bc4ceba35908 100644

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c static void update_cu_mask(struct mqd_manager *mm, void *mqd, · line 109

Quoted 5 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +1 -1
@@ -106,7 +106,7 @@ static void update_cu_mask(struct mqd_manager *mm, void *mqd,
  static void set_priority(struct v9_mqd *m, struct queue_properties *q)
  {
  	m->cp_hqd_pipe_priority = pipe_priority_map[q->priority];
-	m->cp_hqd_queue_priority = q->priority;
+	/* m->cp_hqd_queue_priority = q->priority; */

Please don't leave commented out lines in the code. That's what git history is for.

Regards,
  Felix

Quoted 3 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +0 -0
  }
 
  static bool mqd_on_vram(struct amdgpu_device *adev)
#3 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Felix, thanks for the reply. See comments inline

Quoted 10 lines

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Wednesday, February 11, 2026 4:11 PM
To: [email protected]; Martin, Andrew <[email protected]>
Cc: Cornwall, Jay <[email protected]>; Greathouse, Joseph <[email protected]>
Subject: Re: [PATCH] drm/amdkfd: Disable MQD queue priority

Quoted 4 lines
Quoted 1 line · Andrew Martin

This solves a "priority inversion" issue, caused by the language

Why the quotes?

Consider them dropped from the next git commit, it was just to highlight the phrase.

Quoted 8 lines
Quoted 4 lines

runtime making high-priority queues wait for activity on lower-priority queues.

Is this problem specific to GFX9? Otherwise, an equivalent fix should be implemented in other versions of the MQD manager as well.

No, it is not specific to GFX9, so I will broaden the change on the next patch. I will get that out tomorrow.

Quoted 30 lines

Review

Quoted 8 lines
---
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c static void update_cu_mask(struct mqd_manager

Quoted 4 lines

index dcf4bbfa641b..bc4ceba35908 100644

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +0 -0
@@ -106,7 +106,7 @@ static void update_cu_mask(struct mqd_manager

*mm, void *mqd,

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c static void update_cu_mask(struct mqd_manager *mm, void *mqd, · line 109

Quoted 5 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +1 -1
  static void set_priority(struct v9_mqd *m, struct queue_properties *q)
  {
    m->cp_hqd_pipe_priority = pipe_priority_map[q->priority];
-   m->cp_hqd_queue_priority = q->priority;
+   /* m->cp_hqd_queue_priority = q->priority; */

Please don't leave commented out lines in the code. That's what git history is for.

Regards,
Felix

Quoted 3 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +0 -0
  }
 
  static bool mqd_on_vram(struct amdgpu_device *adev)