drm/amdkfd: Disable MQD queue priority
Subsystems (3)
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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.
Signed-off-by Andrew Martin <[email protected]>--- 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
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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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,
[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
Reviewed-by Felix Kuehling <[email protected]>
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 prioritydrivers/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.
Signed-off-by Andrew Martin <[email protected]>--- 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@@ -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
-1static 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
Reviewed-by Felix Kuehling <[email protected]>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.cindex97055f808d4a..0186b3de67c0100644drivers/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
-0static 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.cindex7e5a7ab6d0c0..c9e397366782100644drivers/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
-0static 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.cindexa51f217329db..3bbc2648f51d100644drivers/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
-0static 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.cindexd0776ba2cc99..0d6b601962eb100644drivers/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
-0static 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
indexdcf4bbfa641b..bc4ceba35908100644drivers/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
-1static 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.cb/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
index09483f0862d4..e63ef6442b35100644drivers/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
-1static 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,