From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5799C04E69 for ; Mon, 31 Jul 2023 16:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233024AbjGaQBy (ORCPT ); Mon, 31 Jul 2023 12:01:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232397AbjGaQBn (ORCPT ); Mon, 31 Jul 2023 12:01:43 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71E7B1726; Mon, 31 Jul 2023 09:01:38 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id C96BC5C006E; Mon, 31 Jul 2023 12:01:37 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Mon, 31 Jul 2023 12:01:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1690819297; x=1690905697; bh=d5 dF3/UEnHkJTXw+9iMGuzyye12DF3XcugC4tBkJDDU=; b=m0kNMmJmwpdMk9chUj Nv47pJkPnChzBqAd6DmYtxnmKj8N2cnzD9rAbIC5oOiCG1970Tj0H0JG2F3ma+X8 fLlXR+Brrw6bOfWXs1VdFOopemuq088FhpAxOjx00xcGSOP6AMMF7uzowenBruCZ g5GXrFh+meQ1HKFYRJEDNgFVxKl2qEMaCqq75kqhcNT9+j1mgtE3zoYdHYomaMvk 4/1CciGNH/94Rk6GRiO4yQywuGljf4ZzdNLySgf1v83xB49hA+TtYzjWoXZcPPnZ QSATIzdpRxYso0zZq0+oph+qDifZPdPPT3DMrzg2QeCvP6US1+IWhx5rHpiX/W2p yQrQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1690819297; x=1690905697; bh=d5dF3/UEnHkJT Xw+9iMGuzyye12DF3XcugC4tBkJDDU=; b=Tb1mOB+s43WvrIiDpGmlcvMLu8434 YfNGjrSQDwygtj1XXkRvC7p+1WqeWmsf4jDCzEhikiUT2H7rAtvsyv8jv6uspwdN yjyIFcGD0hwrz7Fl2eCcnPR8U7/SX9ZVUlna1ZmUdkJYcpE/HuUG+M5aVy0YbGUB X5Ld2xYbruwfkPmsME8BbQPcgFVqcXYYs4ON7wS0NZiSX8YUX/aZ5OtAcvWVljzi Ldf8BEozpDUgwU2I6oFUFELIM4r31t56cMUrsOFih2kd5RGijziCJjU757EMHV+o KVVBjOsCWvx9I77SuL9LjUVqgPNwcKv7YbglWGIGUvJNiBR9BFqRHX1cg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrjeeggdejudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedtkeet ffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 597ABB6008F; Mon, 31 Jul 2023 12:01:34 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-592-ga9d4a09b4b-fm-defalarms-20230725.001-ga9d4a09b Mime-Version: 1.0 Message-Id: In-Reply-To: References: <20230702203429.237615-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20230702203429.237615-4-prabhakar.mahadev-lad.rj@bp.renesas.com> <92c00ddb-e956-4861-af80-5f5558c9a8f5@app.fastmail.com> <8b3466e4-a295-4249-bd05-2edbf7b3f6e3@app.fastmail.com> Date: Mon, 31 Jul 2023 18:01:13 +0200 From: "Arnd Bergmann" To: "Jisheng Zhang" Cc: guoren , =?UTF-8?Q?Heiko_St=C3=BCbner?= , "Emil Renner Berthing" , Prabhakar , "Conor.Dooley" , "Geert Uytterhoeven" , "Andrew Jones" , "Paul Walmsley" , "Palmer Dabbelt" , "Albert Ou" , "Samuel Holland" , linux-riscv@lists.infradead.org, "Christoph Hellwig" , "Rob Herring" , "Krzysztof Kozlowski" , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Linux-Renesas , "Biju Das" , "Lad, Prabhakar" Subject: Re: [PATCH v10 3/6] riscv: mm: dma-noncoherent: nonstandard cache operations support Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 31, 2023, at 17:43, Jisheng Zhang wrote: > On Mon, Jul 31, 2023 at 07:39:30AM +0200, Arnd Bergmann wrote: >> >> Not just the flushing, but also loading back the invalidated >> >> cache lines afterwards is just very expensive. I don't think >> >> you would be able to measure a difference between the static > > I read this as: the cache clean/inv is so expensive that the static > key saving percentage is trivial, is this understanding right? > > this could be measured by writing a small benchmark kernel module > which just calls cache clean/inv a buf(for example 1500Bytes)in a loop. While you can trivially measure the cost of the clean/inv operation, I think the higher cost is the fact that the cache lines are invalidated and have to be reloaded when accessing the data the next time. So if the loop test shows that the static key is not worth it, that is a clear answer, but if it shows that the cache operation itself is cheap, that does not automatically mean that the static key makes a difference compared to a cache miss. Arnd