Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdkfd: use a high priority workqueue for IH work

In systems under heavy load the IH work may experience significant
scheduling delays.

Under load + system workqueue:
Max Latency: 7.023695 ms
Avg Latency: 0.263994 ms

Under load + high priority workqueue:
Max Latency: 1.162568 ms
Avg Latency: 0.163213 ms

Further work is required to measure the impact of per-cpu settings on IH
performance.

Signed-off-by: Andres Rodriguez <andres.rodriguez@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>

authored by

Andres Rodriguez and committed by
Oded Gabbay
48e876a2 0f875e3f

+4 -2
+1 -1
drivers/gpu/drm/amd/amdkfd/kfd_device.c
··· 403 403 if (kfd->interrupts_active 404 404 && interrupt_is_wanted(kfd, ih_ring_entry) 405 405 && enqueue_ih_ring_entry(kfd, ih_ring_entry)) 406 - schedule_work(&kfd->interrupt_work); 406 + queue_work(kfd->ih_wq, &kfd->interrupt_work); 407 407 408 408 spin_unlock(&kfd->interrupt_lock); 409 409 }
+2 -1
drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c
··· 61 61 return r; 62 62 } 63 63 64 + kfd->ih_wq = alloc_workqueue("KFD IH", WQ_HIGHPRI, 1); 64 65 spin_lock_init(&kfd->interrupt_lock); 65 66 66 67 INIT_WORK(&kfd->interrupt_work, interrupt_wq); ··· 96 95 * work-queue items that will access interrupt_ring. New work items 97 96 * can't be created because we stopped interrupt handling above. 98 97 */ 99 - flush_work(&kfd->interrupt_work); 98 + flush_workqueue(kfd->ih_wq); 100 99 101 100 kfifo_free(&kfd->ih_fifo); 102 101 }
+1
drivers/gpu/drm/amd/amdkfd/kfd_priv.h
··· 184 184 185 185 /* Interrupts */ 186 186 struct kfifo ih_fifo; 187 + struct workqueue_struct *ih_wq; 187 188 struct work_struct interrupt_work; 188 189 spinlock_t interrupt_lock; 189 190