Whilst waiting to obtain our locks for the last resort shrinking before
an oom, we check whether or not a fatal signal was pending. If there was,
we do not need to keep waiting as the oom will be aborted.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
        bool was_interruptible;
        bool unlock;
 
-       while (!i915_gem_shrinker_lock(dev, &unlock) && --timeout)
+       while (!i915_gem_shrinker_lock(dev, &unlock) && --timeout) {
                schedule_timeout_killable(1);
+               if (fatal_signal_pending(current))
+                       return NOTIFY_DONE;
+       }
        if (timeout == 0) {
                pr_err("Unable to purge GPU memory due lock contention.\n");
                return NOTIFY_DONE;