drm/i915/shrinker: Refactor common uninterruptible locking
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 5 Apr 2016 09:22:25 +0000 (10:22 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 5 Apr 2016 10:13:52 +0000 (11:13 +0100)
commit168cf367d7017a9d19522f8e59462c8b01c1212e
tree9e5838f8605f18fc5d5757d248299f38bd7c7876
parente87666b52f00fdb373349c4e6e1c09ced964e3c5
drm/i915/shrinker: Refactor common uninterruptible locking

Both the oom and vmap notifier callbacks have a loop to acquire the
struct_mutex and set the device as uninterruptible, within a certain
time. Refactor the common code into a pair of functions.

Suggested-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1459848145-24042-1-git-send-email-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
drivers/gpu/drm/i915/i915_gem_shrinker.c