All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Praveen Paneri <praveen.paneri@intel.com>
Subject: [PATCH 2/2] drm/i915: Add rpm get/put in i915_shrinker_oom
Date: Wed, 13 Apr 2016 16:54:07 +0300	[thread overview]
Message-ID: <1460555647-32557-3-git-send-email-mika.kuoppala@intel.com> (raw)
In-Reply-To: <1460555647-32557-1-git-send-email-mika.kuoppala@intel.com>

From: Praveen Paneri <praveen.paneri@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
scenario.

Signed-off-by: Praveen Paneri <praveen.paneri@intel.com>
Reviewed-by: Chris Wilson <chris@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 dff6596a680f..206736673a52 100644
--- a/drivers/gpu/drm/i915/i915_gem_shrinker.c
+++ b/drivers/gpu/drm/i915/i915_gem_shrinker.c
@@ -353,7 +353,9 @@ i915_gem_shrinker_oom(struct notifier_block *nb, unsigned long event, void *ptr)
 	if (!i915_gem_shrinker_lock_uninterruptible(dev_priv, &slu, 5000))
 		return NOTIFY_DONE;
 
+	intel_runtime_pm_get(dev_priv);
 	freed_pages = i915_gem_shrink_all(dev_priv);
+	intel_runtime_pm_put(dev_priv);
 
 	/* Because we may be allocating inside our own driver, we cannot
 	 * assert that there are no objects with pinned pages that are not
-- 
2.5.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-04-13 13:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 13:54 [CI-RUN PATCH 0/2] ci-run of shrinker rpm fixes Mika Kuoppala
2016-04-13 13:54 ` [PATCH 1/2] drm/i915: Unbind objects in shrinker only if device is runtime active Mika Kuoppala
2016-04-13 13:54 ` Mika Kuoppala [this message]
2016-04-13 14:01   ` [PATCH 2/2] drm/i915: Add rpm get/put in i915_shrinker_oom Chris Wilson
2016-04-14  7:25 ` ✗ Fi.CI.BAT: failure for ci-run of shrinker rpm fixes Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2015-12-24 14:48 [PATCH] drm/i915: Unbind objects in shrinker only if device is runtime active Chris Wilson
2015-12-29  7:05 ` [PATCH 1/2] " Praveen Paneri
2015-12-29  7:05   ` [PATCH 2/2] drm/i915: Add rpm get/put in i915_shrinker_oom Praveen Paneri
2015-12-29 11:58     ` Chris Wilson
2016-01-05 10:16       ` Daniel Vetter
2016-01-05 10:32         ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460555647-32557-3-git-send-email-mika.kuoppala@intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=praveen.paneri@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.