[Intel-xe] [PATCH 1/3] drm/xe: Disable interruptable wait on xe_bo_move()

Thomas Hellström thomas.hellstrom at linux.intel.com
Mon May 29 08:59:22 UTC 2023


On Fri, 2023-05-26 at 12:06 -0700, José Roberto de Souza wrote:
> All the Xe users of dma_resv_wait_timeout() also disable the
> interruptable wait.
> And doing so this avoids DRM_IOCTL_XE_EXEC fails when under memory
> pressure.

Interruptible waits are crucial for signal delivery latency and for
user experience (being able to ctrl-c away from somtething that is
stuck).

Uninterruptible waits should only ever be used in situations where it's
impossible to recover from an error, like in error or possibly
destruction paths.

In this case execbuf should be able to handle the -EINTR returned from
the ioctl and restart. If it doesn't there's an error elsewhere.

But Maarten had a patch to return the real error code rather than
rewriting it to -ETIME.

/Thomas



> 
> Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/239
> Cc: Thomas Hellström <thomas.hellstrom at linux.intel.com>
> Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
> ---
>  drivers/gpu/drm/xe/xe_bo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index 0db9c05097d07..6ed7e08269e82 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -609,7 +609,7 @@ static int xe_bo_move(struct ttm_buffer_object
> *ttm_bo, bool evict,
>             new_mem->mem_type == XE_PL_SYSTEM) {
>                 long timeout = dma_resv_wait_timeout(ttm_bo-
> >base.resv,
>                                                     
> DMA_RESV_USAGE_BOOKKEEP,
> -                                                    true,
> +                                                    false,
>                                                     
> MAX_SCHEDULE_TIMEOUT);
>                 if (timeout <= 0) {
>                         ret = -ETIME;



More information about the Intel-xe mailing list