Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp474162imw; Thu, 14 Jul 2022 05:10:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sizAcXGAtHMvDYx6nQL4w8+O6YA3suQT3K3o0O6ne02F8oe038tam1TvpGCb9PyT2JeYw4 X-Received: by 2002:a17:906:3989:b0:70c:2090:b498 with SMTP id h9-20020a170906398900b0070c2090b498mr8555241eje.56.1657800622591; Thu, 14 Jul 2022 05:10:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657800622; cv=none; d=google.com; s=arc-20160816; b=ZzRi5tSqVrgzRNeTqYA6nQiklRpdHhZbBQXLouRDbkJuQCQD1R8bOCzree+pZoh+CO 68FKoJuRG6d+WQimogTTtfQGQOYli+qJfaz73LlQKofpqe1V4A0GH8sEpVwr/uifvkE0 FHfUgEVZZi4tueTWhrDqWRY3Hyhii4BuK2dbUmFyTOuVOv6GmSbUDhluO+qbq/upWRoz 28qxVPBPqnjUutIqWTiSHV4ACDk3CaMQ6O0dui6MUpL6gOMX4CGow9FWM2bgXdOaD3Ok DPnnROU+7LQhp+2RKTICZROg1uINzTg7oVNDem4zn23QpZVCpI5zGAxpG+Gzs2FdkhFA Qjiw== 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=J+Ri9ng/R0m9gx3zZtqNYdl+SVMQRMpFvanndY7U8JI=; b=VEMr55GYhO0PPN0DiksfHcAtVzKgXjDxX7ivZvHGbAnh80tIP0ECO+5VxBLLLqH9r7 3B43cf9XpSzqmFWbcJ+Gj/tgnFm/c+yfyTm8Lq73LAXVxM8TJ+90+ZBECd+YxSZ+6Qyl FRxwbq5R0I2rt2i93Xi8Zib/2uZtQpXwc9p11ltAbQpQjFr8EcGa4HX3GkE5VPI7pjat LXy/C+PF+eMBJJ7Nh53c+lJOAGA+DlQj6QrrNGerkr1mLQ2gkT8DBDaXx8xRuz/PNPtp WzJt2xFeUrrFMF70MiVsCAzwGzLU8xYtHgffbL5w4KoP37tpO/0C65AOvUJ8dvEKfZIX vxIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=pKunhve3; 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 qa36-20020a17090786a400b006feb3a01b16si1058657ejc.683.2022.07.14.05.09.54; Thu, 14 Jul 2022 05:10:22 -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=pKunhve3; 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 S238844AbiGNMHI (ORCPT + 99 others); Thu, 14 Jul 2022 08:07:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238740AbiGNMGf (ORCPT ); Thu, 14 Jul 2022 08:06:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D6545C9EE for ; Thu, 14 Jul 2022 05:06:33 -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 08E46B824DC for ; Thu, 14 Jul 2022 12:06:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74C1CC341CA; 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=k6CXTL8ceMAzWtFMfpdGKkaoDa07ImXWLg+e0JE66dg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pKunhve3qZujvooirtyHbI4zCCgeMc3wzGjIDG0l2qd69h+MvnWTX69mkKVHEdLzi B6kPxxlNHfCi5sTgNFO2DgQ8T38EBTjc/PgHal5yBQY+zT1E/mkXz+bKfowzIFre7r GIe2H26ysSxaThpdPrVHe4yV5+0GNtv2lZ7Ok/eq9m8QYCKwIGWzRfcLY6h4BBrfCh IHoW3Zu7mr2vhef2mnEo7BbtaQ5mOeqblB8+W0dukCX71e8OjX6kRrXiPq0Wk6R3uN DHSsstCOKc2vOkIaxKqoBtiyyrtWMoVA1PyUo+WKa+VZCkqen6BW5LiLtFUwCe9duE /YpkPh1a+WjFg== Received: from mchehab by mail.kernel.org with local (Exim 4.95) (envelope-from ) id 1oBxbv-0059sn-Ts; Thu, 14 Jul 2022 13:06:27 +0100 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Daniel Vetter , 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 Subject: [PATCH v2 07/21] drm/i915/gt: describe the new tlb parameter at i915_vma_resource Date: Thu, 14 Jul 2022 13:06:12 +0100 Message-Id: X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 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 TLB cache invalidation can happen on two different situations: 1. synchronously, at __vma_put_pages(); 2. asynchronously. On the first case, TLB cache invalidation happens inside __vma_put_pages(). So, no need to do it later on. However, on the second case, the pages will keep in memory until __i915_vma_evict() is called. So, we need to store the TLB data at struct i915_vma_resource, in order to do a TLB cache invalidation before allowing userspace to re-use the same memory. So, i915_vma_resource_unbind() has gained a new parameter in order to store the TLB data at the second case. Document it. 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_resource.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_vma_resource.c b/drivers/gpu/drm/i915/i915_vma_resource.c index 5a67995ea5fe..4fe09ea0a825 100644 --- a/drivers/gpu/drm/i915/i915_vma_resource.c +++ b/drivers/gpu/drm/i915/i915_vma_resource.c @@ -216,6 +216,10 @@ i915_vma_resource_fence_notify(struct i915_sw_fence *fence, /** * i915_vma_resource_unbind - Unbind a vma resource * @vma_res: The vma resource to unbind. + * @tlb: pointer to vma->obj->mm.tlb associated with the resource + * to be stored at vma_res->tlb. When not-NULL, it will be used + * to do TLB cache invalidation before freeing a VMA resource. + * used only for async unbind. * * At this point this function does little more than publish a fence that * signals immediately unless signaling is held back. -- 2.36.1