From patchwork Thu Jun 15 17:54:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9789601 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7D54B60384 for ; Thu, 15 Jun 2017 18:01:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72FAA2866A for ; Thu, 15 Jun 2017 18:01:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6696F2867E; Thu, 15 Jun 2017 18:01:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C7E182866A for ; Thu, 15 Jun 2017 18:01:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 80B406E73C; Thu, 15 Jun 2017 18:01:04 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7DA5B6E73C for ; Thu, 15 Jun 2017 18:01:02 +0000 (UTC) Received: from localhost (LFbn-1-12060-104.w90-92.abo.wanadoo.fr [90.92.122.104]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C5907B5F; Thu, 15 Jun 2017 18:01:01 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, Intel Graphics Development Date: Thu, 15 Jun 2017 19:54:35 +0200 Message-Id: <20170615175426.134822621@linuxfoundation.org> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170615175426.075744317@linuxfoundation.org> References: <20170615175426.075744317@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Vetter , =?UTF-8?q?Ma=C3=ABl=20Lavault?= , Mika Kuoppala Subject: [Intel-gfx] [PATCH 4.11 01/13] drm/i915: Do not drop pagetables when empty 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP 4.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chris Wilson This is the minimal backport for stable of the upstream commit: commit dd19674bacba227ae5d3ce680cbc5668198894dc Author: Chris Wilson Date: Wed Feb 15 08:43:46 2017 +0000 drm/i915: Remove bitmap tracking for used-ptes Due to a race with the shrinker, when we try to allocate a pagetable, we may end up shrinking it instead. This comes as a nasty surprise as we try to dereference it to fill in the pagetable entries for the object. In linus/master this is fixed by pinning the pagetables prior to allocation, but that backport is roughly drivers/gpu/drm/i915/i915_gem_gtt.c | 10 ---------- 1 file changed, 10 deletions(-) i.e. unsuitable for stable. Instead we neuter the code that tried to free the pagetables. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99295 Fixes: 2ce5179fe826 ("drm/i915/gtt: Free unused lower-level page tables") Signed-off-by: Chris Wilson Cc: Michel Thierry Cc: Mika Kuoppala Cc: Chris Wilson Cc: Joonas Lahtinen Cc: Michał Winiarski Cc: Daniel Vetter Cc: Jani Nikula Cc: intel-gfx@lists.freedesktop.org Cc: # v4.10+ Tested-by: Maël Lavault Signed-off-by: Daniel Vetter Signed-off-by: Greg Kroah-Hartman --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -755,10 +755,6 @@ static bool gen8_ppgtt_clear_pt(struct i GEM_BUG_ON(pte_end > GEN8_PTES); bitmap_clear(pt->used_ptes, pte, num_entries); - if (USES_FULL_PPGTT(vm->i915)) { - if (bitmap_empty(pt->used_ptes, GEN8_PTES)) - return true; - } pt_vaddr = kmap_px(pt); @@ -798,9 +794,6 @@ static bool gen8_ppgtt_clear_pd(struct i } } - if (bitmap_empty(pd->used_pdes, I915_PDES)) - return true; - return false; } @@ -829,9 +822,6 @@ static bool gen8_ppgtt_clear_pdp(struct mark_tlbs_dirty(ppgtt); - if (bitmap_empty(pdp->used_pdpes, I915_PDPES_PER_PDP(dev_priv))) - return true; - return false; }