[Intel-gfx] [PATCH] drm/i915: Add rpm get/put in i915_shrinker_oom

Mika Kuoppala mika.kuoppala at linux.intel.com
Wed Mar 30 10:33:52 UTC 2016

From: Praveen Paneri <praveen.paneri at intel.com>

i915_gem_shrink_all() will scan the bound list only if device is not
suspended but in OOM scenarios it becomes absolutely necessary to
release as much memory as possible. So, adding rpm get/put in
i915_shrinker_oom() to ensure shrinking of bound objects in OOM

Signed-off-by: Praveen Paneri <praveen.paneri at intel.com>
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
 drivers/gpu/drm/i915/i915_gem_shrinker.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c
index 3bc292d626ff..4457f86c81ef 100644
--- a/drivers/gpu/drm/i915/i915_gem_shrinker.c
+++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c
@@ -325,7 +325,9 @@ i915_gem_shrinker_oom(struct notifier_block *nb, unsigned long event, void *ptr)
 	was_interruptible = dev_priv->mm.interruptible;
 	dev_priv->mm.interruptible = false;
+	intel_runtime_pm_get(dev_priv);
 	freed_pages = i915_gem_shrink_all(dev_priv);
+	intel_runtime_pm_put(dev_priv);
 	dev_priv->mm.interruptible = was_interruptible;

More information about the Intel-gfx mailing list