Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp611811rwn; Thu, 8 Sep 2022 06:31:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR6rnY4grFDYS4NSgqtNx6IFTZliX9vc9gA51LgvYmVcTRtbUHvuGLHzaiF/jRz3RmnjmFIt X-Received: by 2002:a17:907:7632:b0:76f:f6e7:36cf with SMTP id jy18-20020a170907763200b0076ff6e736cfmr6303356ejc.442.1662643916893; Thu, 08 Sep 2022 06:31:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662643916; cv=none; d=google.com; s=arc-20160816; b=Kk7TJab9a2rtImSIFBE347PnJGkTpWTXpe84OP7j3CcEOWCSXAazeBzTq4dapAxfFX kniVt8LHn8FqqJs54CFDPfZup3xf2n9nD+nULF6tmZvSmM756H8p0rqVhavY5GQ2hDOg aGSQFOL+8ZnpTbEsO/1dIS4tOJIhIJt6jvY1I8dMZiHfDjBw+mXa5kcHzlVVT9bCsWAW 4bviClOUNtLJhj0wmMiT2QaVPqZWXIPfVC1XGeSo02HCUCIky69K+a8B1UefflZCfZTS GwYSIhh18ChUVLJebHwDp3y24TYVRrM6AIK0aTSfxLKurX/c6cKFJ01bmybX4id4CkPE 50tw== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=TC+tp1l2E5djbKmKaNv/zqd5PaimCZ7Uov/jWXJC2II=; b=L68j8v5HQIintPBYSh20dGcydeQZ27PTWvrWf4sSkEWqxi/9CdN1evIkExQvvMO+5W ucNrKPC01r9itI5shrFvcJBzfQaveqzxpr4CYb/Wi16YE8k9sTIPQj1oJI5GMzARSOcN YSXevQDxo/2ZEAz+2kxHCrQ4Ob5GS+5i6DNLAne3c6C3OIKglMUZ7/Fbso+w3FOixTBV jyqfZ7FMqn8E+F55N1p1dXBqYBrF8riks9WYPjJosgZx7b7LezSTJTDnzitr7Ja6jFy2 De+rVAajMp058vW2HJpHV7UgQjlOtbUKWQ+BJMAW6tOEIFu3nA0zgS89C/MM1Thlh2w3 rS3w== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i15-20020a1709064fcf00b0073d19e6ce0bsi2437783ejw.301.2022.09.08.06.31.30; Thu, 08 Sep 2022 06:31:56 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231172AbiIHNOQ (ORCPT + 99 others); Thu, 8 Sep 2022 09:14:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbiIHNON (ORCPT ); Thu, 8 Sep 2022 09:14:13 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F980D741B; Thu, 8 Sep 2022 06:13:50 -0700 (PDT) Received: from fraeml703-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MNffn2sX8z67NB8; Thu, 8 Sep 2022 21:12:17 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by fraeml703-chm.china.huawei.com (10.206.15.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.31; Thu, 8 Sep 2022 15:13:20 +0200 Received: from localhost (10.202.226.42) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 8 Sep 2022 14:13:20 +0100 Date: Thu, 8 Sep 2022 14:13:19 +0100 From: Jonathan Cameron To: Dan Williams CC: Andrew Morton , Davidlohr Bueso , , , , , , , , , , Subject: Re: [PATCH -next] memregion: Add arch_flush_memregion() interface Message-ID: <20220908141319.00000f01@huawei.com> In-Reply-To: <631940536d040_2736529437@dwillia2-xfh.jf.intel.com.notmuch> References: <20220829212918.4039240-1-dave@stgolabs.net> <20220907153016.f7cd4f42a337fedae8319f28@linux-foundation.org> <631940536d040_2736529437@dwillia2-xfh.jf.intel.com.notmuch> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.226.42] X-ClientProxiedBy: lhrpeml500005.china.huawei.com (7.191.163.240) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Sep 2022 18:07:31 -0700 Dan Williams wrote: > Andrew Morton wrote: > > I really dislike the term "flush". Sometimes it means writeback, > > sometimes it means invalidate. Perhaps at other times it means > > both. > > > > Can we please be very clear in comments and changelogs about exactly > > what this "flush" does. With bonus points for being more specific in the > > function naming? > > > > That's a good point, "flush" has been cargo-culted along in Linux's > cache management APIs to mean write-back-and-invalidate. In this case I > think this API is purely about invalidate. It just so happens that x86 > has not historically had a global invalidate instruction readily > available which leads to the overuse of wbinvd. > > It would be nice to make clear that this API is purely about > invalidating any data cached for a physical address impacted by address > space management event (secure erase / new region provision). Write-back > is an unnecessary side-effect. > > So how about: > > s/arch_flush_memregion/cpu_cache_invalidate_memregion/? Want to indicate it 'might' write back perhaps? So could be invalidate or clean and invalidate (using arm ARM terms just to add to the confusion ;) Feels like there will be potential race conditions where that matters as we might force stale data to be written back. Perhaps a comment is enough for that. Anyone have the "famous last words" feeling? Jonathan