From: Matthew Brost <matthew.brost@intel.com>
To: <fei.yang@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH 1/1] drm/xe: don't repin a userptr if mm is closed
Date: Thu, 5 Oct 2023 18:39:46 +0000 [thread overview]
Message-ID: <ZR8C8tLFOKBihlmr@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20231004234721.2076190-2-fei.yang@intel.com>
On Wed, Oct 04, 2023 at 04:47:21PM -0700, fei.yang@intel.com wrote:
> From: Fei Yang <fei.yang@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@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
>
next prev parent reply other threads:[~2023-10-05 18:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-04 23:47 [Intel-xe] [PATCH 0/1] drm/xe: don't repin a userptr if mm is closed fei.yang
2023-10-04 23:47 ` [Intel-xe] [PATCH 1/1] " fei.yang
2023-10-05 18:39 ` Matthew Brost [this message]
2023-10-18 15:10 ` Yang, Fei
2023-10-05 0:31 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
2023-10-05 0:31 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-10-05 0:33 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-10-05 0:40 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-10-05 0:40 ` [Intel-xe] ✗ CI.Hooks: failure " Patchwork
2023-10-05 0:41 ` [Intel-xe] ✓ CI.checksparse: success " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZR8C8tLFOKBihlmr@DUT025-TGLU.fm.intel.com \
--to=matthew.brost@intel.com \
--cc=fei.yang@intel.com \
--cc=intel-xe@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox