]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdkfd: Fix recursive lock warnings
authorFelix Kuehling <Felix.Kuehling@amd.com>
Thu, 11 Mar 2021 02:42:01 +0000 (21:42 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:52:36 +0000 (10:52 +0200)
[ Upstream commit 7816e4a98ce3bc7c562807240b4f14171e177420 ]

memalloc_nofs_save/restore are no longer sufficient to prevent recursive
lock warnings when holding locks that can be taken in MMU notifiers. Use
memalloc_noreclaim_save/restore instead.

Fixes: f920e413ff9c ("mm: track mmu notifiers in fs_reclaim_acquire/release")
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index adbfd1d227a5a776b48f258ad5eb9c1ec9536b58..a566bbe26bdd8d1fe169fde05a81902d78841906 100644 (file)
@@ -92,13 +92,13 @@ struct amdgpu_prt_cb {
 static inline void amdgpu_vm_eviction_lock(struct amdgpu_vm *vm)
 {
        mutex_lock(&vm->eviction_lock);
-       vm->saved_flags = memalloc_nofs_save();
+       vm->saved_flags = memalloc_noreclaim_save();
 }
 
 static inline int amdgpu_vm_eviction_trylock(struct amdgpu_vm *vm)
 {
        if (mutex_trylock(&vm->eviction_lock)) {
-               vm->saved_flags = memalloc_nofs_save();
+               vm->saved_flags = memalloc_noreclaim_save();
                return 1;
        }
        return 0;
@@ -106,7 +106,7 @@ static inline int amdgpu_vm_eviction_trylock(struct amdgpu_vm *vm)
 
 static inline void amdgpu_vm_eviction_unlock(struct amdgpu_vm *vm)
 {
-       memalloc_nofs_restore(vm->saved_flags);
+       memalloc_noreclaim_restore(vm->saved_flags);
        mutex_unlock(&vm->eviction_lock);
 }