[Intel-xe] [PATCH v2 08/31] drm/xe: VM LRU bulk move

Thomas Hellström thomas.hellstrom at linux.intel.com
Tue May 9 12:47:54 UTC 2023


On 5/2/23 02:17, Matthew Brost wrote:
> Use the TTM LRU bulk move for BOs tied to a VM. Update the bulk moves
> LRU position on every exec.
>
> Signed-off-by: Matthew Brost <matthew.brost at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_bo.c       | 32 ++++++++++++++++++++++++++++----
>   drivers/gpu/drm/xe/xe_bo.h       |  4 ++--
>   drivers/gpu/drm/xe/xe_dma_buf.c  |  2 +-
>   drivers/gpu/drm/xe/xe_exec.c     |  6 ++++++
>   drivers/gpu/drm/xe/xe_vm_types.h |  3 +++
>   5 files changed, 40 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index 3ab404e33fae..da99ee53e7d7 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -985,6 +985,23 @@ static void xe_gem_object_free(struct drm_gem_object *obj)
>   	ttm_bo_put(container_of(obj, struct ttm_buffer_object, base));
>   }
>   
> +static void xe_gem_object_close(struct drm_gem_object *obj,
> +				struct drm_file *file_priv)
> +{
> +	struct xe_bo *bo = gem_to_xe_bo(obj);
> +
> +	if (bo->vm && !xe_vm_no_dma_fences(bo->vm)) {
Is there a reason we don't use bulk moves for LR vms? Admittedly bumping 
LRU doesn't make much sense when we support user-space command buffer 
chaining, but I think we should be doing it on exec at least, no?
> +		struct ww_acquire_ctx ww;
> +
> +		XE_BUG_ON(!xe_bo_is_user(bo));

Also why can't we use this for kernel objects as well? At some point we 
want to get to evictable page-table objects? Could we do this in the 
release_notify() callback to cover all potential bos?

/Thomas




More information about the Intel-xe mailing list