[CI 2/2] drm/xe: Move vma rebinding to the drm_exec locking loop
Matthew Brost
matthew.brost at intel.com
Thu Mar 7 04:41:08 UTC 2024
On Wed, Mar 06, 2024 at 11:01:33AM +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 at 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;
> +
Know this is a CI series but noticed that you missed deleting
xe_vm_rebind xe_exec_ioctl below.
Also this patch otherwise looks correct as I agree xe_vm_rebind needs to
be within the drm_exec loop.
Matt
> /*
> * 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 427b2063d876..732132bba537 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -515,7 +515,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)
> @@ -567,10 +573,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
>
More information about the Intel-xe
mailing list