[Intel-gfx] [PATCH 2/3] drm/i915/userptr: Avoid struct_mutex recursion for mmu_invalidate_range_start

Chris Wilson chris at chris-wilson.co.uk
Tue Jan 15 11:58:01 UTC 2019


Quoting Tvrtko Ursulin (2019-01-15 11:54:15)
> 
> On 14/01/2019 21:17, Chris Wilson wrote:
> > -static int i915_gem_userptr_mn_invalidate_range_start(struct mmu_notifier *_mn,
> > -                     const struct mmu_notifier_range *range)
> > +static struct mutex *__i915_mutex_lock_recursive(struct mutex *m)
> > +{
> > +     switch (mutex_trylock_recursive(m)) {
> > +     default:
> > +     case MUTEX_TRYLOCK_FAILED:
> > +             mutex_lock_nested(m, I915_MM_SHRINKER);
> 
> Worth using killable and refactoring the caller to handle the failure? 
> If this path ends up deadlocking one day it would be slightly better 
> that the process can be removed.

Good call.
-Chris


More information about the Intel-gfx mailing list