Re: [Intel-gfx] [rfc PATCH] drm/i915: Simplify shrinker_lock

2016-07-19 Thread Daniel Vetter
On Sun, Jul 17, 2016 at 10:54:51PM +0100, Chris Wilson wrote: > On Sun, Jul 17, 2016 at 11:45:44AM -0700, Davidlohr Bueso wrote: > > In addition, we can simplify the overall function wrt (2), by first > > checking if we are the lock owner, then address the trylock and > > deal with (2) if locked/co

[Intel-gfx] [rfc PATCH] drm/i915: Simplify shrinker_lock

2016-07-18 Thread Davidlohr Bueso
Currently i915_gem_shrinker_lock() suffers from a few issues: (1) In the attempt to avoid recursive locking, the mutex owner is consulted. This is obviously nasty and extends the standard api with artifacts like mutex_is_locked_by() deep in driver code. (2) If the lock is taken by another task, t

Re: [Intel-gfx] [rfc PATCH] drm/i915: Simplify shrinker_lock

2016-07-17 Thread Chris Wilson
On Sun, Jul 17, 2016 at 11:45:44AM -0700, Davidlohr Bueso wrote: > In addition, we can simplify the overall function wrt (2), by first > checking if we are the lock owner, then address the trylock and > deal with (2) if locked/contended by a traditional mutex_lock(). > This should be safe consideri