diff mbox

[2/2] drm/i915: Add rpm get/put in i915_shrinker_oom

Message ID 1451372739-5904-2-git-send-email-praveen.paneri@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Praveen Paneri Dec. 29, 2015, 7:05 a.m. UTC
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
scenario.

Signed-off-by: Praveen Paneri <praveen.paneri@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_shrinker.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Chris Wilson Dec. 29, 2015, 11:58 a.m. UTC | #1
On Tue, Dec 29, 2015 at 12:35:39PM +0530, Praveen Paneri wrote:
> 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
> scenario.
> 
> Signed-off-by: Praveen Paneri <praveen.paneri@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Daniel Vetter Jan. 5, 2016, 10:16 a.m. UTC | #2
On Tue, Dec 29, 2015 at 11:58:26AM +0000, Chris Wilson wrote:
> On Tue, Dec 29, 2015 at 12:35:39PM +0530, Praveen Paneri wrote:
> > 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
> > scenario.
> > 
> > Signed-off-by: Praveen Paneri <praveen.paneri@intel.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Both applied to dinq, thanks.
-Daniel
Daniel Vetter Jan. 5, 2016, 10:32 a.m. UTC | #3
On Tue, Jan 05, 2016 at 11:16:52AM +0100, Daniel Vetter wrote:
> On Tue, Dec 29, 2015 at 11:58:26AM +0000, Chris Wilson wrote:
> > On Tue, Dec 29, 2015 at 12:35:39PM +0530, Praveen Paneri wrote:
> > > 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
> > > scenario.
> > > 
> > > Signed-off-by: Praveen Paneri <praveen.paneri@intel.com>
> > Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> Both applied to dinq, thanks.

Well that didn't work since it doesn't compile. My tree lacks
intel_runtime_pm_get_noidle. Please resend with prerequisite patches
included in the patch series.

Thanks, Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_shrinker.c b/drivers/gpu/drm/i915/i915_gem_shrinker.c
index 6f91070..267aa10 100644
--- a/drivers/gpu/drm/i915/i915_gem_shrinker.c
+++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c
@@ -297,7 +297,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;