drm/amdkfd: Reliably prevent reclaim-FS while holding DQM lock
authorFelix Kuehling <Felix.Kuehling@amd.com>
Thu, 12 Jul 2018 02:32:44 +0000 (22:32 -0400)
committerOded Gabbay <oded.gabbay@gmail.com>
Thu, 12 Jul 2018 02:32:44 +0000 (22:32 -0400)
commitefeaed4d98eb4dc9ce01e1dca6d3778d180b272c
treec86bc91ff25f05acbc6071d8cb7df8e529ccf91b
parent0337976f40b0a9605c24797762b95b3414619d71
drm/amdkfd: Reliably prevent reclaim-FS while holding DQM lock

This is needed to prevent deadlocks when MMU notifiers run in
reclaim-FS context and take the DQM lock for userptr evictions.
Previously this was done by making all memory allocations under
DQM locks GFP_NOIO. This is error prone. Using
memalloc_nofs_save/restore will reliably affect all memory
allocations anywhere in the kernel while the DQM lock is held.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h