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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DEE5C433F5 for ; Thu, 18 Nov 2021 11:44:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C04B61107 for ; Thu, 18 Nov 2021 11:44:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3C04B61107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZuJLH60FquvAbXhaWiAXu80VGNnvwOthrK3a3x5SnwM=; b=SoW/KCv+hEh2IR ZLpWQUh98RPsoFSWae1DF1bL+JIFsBTSFdqxnjsNzY/n+pOV4acF7JJgfHNJzzzC7ZEc0aHdFo/1o OsQdze47PJEIz3JFqG81C83VXCRVLkYDvJtjiD4V7962E+uVPEWX5CJXFGmw8p+XGf3jf5wfYf1zA wDUOPxs/LaI/EufC+lUHanQ6v/tInTpnT1a94lbBn3QlnJcALfnBJSGj7pG9hyJletZnxUaOgos7A G51xjWQHP2hKaQTypGPIGq/8ez42q1ivHg8V193psuQ+1dIRJ5Q05/O+NGgyqpbE4sWofBfjENKI0 scLbBf5587m5dg5IB2UA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnfoF-007dRb-QL; Thu, 18 Nov 2021 11:42:31 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mnfoB-007dRA-Lt for linux-arm-kernel@lists.infradead.org; Thu, 18 Nov 2021 11:42:29 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7284C1FB; Thu, 18 Nov 2021 03:42:22 -0800 (PST) Received: from [10.57.82.45] (unknown [10.57.82.45]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 84BED3F5A1; Thu, 18 Nov 2021 03:42:20 -0800 (PST) Message-ID: Date: Thu, 18 Nov 2021 11:42:15 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Subject: Re: [PATCH v2 1/2] arm64: clear_page() shouldn't use DC ZVA when DCZID_EL0.DZP == 1 Content-Language: en-GB To: Reiji Watanabe Cc: Catalin Marinas , Will Deacon , Marc Zyngier , Mark Rutland , Peter Collingbourne , Evgenii Stepanov , linux-arm-kernel@lists.infradead.org, Peter Shier , Ricardo Koller , Oliver Upton , Jing Zhang , Raghavendra Rao Anata References: <20211108071149.823570-1-reijiw@google.com> <20211108071149.823570-2-reijiw@google.com> <574b481a-900c-3f91-9967-d117cde69a44@arm.com> From: Robin Murphy In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211118_034227_795614_754B508D X-CRM114-Status: GOOD ( 16.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021-11-18 08:18, Reiji Watanabe wrote: > On Tue, Nov 16, 2021 at 3:00 PM Robin Murphy wrote: >> >> On 2021-11-08 07:11, Reiji Watanabe wrote: >>> Currently, clear_page() uses DC ZVA instruction unconditionally. But it >>> should make sure that DCZID_EL0.DZP, which indicates whether or not use >>> of DC ZVA instruction is prohibited, is zero when using the instruction. >>> Use STP as memset does instead when DCZID_EL0.DZP == 1. >> >> Reviewed-by: Robin Murphy >> >> FWIW I did eventually figure out the "pre-bias" trick from v1 thanks to >> Mark's nod toward the original context, but a quick survey of various >> optimisation guides implied that the explicit add should generally be >> preferred over post-index writeback anyway, so I think we're all good here. > > Thank you for the review! > The original code, which used *pre*-index (not post-index) addressing, Oops, in the context I think I meant writeback in general anyway. This is what happens when a sudden urge to review random patches at 11PM strikes :) > made no significant difference in page_clear performance on my test > environment from the current code. > > Now, I am looking at creating v3 patches to use stnp instead of stp > in page_clear (NOTE: DC ZVA shows much better performance on my test > system than stp/stnp). > > Although using stnp didn't show significant difference in clear_page() > performance on my test system from stp (no significant difference in > cache-misses, cache_refill, cache_wb, or cache_allocate event counter > either), using stnp should be more appropriate for page_clear than stp, > and I understand it could show better performance on some CPUs. Indeed - certainly most Arm Ltd. cores tend to be good at spotting the store pattern and switching into write-streaming mode automatically - but semantically, STNP probably is appropriate for the great majority of clear_page() usage. Feel free to keep my review tag with that change. Thanks, Robin. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel