]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdkfd: Fix retry fault drain race conditions
authorFelix Kuehling <Felix.Kuehling@amd.com>
Fri, 5 Nov 2021 14:52:53 +0000 (10:52 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Nov 2021 22:08:00 +0000 (17:08 -0500)
commitc0a811bd2eeed43250454b85f90f2cffa0a60871
treef9196616651016c847b943bbfe5e59b90df986fa
parent5d464924c6ce6a6241b584bdf03916646c5e52a8
drm/amdkfd: Fix retry fault drain race conditions

The check for whether to drain retry faults must be under the mmap write
lock to serialize with munmap notifier callbacks.

We were also missing checks on child ranges. To fix that, simplify the
logic by using a flag rather than checking on each prange. That also
allows draining less freqeuntly when many ranges are unmapped at once.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Tested-by: Philip Yang <Philip.Yang@amd.com>
Tested-by: Alex Sierra <Alex.Sierra@amd.com>
Reviewed-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_priv.h
drivers/gpu/drm/amd/amdkfd/kfd_svm.c