[PATCH 19/19] cond-resched

Chris Wilson chris at chris-wilson.co.uk
Tue Apr 28 22:39:04 UTC 2020


---
 drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c b/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
index 5b65ce738b16..58f59e693fa2 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
@@ -205,10 +205,15 @@ i915_gem_shrink(struct drm_i915_private *i915,
 			scanned += obj->base.size >> PAGE_SHIFT;
 			i915_gem_object_put(obj);
 
+			cond_resched();
 			spin_lock_irqsave(&i915->mm.obj_lock, flags);
+			if (fatal_signal_pending(current))
+				break;
 		}
 		list_splice_tail(&still_in_list, phase->list);
 		spin_unlock_irqrestore(&i915->mm.obj_lock, flags);
+		if (fatal_signal_pending(current))
+			break;
 	}
 
 	if (shrink & I915_SHRINK_BOUND)
-- 
2.20.1



More information about the Intel-gfx-trybot mailing list