summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_gt_pagefault.c
diff options
context:
space:
mode:
authorMatthew Brost <matthew.brost@intel.com>2024-09-17 22:44:36 -0700
committerLucas De Marchi <lucas.demarchi@intel.com>2024-10-03 01:13:54 -0500
commitd1ef967126e295d36201e79ec64efdba31710353 (patch)
tree5425b6da21ac48ceded381101756dd8275853e7c /drivers/gpu/drm/xe/xe_gt_pagefault.c
parentcb58977016d1b25781743e5fbe6a545493785e37 (diff)
drm/xe: Convert to USM lock to rwsem
Remove contention from GPU fault path for ASID->VM lookup. Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240918054436.1971839-1-matthew.brost@intel.com (cherry picked from commit 1378c633a3fbfeb344c486ffda0e920a21e62712) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_gt_pagefault.c')
-rw-r--r--drivers/gpu/drm/xe/xe_gt_pagefault.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault.c b/drivers/gpu/drm/xe/xe_gt_pagefault.c
index 00af059a8971..5c3af2bb5402 100644
--- a/drivers/gpu/drm/xe/xe_gt_pagefault.c
+++ b/drivers/gpu/drm/xe/xe_gt_pagefault.c
@@ -198,13 +198,13 @@ static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf)
return -EFAULT;
/* ASID to VM */
- mutex_lock(&xe->usm.lock);
+ down_read(&xe->usm.lock);
vm = xa_load(&xe->usm.asid_to_vm, pf->asid);
if (vm && xe_vm_in_fault_mode(vm))
xe_vm_get(vm);
else
vm = NULL;
- mutex_unlock(&xe->usm.lock);
+ up_read(&xe->usm.lock);
if (!vm)
return -EINVAL;
@@ -549,11 +549,11 @@ static int handle_acc(struct xe_gt *gt, struct acc *acc)
return -EINVAL;
/* ASID to VM */
- mutex_lock(&xe->usm.lock);
+ down_read(&xe->usm.lock);
vm = xa_load(&xe->usm.asid_to_vm, acc->asid);
if (vm)
xe_vm_get(vm);
- mutex_unlock(&xe->usm.lock);
+ up_read(&xe->usm.lock);
if (!vm || !xe_vm_in_fault_mode(vm))
return -EINVAL;