Commit 48e876a2 authored by Andres Rodriguez's avatar Andres Rodriguez Committed by Oded Gabbay

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: default avatarAndres Rodriguez <andres.rodriguez@amd.com>
Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Acked-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
parent 0f875e3f
...@@ -403,7 +403,7 @@ void kgd2kfd_interrupt(struct kfd_dev *kfd, const void *ih_ring_entry) ...@@ -403,7 +403,7 @@ void kgd2kfd_interrupt(struct kfd_dev *kfd, const void *ih_ring_entry)
if (kfd->interrupts_active if (kfd->interrupts_active
&& interrupt_is_wanted(kfd, ih_ring_entry) && interrupt_is_wanted(kfd, ih_ring_entry)
&& enqueue_ih_ring_entry(kfd, ih_ring_entry)) && enqueue_ih_ring_entry(kfd, ih_ring_entry))
schedule_work(&kfd->interrupt_work); queue_work(kfd->ih_wq, &kfd->interrupt_work);
spin_unlock(&kfd->interrupt_lock); spin_unlock(&kfd->interrupt_lock);
} }
......
...@@ -61,6 +61,7 @@ int kfd_interrupt_init(struct kfd_dev *kfd) ...@@ -61,6 +61,7 @@ int kfd_interrupt_init(struct kfd_dev *kfd)
return r; return r;
} }
kfd->ih_wq = alloc_workqueue("KFD IH", WQ_HIGHPRI, 1);
spin_lock_init(&kfd->interrupt_lock); spin_lock_init(&kfd->interrupt_lock);
INIT_WORK(&kfd->interrupt_work, interrupt_wq); INIT_WORK(&kfd->interrupt_work, interrupt_wq);
...@@ -95,7 +96,7 @@ void kfd_interrupt_exit(struct kfd_dev *kfd) ...@@ -95,7 +96,7 @@ void kfd_interrupt_exit(struct kfd_dev *kfd)
* work-queue items that will access interrupt_ring. New work items * work-queue items that will access interrupt_ring. New work items
* can't be created because we stopped interrupt handling above. * can't be created because we stopped interrupt handling above.
*/ */
flush_work(&kfd->interrupt_work); flush_workqueue(kfd->ih_wq);
kfifo_free(&kfd->ih_fifo); kfifo_free(&kfd->ih_fifo);
} }
......
...@@ -184,6 +184,7 @@ struct kfd_dev { ...@@ -184,6 +184,7 @@ struct kfd_dev {
/* Interrupts */ /* Interrupts */
struct kfifo ih_fifo; struct kfifo ih_fifo;
struct workqueue_struct *ih_wq;
struct work_struct interrupt_work; struct work_struct interrupt_work;
spinlock_t interrupt_lock; spinlock_t interrupt_lock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment