Skip to content

Commit 7413e9f

Browse files
mbrost05Lucas De Marchi
authored andcommitted
drm/xe: Handle mixed mappings and existing VRAM on atomic faults
Moving to VRAM will fail if mixed mappings are present or if the page is already located in VRAM. Atomic faults that require a move to VRAM currently retry without attempting to evict mixed mappings or locate existing VRAM mappings. This patch fixes the issue by attempting to evict mixed mappings or find existing VRAM pages when a move to VRAM fails during atomic fault handling. Fixes: a9ac0fa ("drm/xe: Strict migration policy for atomic SVM faults") Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Link: https://lore.kernel.org/r/20251009130629.3531962-1-matthew.brost@intel.com (cherry picked from commit 7518860) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 1117e7d commit 7413e9f

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

drivers/gpu/drm/xe/xe_svm.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,17 @@ static int __xe_svm_handle_pagefault(struct xe_vm *vm, struct xe_vma *vma,
10731073
drm_dbg(&vm->xe->drm,
10741074
"VRAM allocation failed, falling back to retrying fault, asid=%u, errno=%pe\n",
10751075
vm->usm.asid, ERR_PTR(err));
1076-
goto retry;
1076+
1077+
/*
1078+
* In the devmem-only case, mixed mappings may
1079+
* be found. The get_pages function will fix
1080+
* these up to a single location, allowing the
1081+
* page fault handler to make forward progress.
1082+
*/
1083+
if (ctx.devmem_only)
1084+
goto get_pages;
1085+
else
1086+
goto retry;
10771087
} else {
10781088
drm_err(&vm->xe->drm,
10791089
"VRAM allocation failed, retry count exceeded, asid=%u, errno=%pe\n",
@@ -1083,6 +1093,7 @@ static int __xe_svm_handle_pagefault(struct xe_vm *vm, struct xe_vma *vma,
10831093
}
10841094
}
10851095

1096+
get_pages:
10861097
get_pages_start = xe_svm_stats_ktime_get();
10871098

10881099
range_debug(range, "GET PAGES");

0 commit comments

Comments
 (0)