Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp490772imw; Thu, 14 Jul 2022 05:27:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uR8WKtgGHBlNL+gVuMrkF6yHPAwTNHWypyqvhn/IWrxa9xceivvD0snHLZT25AzZgUCgoB X-Received: by 2002:a05:6402:11c9:b0:43a:b054:52ba with SMTP id j9-20020a05640211c900b0043ab05452bamr12278954edw.344.1657801626961; Thu, 14 Jul 2022 05:27:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657801626; cv=none; d=google.com; s=arc-20160816; b=gLRrEUOPZCM2PvzETvFO7630g1SCs5ZcrKC30AV/EbsuKvdDP7zjFlfangLFV7uEGE 63N40Dc8/zCFdltpc1sphyoHRN5RbWeV6N8FhGUY5bdiOl+DHiy+Qw01oo+1b98GkAao YmhiF/69S8PGLYrb4Hu/Ko8rOSjv5s+01DLnjMLcLshhlD077Z9mAEQGXeezqV/4kWVt zW/U4tAu1AkwJDA7G3/YypWd659YUipWkLoD8+ZdZ72PlghRp3/WyONhJSHjmOump/Ji 23JCK2z/V9S6UYcVRbH+uhca7n1M2LVP+boY13pYdS6+Puwc/aHe4dxsi/ISIWsPwAhQ hgrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=lRoE7hC6jhik79rgpq1Ut8t63OiIyERvR/A0ohJ9SZg=; b=IBOOmIy5sMW+PuC+eFrE19zCVCYVHUSaOwJTf96axY7PT52sDpmhUINmhC6qHdPlPG YtoprILsxmthpzNhFv1cWd4KyTJI59YnwuE8CLMOoWgyYZbKqADVSpFC334qavU/Imig 2hue33NB96+eazDtMX8VLUc6hLar8gr5NYXr1LilYHjBmNdMbmIyOLF0EIkaCGhrpc2b Xw2NlQX9GhiZWKJ2IqgwG1O8XTEG/2X9I112kBjFaQqtyv5lYOSs4cKLGDM8RU4r47dQ OwA9VBl7vbUtWDXIOZb6oJg8Pzkv1oSHlfgCgK8/Ly6MXp1eKmhfD2n4bjWxPC9yMR2H M4xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=OIgjqA3d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb15-20020a170907960f00b006feb8cc7e2asi1443358ejc.503.2022.07.14.05.26.42; Thu, 14 Jul 2022 05:27:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=OIgjqA3d; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238813AbiGNMH5 (ORCPT + 99 others); Thu, 14 Jul 2022 08:07:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238979AbiGNMGi (ORCPT ); Thu, 14 Jul 2022 08:06:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE4925C9C1; Thu, 14 Jul 2022 05:06:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6D954B824E6; Thu, 14 Jul 2022 12:06:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E05F2C36AEB; Thu, 14 Jul 2022 12:06:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657800390; bh=Jh3Kqp3PsRoCdV/mDv7WITLyqYY/AxdJ08g/jrYtT8s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OIgjqA3dm1ZNcOs4sigMBewggrVchZpVTA5rNuae+XM7YrjOQHNW9/uymVQfTZDu9 Xxi0CncfiWX3qzNg0VM5v0h4yf6r/fp0ZbaKiHiocTVTEU4AKBTXHyDwKXA421eSs6 PFQ/48Ul/D/UNepuw+Yx03bwVqEsN0vHzE9ihZzdTRjMxUBvOsfx01M+SYgiB0sk6k pf/vJ6rMebk8cNf53NU2TFIU0VWQnPNWU6YojkyrNyDhGXnX4Xzep3yXrY3qPwcVvF ChOV3jdrTXnDovNmFCdrCyOLJ34wyvUwN6SaPSzogeSgmqYwa2zqftFBvbow6Ak34a SOyTtnfKEslWg== Received: from mchehab by mail.kernel.org with local (Exim 4.95) (envelope-from ) id 1oBxbv-0059se-RS; Thu, 14 Jul 2022 13:06:27 +0100 From: Mauro Carvalho Chehab Cc: Chris Wilson , Daniel Vetter , Dave Airlie , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Fei Yang , Andi Shyti , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Mauro Carvalho Chehab Subject: [PATCH v2 04/21] drm/i915/gt: Only invalidate TLBs exposed to user manipulation Date: Thu, 14 Jul 2022 13:06:09 +0100 Message-Id: X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Wilson Don't flush TLBs when the buffer is only used in the GGTT under full control of the kernel, as there's no risk of concurrent access and stale access from prefetch. We only need to invalidate the TLB if they are accessible by the user. That helps to reduce the performance regression introduced by TLB invalidate logic. Cc: stable@vger.kernel.org Fixes: 7938d61591d3 ("drm/i915: Flush TLBs before releasing backing store") Signed-off-by: Chris Wilson Cc: Fei Yang Cc: Andi Shyti Acked-by: Thomas Hellström Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover. See [PATCH v2 00/21] at: https://lore.kernel.org/all/cover.1657800199.git.mchehab@kernel.org/ drivers/gpu/drm/i915/i915_vma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c index ef3b04c7e153..646f419b2035 100644 --- a/drivers/gpu/drm/i915/i915_vma.c +++ b/drivers/gpu/drm/i915/i915_vma.c @@ -538,7 +538,8 @@ int i915_vma_bind(struct i915_vma *vma, bind_flags); } - set_bit(I915_BO_WAS_BOUND_BIT, &vma->obj->flags); + if (bind_flags & I915_VMA_LOCAL_BIND) + set_bit(I915_BO_WAS_BOUND_BIT, &vma->obj->flags); atomic_or(bind_flags, &vma->flags); return 0; -- 2.36.1