[Intel-gfx] [PATCH] drm/i915: Remove toplevel struct_mutex locking from debugfs/i915_drop_caches

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Thu May 25 14:58:33 UTC 2017


On ke, 2017-05-24 at 17:26 +0100, Chris Wilson wrote:
> I have a plan to write a quick test to exercise concurrent usage of
> i915_gem_shrink(), the simplest way looks to be to have multiple threads
> using debugfs/i915_drop_caches. However, we currently take one lock over
> the entire function, serialising the calls into i915_gem_shrink() so
> reduce the lock coverage.
> 
> Testcase: igt/gem_shrink/reclaim
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

<SNIP>

> +		if (val & DROP_RETIRE)
> +			i915_gem_retire_requests(dev_priv);
> +
> +		mutex_unlock(&dev->struct_mutex);
> +	}
>  
>  	lockdep_set_current_reclaim_state(GFP_KERNEL);

Lock used to work as a serializer, isn't this going to get contended
now?

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


More information about the Intel-gfx mailing list