Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [PATCH] drm/xe: Annotate xe_vma_userptr_pin_pages with might_alloc
Date: Fri, 26 Jul 2024 18:44:14 -0700	[thread overview]
Message-ID: <20240727014414.2127079-1-matthew.brost@intel.com> (raw)

Let's catch corner cases with locking early by annotating
xe_vma_userptr_pin_pages with might_alloc so if it is called with a lock
in the path of reclaim lockdep pops even if the userptr hasn't been
invalidated.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_vm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 12d43c35978c..3bd5527b1ec6 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -71,6 +71,7 @@ int xe_vma_userptr_pin_pages(struct xe_userptr_vma *uvma)
 	struct xe_device *xe = vm->xe;
 
 	lockdep_assert_held(&vm->lock);
+	might_alloc(GFP_KERNEL);
 	xe_assert(xe, xe_vma_is_userptr(vma));
 
 	return xe_hmm_userptr_populate_range(uvma, false);
-- 
2.34.1


             reply	other threads:[~2024-07-27  1:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-27  1:44 Matthew Brost [this message]
2024-07-27  2:08 ` ✓ CI.Patch_applied: success for drm/xe: Annotate xe_vma_userptr_pin_pages with might_alloc Patchwork
2024-07-27  2:09 ` ✓ CI.checkpatch: " Patchwork
2024-07-27  2:10 ` ✓ CI.KUnit: " Patchwork
2024-07-27  2:26 ` ✓ CI.Build: " Patchwork
2024-07-27  2:29 ` ✓ CI.Hooks: " Patchwork
2024-07-27  2:32 ` ✓ CI.checksparse: " Patchwork
2024-07-27  2:52 ` ✓ CI.BAT: " 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=20240727014414.2127079-1-matthew.brost@intel.com \
    --to=matthew.brost@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