[PATCH 09/11] drm/ttm: convert EDEADLK into EAGAIN

Daniel Vetter daniel at ffwll.ch
Wed May 15 08:40:57 UTC 2019


On Tue, May 14, 2019 at 02:31:25PM +0200, Christian König wrote:
> Let userspace try again if we really run into a deadlock during eviction.
> 
> This has a low chance of live locking, but with guaranteed forward process.
> 
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
>  drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index a301c876ae31..ce85cd8b4970 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -877,6 +877,8 @@ static int ttm_mem_evict_first(struct ttm_bo_device *bdev,
>  					    acquire_ctx);
>  		if (ret) {
>  			ttm_bo_put(first_bo);
> +			if (ret == -EDEADLK)

Is this the ww_mutex EDEADLK or something else? If the former then letting
that escape unhandling into userspace sounds like a kernel bug ...
-Daniel

> +				ret = -EAGAIN;
>  			return ret;
>  		}
>  		spin_lock(&glob->lru_lock);
> -- 
> 2.17.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the amd-gfx mailing list