Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [CI 3/3] drm/xe: Move vma rebinding to the drm_exec locking loop
Date: Fri, 8 Mar 2024 07:05:52 +0000	[thread overview]
Message-ID: <Zeq40P50drXwrQjy@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20240307164119.14838-3-thomas.hellstrom@linux.intel.com>

On Thu, Mar 07, 2024 at 05:41:19PM +0100, Thomas Hellström wrote:
> Rebinding might allocate page-table bos, causing evictions.
> To support blocking locking during these evictions,
> perform the rebinding in the drm_exec locking loop.
> 
> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> ---
>  drivers/gpu/drm/xe/xe_exec.c |  4 ++++
>  drivers/gpu/drm/xe/xe_vm.c   | 12 +++++++-----
>  2 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c
> index 5124663a9694..b683ce415ef1 100644
> --- a/drivers/gpu/drm/xe/xe_exec.c
> +++ b/drivers/gpu/drm/xe/xe_exec.c
> @@ -106,6 +106,10 @@ static int xe_exec_fn(struct drm_gpuvm_exec *vm_exec)
>  	if (ret)
>  		return ret;
>  
> +	ret = xe_vm_rebind(vm, false);
> +	if (ret)
> +		return ret;
> +

This needs to be moved below the slot resveration to avoid [1].

Matt

[1] https://intel-gfx-ci.01.org/tree/intel-xe/xe-pw-130871v1/bat-atsm-2/igt@xe_exec_threads@threads-mixed-shared-vm-userptr-invalidate-race.html

>  	/*
>  	 * 1 fence slot for the final submit, and 1 more for every per-tile for
>  	 * GPU bind and 1 extra for CPU bind. Note that there are potentially
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index d9487b39778e..dbfdfd3ee39c 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -516,7 +516,13 @@ static int xe_preempt_work_begin(struct drm_exec *exec, struct xe_vm *vm,
>  	if (err)
>  		return err;
>  
> -	return drm_gpuvm_validate(&vm->gpuvm, exec);
> +	err = drm_gpuvm_validate(&vm->gpuvm, exec);
> +	if (err)
> +		return err;
> +
> +	err = xe_vm_rebind(vm, true);
> +
> +	return err;
>  }
>  
>  static void preempt_rebind_work_func(struct work_struct *w)
> @@ -568,10 +574,6 @@ static void preempt_rebind_work_func(struct work_struct *w)
>  	if (err)
>  		goto out_unlock;
>  
> -	err = xe_vm_rebind(vm, true);
> -	if (err)
> -		goto out_unlock;
> -
>  	if (vm->rebind_fence) {
>  		dma_fence_wait(vm->rebind_fence, false);
>  		dma_fence_put(vm->rebind_fence);
> -- 
> 2.44.0
> 

  reply	other threads:[~2024-03-08  7:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 16:41 [CI 1/3] drm/xe: Make TLB invalidation fences unordered Thomas Hellström
2024-03-07 16:41 ` [CI 2/3] drm/xe: Rework xe_vm_rebind() Thomas Hellström
2024-03-07 16:41 ` [CI 3/3] drm/xe: Move vma rebinding to the drm_exec locking loop Thomas Hellström
2024-03-08  7:05   ` Matthew Brost [this message]
2024-03-07 16:48 ` ✓ CI.Patch_applied: success for series starting with [CI,1/3] drm/xe: Make TLB invalidation fences unordered Patchwork
2024-03-07 16:48 ` ✓ CI.checkpatch: " Patchwork
2024-03-07 16:49 ` ✓ CI.KUnit: " Patchwork
2024-03-07 17:00 ` ✓ CI.Build: " Patchwork
2024-03-07 17:00 ` ✗ CI.Hooks: failure " Patchwork
2024-03-07 17:02 ` ✓ CI.checksparse: success " Patchwork
2024-03-07 17:31 ` ✗ CI.BAT: failure " 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=Zeq40P50drXwrQjy@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=thomas.hellstrom@linux.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