[Intel-gfx] [PATCH 22/24] drm/i915: Enable rcu-only context lookups

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Fri May 19 10:36:19 UTC 2017


On to, 2017-05-18 at 10:46 +0100, Chris Wilson wrote:
> Whilst the contents of the context is still protected by the big
> struct_mutex, this is not much of an improvement. It is just one tiny
> step towards reducing our BKL.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

<SNIP>

> +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> @@ -665,16 +665,17 @@ static int eb_select_context(struct i915_execbuffer *eb)
>  	struct i915_gem_context *ctx;
>  
>  	ctx = i915_gem_context_lookup(eb->file->driver_priv, eb->args->rsvd1);
> -	if (unlikely(IS_ERR(ctx)))
> -		return PTR_ERR(ctx);
> +	if (unlikely(!ctx))
> +		return -ENOENT;
>  
>  	if (unlikely(i915_gem_context_is_banned(ctx))) {
>  		DRM_DEBUG("Context %u tried to submit while banned\n",
>  			  ctx->user_handle);
> +		i915_gem_context_put(ctx);
>  		return -EIO;

Dem sweet onions.

>  	}

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list