[Intel-xe] [PATCH 1/1] drm/xe: don't repin a userptr if mm is closed
Matthew Brost
matthew.brost at intel.com
Thu Oct 5 18:39:46 UTC 2023
On Wed, Oct 04, 2023 at 04:47:21PM -0700, fei.yang at intel.com wrote:
> From: Fei Yang <fei.yang at intel.com>
>
> Ran into a problem where xe_vma_userptr_pin_pages failed with -EFAULT
> due to the mmu_notifier.mm had been closed. In such case, the userptr
> vma should not had been added to the invalidated list in the first
> place.
>
A few questions here. First how / where did you hit this problem? i.e.
What IGT test or UMD? What platform? How often can you reproduce this?
Do you have a dmesg or other debug info?
Also by design xe_vma_userptr_pin_pages returns -EFAULT when the mm is
closed from a kthread which seems correct. Is this the case you are
hitting? If so, unsure if this is a problem.
Matt
> Signed-off-by: Fei Yang <fei.yang at intel.com>
> ---
> drivers/gpu/drm/xe/xe_vm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index ea17d026546c..14ba3fb9defd 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -715,11 +715,13 @@ static bool vma_userptr_invalidate(struct mmu_interval_notifier *mni,
> * userptr.
> */
> if (!xe_vm_in_fault_mode(vm) &&
> + mmget_not_zero(vma->userptr.notifier.mm) &&
> !(vma->gpuva.flags & XE_VMA_DESTROYED) && vma->tile_present) {
> spin_lock(&vm->userptr.invalidated_lock);
> list_move_tail(&vma->userptr.invalidate_link,
> &vm->userptr.invalidated);
> spin_unlock(&vm->userptr.invalidated_lock);
> + mmput(vma->userptr.notifier.mm);
> }
>
> up_write(&vm->userptr.notifier_lock);
> --
> 2.25.1
>
More information about the Intel-xe
mailing list