Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Stuart Summers <stuart.summers@intel.com>
Cc: <niranjana.vishwanathapura@intel.com>, <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe: Always invalidate TLBs on userptr invalidation
Date: Mon, 23 Mar 2026 19:21:21 -0700	[thread overview]
Message-ID: <acH1IT6MBYvSf2GH@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <20260323211743.285064-1-stuart.summers@intel.com>

On Mon, Mar 23, 2026 at 09:17:42PM +0000, Stuart Summers wrote:
> Right now we are only invalidating TLBs when we are
> running in fault mode. For non-fault mode based userptr
> VMs, we then rely on context switches after an MMAP has
> happened to ensure the TLB is clean for the next submission.
> 
> With context based TLB invalidation, we can no longer rely
> on the implicit invalidation happening during context switch,
> so remove the fault mode limiter and simply always perform
> that invalidation.
> 
> I was able to see this behavior using the following test:
> xe_exec_compute_mode --r twice-userptr-invalidate
>

Hmm, this implies that preempt fences don't issue a TLB invalidation...
I thought we landed on preempt fences do a TLB invalidation in offline
discussions.

We may have more work to do here wrt context based TLB invalidations.

I think BO move path likely also needs to be updated then too.
 
> Signed-off-by: Stuart Summers <stuart.summers@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_userptr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_userptr.c b/drivers/gpu/drm/xe/xe_userptr.c
> index 6761005c0b90..dfd679dd98d9 100644
> --- a/drivers/gpu/drm/xe/xe_userptr.c
> +++ b/drivers/gpu/drm/xe/xe_userptr.c
> @@ -102,7 +102,7 @@ xe_vma_userptr_do_inval(struct xe_vm *vm, struct xe_userptr_vma *uvma, bool is_d
>  				    false, MAX_SCHEDULE_TIMEOUT);
>  	XE_WARN_ON(err <= 0);
>  
> -	if (xe_vm_in_fault_mode(vm) && userptr->initial_bind) {
> +	if (userptr->initial_bind) {

Should be change this if statement based on hardware support?

Matt

>  		if (!userptr->finish_inuse) {
>  			/*
>  			 * Defer the TLB wait to an extra pass so the caller
> -- 
> 2.43.0
> 

  parent reply	other threads:[~2026-03-24  2:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23 21:17 [PATCH] drm/xe: Always invalidate TLBs on userptr invalidation Stuart Summers
2026-03-23 21:24 ` ✓ CI.KUnit: success for " Patchwork
2026-03-23 22:01 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-03-24  2:21 ` Matthew Brost [this message]
2026-03-24 14:53   ` [PATCH] " Summers, Stuart
2026-03-24 21:51     ` Summers, Stuart
2026-03-24 23:53       ` Matthew Brost
2026-03-25 20:35         ` Summers, Stuart
2026-03-25 21:47           ` Matthew Brost
2026-03-25 22:21             ` Summers, Stuart
2026-03-24  6:12 ` ✓ Xe.CI.FULL: success for " 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=acH1IT6MBYvSf2GH@lstrano-desk.jf.intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=niranjana.vishwanathapura@intel.com \
    --cc=stuart.summers@intel.com \
    /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