Skip to contentSkip to conversation

drm/amdkfd: Disable MQD queue priority

PATCH In review Andrew Martin 2 participants 3 messages Feb 12 – Feb 13

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 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_cik.c   | 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c   | 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c   | 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c   | 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c | 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c    | 2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c    | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c +1 -1
index 90ac3a30e81d..76483d91af98 100644
@@ -70,7 +70,7 @@ static void update_cu_mask(struct mqd_manager *mm, void *mqd,
 static void set_priority(struct cik_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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +1 -1
index 97055f808d4a..0186b3de67c0 100644
@@ -70,7 +70,7 @@ static void update_cu_mask(struct mqd_manager *mm, void *mqd,
 static void set_priority(struct v10_compute_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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c +1 -1
index 7e5a7ab6d0c0..c9e397366782 100644
@@ -96,7 +96,7 @@ static void update_cu_mask(struct mqd_manager *mm, void *mqd,
 static void set_priority(struct v11_compute_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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c +1 -1
index a51f217329db..3bbc2648f51d 100644
@@ -77,7 +77,7 @@ static void update_cu_mask(struct mqd_manager *mm, void *mqd,
 static void set_priority(struct v12_compute_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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c +1 -1
index d0776ba2cc99..0d6b601962eb 100644
@@ -131,7 +131,7 @@ static void update_cu_mask(struct mqd_manager *mm, void *mqd,
 static void set_priority(struct v12_1_compute_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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
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)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c +1 -1
index 09483f0862d4..e63ef6442b35 100644
@@ -73,7 +73,7 @@ static void update_cu_mask(struct mqd_manager *mm, void *mqd,
 static void set_priority(struct vi_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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 20 lines · Andrew Martin

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_cik.c   | 2 +-
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c   | 2 +-
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c   | 2 +-
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c   | 2 +-
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c | 2 +-
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c    | 2 +-
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c    | 2 +-
  7 files changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c +0 -0
index 90ac3a30e81d..76483d91af98 100644

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

Quoted 5 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c +1 -1
@@ -70,7 +70,7 @@ static void update_cu_mask(struct mqd_manager *mm, void *mqd,
  static void set_priority(struct cik_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 remove the commented out lines here and in the other files. With that fixed, the patch is

Quoted 81 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c +0 -0
  }
 
  static struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +1 -1
index 97055f808d4a..0186b3de67c0 100644
@@ -70,7 +70,7 @@ static void update_cu_mask(struct mqd_manager *mm, void *mqd,
  static void set_priority(struct v10_compute_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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c +1 -1
index 7e5a7ab6d0c0..c9e397366782 100644
@@ -96,7 +96,7 @@ static void update_cu_mask(struct mqd_manager *mm, void *mqd,
  static void set_priority(struct v11_compute_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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c +1 -1
index a51f217329db..3bbc2648f51d 100644
@@ -77,7 +77,7 @@ static void update_cu_mask(struct mqd_manager *mm, void *mqd,
  static void set_priority(struct v12_compute_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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c +1 -1
index d0776ba2cc99..0d6b601962eb 100644
@@ -131,7 +131,7 @@ static void update_cu_mask(struct mqd_manager *mm, void *mqd,
  static void set_priority(struct v12_1_compute_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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
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)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c +1 -1
index 09483f0862d4..e63ef6442b35 100644
@@ -73,7 +73,7 @@ static void update_cu_mask(struct mqd_manager *mm, void *mqd,
  static void set_priority(struct vi_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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,
#2 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Greetings @Kuehling, Felix

Quoted 4 lines

Please remove the commented out lines here and in the other files. With that fixed, the patch is

Thanks, will do!

One love.

Quoted 142 lines

-----Original Message-----
From: Kuehling, Felix <[email protected]>
Sent: Friday, February 13, 2026 10:59 AM
To: Martin, Andrew <[email protected]>; amd- [email protected]
Cc: Cornwall, Jay <[email protected]>; Greathouse, Joseph <[email protected]>
Subject: Re: [PATCH v2] drm/amdkfd: Disable MQD queue priority

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c static void update_cu_mask(struct mqd_manager *mm,

Quoted 21 lines · Andrew Martin

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_cik.c   | 2 +-
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c   | 2 +-
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c   | 2 +-
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c   | 2 +-
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c | 2 +-
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c    | 2 +-
  drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c    | 2 +-
  7 files changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c +0 -0
index 90ac3a30e81d..76483d91af98 100644
@@ -70,7 +70,7 @@ static void update_cu_mask(struct mqd_manager *mm,

void *mqd,

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

Quoted 5 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c +1 -1
  static void set_priority(struct cik_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 remove the commented out lines here and in the other files. With that fixed, the patch is

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c static void update_cu_mask(struct mqd_manager *mm,

Quoted 9 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c +0 -1
  }
 
  static struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm, diff
--git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c

b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c index 97055f808d4a..0186b3de67c0 100644

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +0 -0
@@ -70,7 +70,7 @@ static void update_cu_mask(struct mqd_manager *mm,

void *mqd,

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c static void update_cu_mask(struct mqd_manager *mm, · line 70

Quoted 1 line
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +0 -0
  static void set_priority(struct v10_compute_mqd *m, struct

queue_properties *q)

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c static void update_cu_mask(struct mqd_manager *mm,

Quoted 13 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +1 -2
  {
    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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm, diff
--git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c

b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c index 7e5a7ab6d0c0..c9e397366782 100644

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c +0 -0
@@ -96,7 +96,7 @@ static void update_cu_mask(struct mqd_manager *mm,

void *mqd,

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c static void update_cu_mask(struct mqd_manager *mm, · line 96

Quoted 1 line
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c +0 -0
  static void set_priority(struct v11_compute_mqd *m, struct

queue_properties *q)

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c static void update_cu_mask(struct mqd_manager *mm,

Quoted 13 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c +1 -2
  {
    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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm, diff
--git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c

b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c index a51f217329db..3bbc2648f51d 100644

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c +0 -0
@@ -77,7 +77,7 @@ static void update_cu_mask(struct mqd_manager *mm,

void *mqd,

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c static void update_cu_mask(struct mqd_manager *mm, · line 77

Quoted 1 line
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c +0 -0
  static void set_priority(struct v12_compute_mqd *m, struct

queue_properties *q)

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

Quoted 13 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12.c +1 -2
  {
    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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm, diff
--git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c

b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c index d0776ba2cc99..0d6b601962eb 100644

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

*mm, void *mqd,

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c static void update_cu_mask(struct mqd_manager · line 131

Quoted 1 line
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c +0 -0
  static void set_priority(struct v12_1_compute_mqd *m, struct

queue_properties *q)

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

Quoted 13 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v12_1.c +1 -2
  {
    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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm, diff
--git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c

b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
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_vi.c static void update_cu_mask(struct mqd_manager *mm,

Quoted 14 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; */
  }
 
  static bool mqd_on_vram(struct amdgpu_device *adev) diff --git

a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
index 09483f0862d4..e63ef6442b35 100644

drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c +0 -0
@@ -73,7 +73,7 @@ static void update_cu_mask(struct mqd_manager *mm,

void *mqd,

Quoted 8 lines
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c +1 -1
  static void set_priority(struct vi_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 struct kfd_mem_obj *allocate_mqd(struct mqd_manager *mm,