public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Abandon oom quickly if killed by a signal
@ 2014-07-11 10:28 Chris Wilson
  2014-07-11 10:28 ` [PATCH 2/2] drm/i915: Initialise userptr mmu_notifier serial to 1 Chris Wilson
  0 siblings, 1 reply; 10+ messages in thread
From: Chris Wilson @ 2014-07-11 10:28 UTC (permalink / raw)
  To: intel-gfx

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>
---
 drivers/gpu/drm/i915/i915_gem.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 64ec167e8921..338f80cd1bfe 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -5444,8 +5444,11 @@ i915_gem_shrinker_oom(struct notifier_block *nb, unsigned long event, void *ptr)
 	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;
-- 
2.0.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-07-15  8:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11 10:28 [PATCH 1/2] drm/i915: Abandon oom quickly if killed by a signal Chris Wilson
2014-07-11 10:28 ` [PATCH 2/2] drm/i915: Initialise userptr mmu_notifier serial to 1 Chris Wilson
2014-07-11 11:00   ` Tvrtko Ursulin
2014-07-11 11:06     ` Chris Wilson
2014-07-11 11:31       ` Tvrtko Ursulin
2014-07-11 11:35         ` Chris Wilson
2014-07-11 11:53           ` Tvrtko Ursulin
2014-07-11 14:02       ` Daniel Vetter
2014-07-11 14:06         ` Tvrtko Ursulin
2014-07-15  8:08           ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox