Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp507510imw; Wed, 13 Jul 2022 02:47:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sviFaoFRHD5UMH9hyUrt02OtyB9n9qoewAP731a1yFxmNlidRoIIQt8gVb3gqR2xtbqkLk X-Received: by 2002:a17:902:854a:b0:16b:a3c3:ed8c with SMTP id d10-20020a170902854a00b0016ba3c3ed8cmr2596051plo.167.1657705632524; Wed, 13 Jul 2022 02:47:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657705632; cv=none; d=google.com; s=arc-20160816; b=vOIQTWME+E62pRNhySvROquiCxXMNUrbiZPP8hybiS4w3h193I9qkW63+mfAGqobco +96PRaf/S94BOrid+GJ4EdbKGD2O7b14kPR/6wWeDoMa6Yiw6iMHqi0vwZhKvhA6+adg 1DDRUWXpg3fVERxJttJZD0Jivaf9osO8tmNVg+mFe898NYwyIHAYkKux8zvm2bYYawtX C6TLDw54QY3GIHhQN1dbDwjgoaTTuRO1l4cezr5VBaZ/d8Ilh5uWYkcxtrLKjiQhz1t4 3ZPrmqHDBfosK/ussd+pW/uF9B0QBTvc3hEB1jursz9KLBlwdPpMQPHce1DVhcBBI6So AxJQ== 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=tzZQlB0iyrAQR9XucucAO2qIsL2Lf8ojxgftj9r9uIo=; b=FUbhX6xUaI3sFoBtM6CIHyvnXMdKsdWlEP69cVDqB7QDVcHdzkmlJekYLhIN6oYtlw rNS9aBCUgp4IVpQ3X211rYw2lSoOlgLpi3qGm0ryLd218WGAm58suFnKCqggfc0Id2fl o4M+ecYmencCbwcxVjVPhDj8tCcJlT+qxahomoyj3SXRQTXT94SjcMCvxgXum00bj421 X8BKTXYtBn6ta167W76Yft5KQDS/hbXaACcQXrlKyPXe+ksRyE8Q1P5tej3p84YQeQzZ k4qhpMjOpshgss9Q5ZM6cQoCjiRppgjItI+Tolb6apNiILojy1njP7M3LZZJ4q/T0A79 JOXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b="qiuOt/04"; 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 o11-20020a17090ac08b00b001efbea806fesi1616828pjs.113.2022.07.13.02.47.00; Wed, 13 Jul 2022 02:47:12 -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="qiuOt/04"; 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 S230364AbiGMJa4 (ORCPT + 99 others); Wed, 13 Jul 2022 05:30:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235383AbiGMJaZ (ORCPT ); Wed, 13 Jul 2022 05:30:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1472F2E2E; Wed, 13 Jul 2022 02:30:24 -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 4088FB81D62; Wed, 13 Jul 2022 09:30:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFFDCC3411E; Wed, 13 Jul 2022 09:30:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657704621; bh=8B8ALfcdC8EwjTlOgjtqiOwcizUYe+bdB6pww0lUJSw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qiuOt/04hD+49hrrU8PsBpLBHnWDBB8euq2/LV+O1tPFgamgy3XhpewKG7QjLzh7q 5g4fJT6rG+llX1qDOZ2xGnZXVA6wFmlYFs1/ISmx4Ha+5W8vc4AZHSwy2C/nYmoDTw kl3mmXGzu4RIlx4yfcwjt2uWKnBHUP+kC3AWhEqQmMs4YTP96We4/VId6Wmysf8T3D /z5PCKLLaeXA8wPLyLVBOcAvEkU/WvrPAnp+qMKvbJgYQsYOQKy7dE/5z/IFPVRexW Q1DNXK9nALdUZuRuxHDN3cTpNVdm31Kg+OAfrypieflPE8kmeiuOfhtk1O1ezN3WBg UO3H7jIBONAeA== Received: from mchehab by mail.kernel.org with local (Exim 4.95) (envelope-from ) id 1oBYhH-0050LL-JV; Wed, 13 Jul 2022 10:30:19 +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 04/21] drm/i915/gt: Only invalidate TLBs exposed to user manipulation Date: Wed, 13 Jul 2022 10:30:01 +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 --- See [PATCH 00/21] at: https://lore.kernel.org/all/cover.1657703926.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