diff options
author | 2017-10-12 16:46:26 -0400 | |
---|---|---|
committer | 2017-12-04 16:33:11 -0500 | |
commit | 83f4b1180155f2d65472ce943a1f051215030560 (patch) | |
tree | 6e9a6740c8bb3f720ac65a480e5ec347c278d240 /drivers/gpu/drm/amd/scheduler/gpu_scheduler.h | |
parent | drm/amdgpu: Add SPSC queue to scheduler. (diff) | |
download | linux-dev-83f4b1180155f2d65472ce943a1f051215030560.tar.xz linux-dev-83f4b1180155f2d65472ce943a1f051215030560.zip |
drm/amdgpu: Fix deadlock during GPU reset.
Bug:
Kfifo is limited at size, during GPU reset it would fill up to limit
and the pushing thread (producer) would wait for the scheduler worker to
consume the items in the fifo while holding reservation lock
on a BO. The gpu reset thread on the other hand blocks the scheduler
during reset. Before it unblocks the sceduler it might want
to recover VRAM and so will try to reserve the same BO the producer
thread is already holding creating a deadlock.
Fix:
Switch from kfifo to SPSC queue which is unlimited in size.
Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/scheduler/gpu_scheduler.h')
-rw-r--r-- | drivers/gpu/drm/amd/scheduler/gpu_scheduler.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h index be75172587da..f9e3a83cddc6 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h @@ -26,6 +26,7 @@ #include <linux/kfifo.h> #include <linux/dma-fence.h> +#include "spsc_queue.h" struct amd_gpu_scheduler; struct amd_sched_rq; @@ -56,7 +57,7 @@ struct amd_sched_entity { struct amd_gpu_scheduler *sched; spinlock_t queue_lock; - struct kfifo job_queue; + struct spsc_queue job_queue; atomic_t fence_seq; uint64_t fence_context; @@ -88,6 +89,7 @@ struct amd_sched_fence { }; struct amd_sched_job { + struct spsc_node queue_node; struct amd_gpu_scheduler *sched; struct amd_sched_entity *s_entity; struct amd_sched_fence *s_fence; |