[Intel-gfx] [RFC 1/4] drm/i915: Reduce recursive mutex locking from the shrinker

Chris Wilson chris at chris-wilson.co.uk
Thu Jan 3 12:29:21 UTC 2019


Quoting Tvrtko Ursulin (2019-01-03 12:23:26)
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> 
> In two codepaths internal to the shrinker we know we will end up taking
> the resursive mutex path.
> 
> It instead feels more elegant to avoid this altogether and not call
> mutex_trylock_recursive in those cases.
> 
> We achieve this by adding a new I915_SHRINK_LOCKED flag which gets passed
> to i915_gem_shrink by the internal callers.

Since we reach here from many paths with struct_mutex either locked or
unlocked, special casing one such seems silly. Especially when removing
struct_mutex from here entirely is within our grasp.
-Chris


More information about the Intel-gfx mailing list