drm/i915: Removing polling for struct_mutex from vmap shrinker
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 9 Jan 2019 16:42:04 +0000 (16:42 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 10 Jan 2019 13:44:07 +0000 (13:44 +0000)
commit9fab8a2ea0d39343da077eeaa386ceeba10ca316
tree4b39030d02a7922d1c69a08fb5d86696eb442d8d
parent3824e41975ae55539de016dccc55e791d46a55bd
drm/i915: Removing polling for struct_mutex from vmap shrinker

The wait-for-idle used from within the shrinker_lock_uninterruptible
depends on the struct_mutex locking state being known and declared to
i915_request_wait(). As it is conceivable that we reach the vmap
notifier from underneath struct_mutex (and so keep on relying on the
mutex_trylock_recursive), we should not blindly call i915_request_wait.

In the process we can remove the dubious polling to acquire
struct_mutex, and simply act, or not, on a successful trylock.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190109164204.23935-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_shrinker.c