From patchwork Tue Dec 29 07:05:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Praveen Paneri X-Patchwork-Id: 7928911 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 655F5BEEE5 for ; Tue, 29 Dec 2015 06:56:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF548201F2 for ; Tue, 29 Dec 2015 06:56:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DE2E1201EF for ; Tue, 29 Dec 2015 06:56:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7AC396E056; Mon, 28 Dec 2015 22:56:24 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 53A286E056 for ; Mon, 28 Dec 2015 22:56:23 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP; 28 Dec 2015 22:56:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,494,1444719600"; d="scan'208";a="20553836" Received: from intel-desktop.iind.intel.com ([10.223.82.55]) by fmsmga004.fm.intel.com with ESMTP; 28 Dec 2015 22:56:22 -0800 From: Praveen Paneri To: intel-gfx@lists.freedesktop.org Date: Tue, 29 Dec 2015 12:35:39 +0530 Message-Id: <1451372739-5904-2-git-send-email-praveen.paneri@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1451372739-5904-1-git-send-email-praveen.paneri@intel.com> References: <20151224144850.GE20608@nuc-i3427.alporthouse.com> <1451372739-5904-1-git-send-email-praveen.paneri@intel.com> Cc: Praveen Paneri Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Add rpm get/put in i915_shrinker_oom X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Chris Wilson --- 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 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;