Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3884654pxv; Mon, 19 Jul 2021 11:05:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0e9z0VpeKt2OGcLBhqp9mvx+69JV0FBNL3nIU86iZdp7nhzcuYzofwh2dOZ7oLm8s4bOA X-Received: by 2002:a17:906:998e:: with SMTP id af14mr27583574ejc.308.1626717793420; Mon, 19 Jul 2021 11:03:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626717793; cv=none; d=google.com; s=arc-20160816; b=Jcdh9bSYw4SBdYo8vApixEteRIYofGjeI3m0VOkhnnYOP2vmkplwJ5qqfCtI4yqMrV 356Q9XycUCdvW55JqAMUs9uOAP1uhtT5xLYH++U346NZQks1UdTYfBiYLRnQFIyUoyL6 T/K0bdkPGiRqQo9OIACqdZEZP3HoJ5wGdlpnTUgcljkOePoYU1jeZplTEFz3CTEFugTA nJ8eZ4G+briaQrSp/8MWRKu9lEpOmDZ45Bc0bCGxvyt8LNaIWZLtiC34sLyCiFl1/QQ2 cKVA6oxW5rXeUStSGkv+WuXdIia8N5jTPPm19AlZT7jWgrXtCAMTd8v+cLtKoSOUS8rd 7YRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xILMIUGoiewHoDbLMkTXOMKJf7zpcmKwhxaIH0vvgrI=; b=X6II08YPzQhX1YNzTy7flv6UecFtS+abpEtAS+9e/rwRqIr0OEOycPdlW9aMRXQTes sKAQaKfXzWZp6r7PCbm1VBjM6anqDna79q0U9wPQe8ezmxpzXmJ7FndiKpT2UsIWRlzd upHIfhCqzaVBthOY0mUawy8g/x0QmdfyuF80qZQwAJPsyl7kPikzPHkb7ZIzmgPauUqp 9470OP/YgkvZkfahbmoecmNAc6s7wEBBfkWuMoCdjgr6Gv5L19TSnvapH3tQLyRzTIlA hEkue5quspGodyMJgbVEp0XHmI61CWKuxRME8toLfZ7j3zOAKLSxoQ32YHHFH8r/7cK+ ZTNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=elTdL9QK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d15si22908328ejc.258.2021.07.19.11.02.50; Mon, 19 Jul 2021 11:03:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=elTdL9QK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377667AbhGSRQu (ORCPT + 99 others); Mon, 19 Jul 2021 13:16:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:34938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347828AbhGSPjh (ORCPT ); Mon, 19 Jul 2021 11:39:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 54ABD6127C; Mon, 19 Jul 2021 16:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626711558; bh=x+cz/X891inrQ3//V1KNZH9uM4o88sLn4CZYgOTpkpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=elTdL9QK2FX+njvaXcozJPwY9ZoKVAOfnicv5dPHTbuhEfC2sfbpLhu7wWSR87Ewa 0fQP3/BbEDPpSx1LOV6OoGJTD581yDyePCfvtyUD8EWlslTVfya1RYj5MiVJcsBuWa HrOGwneF5Q96HydkJmFpHMAsoItzoL24Or1jcK3Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthew Auld , Jon Bloomfield , Chris Wilson , Daniel Vetter , Daniel Vetter , Rodrigo Vivi Subject: [PATCH 5.12 015/292] drm/i915/gtt: drop the page table optimisation Date: Mon, 19 Jul 2021 16:51:17 +0200 Message-Id: <20210719144943.030257610@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.514164272@linuxfoundation.org> References: <20210719144942.514164272@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthew Auld commit 0abb33bfca0fb74df76aac03e90ce685016ef7be upstream. We skip filling out the pt with scratch entries if the va range covers the entire pt, since we later have to fill it with the PTEs for the object pages anyway. However this might leave open a small window where the PTEs don't point to anything valid for the HW to consume. When for example using 2M GTT pages this fill_px() showed up as being quite significant in perf measurements, and ends up being completely wasted since we ignore the pt and just use the pde directly. Anyway, currently we have our PTE construction split between alloc and insert, which is probably slightly iffy nowadays, since the alloc doesn't actually allocate anything anymore, instead it just sets up the page directories and points the PTEs at the scratch page. Later when we do the insert step we re-program the PTEs again. Better might be to squash the alloc and insert into a single step, then bringing back this optimisation(along with some others) should be possible. Fixes: 14826673247e ("drm/i915: Only initialize partially filled pagetables") Signed-off-by: Matthew Auld Cc: Jon Bloomfield Cc: Chris Wilson Cc: Daniel Vetter Cc: # v4.15+ Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210713130431.2392740-1-matthew.auld@intel.com (cherry picked from commit 8f88ca76b3942d82e2c1cea8735ec368d89ecc15) Signed-off-by: Rodrigo Vivi Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c +++ b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c @@ -298,10 +298,7 @@ static void __gen8_ppgtt_alloc(struct i9 __i915_gem_object_pin_pages(pt->base); i915_gem_object_make_unshrinkable(pt->base); - if (lvl || - gen8_pt_count(*start, end) < I915_PDES || - intel_vgpu_active(vm->i915)) - fill_px(pt, vm->scratch[lvl]->encode); + fill_px(pt, vm->scratch[lvl]->encode); spin_lock(&pd->lock); if (likely(!pd->entry[idx])) {