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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6A6E4C433FE for ; Wed, 5 Oct 2022 11:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2GVuTRmZ+9aDYDFVadApvUO4laX+Q1iTlGLwP2qZMiA=; b=XMaxvPRnNGCXxS 3ptSpprTuB7xrkEZVbGnh0o6ltVkBhquECpRqZYDXIa8ClWcfbutb5I2wNjOpDYlgUP/Si0bYQdwn 2FR+I+jOCql/vC6oTc/RiWPawVWGFsCwYdq4f7TRXHtA0vRBOXy0PBuuOZXDoFafTf86SO6tPlSsC lgluHJXbIrkhpMqJU4uUErzVFoxxb4XDVJlvAtGSePbEYQ4spc9K5xxXqEOmH+FTE3dKOYsiDfc6/ 2ncsv/Sa8TtqpUe38Wr+wzTyZ8PXgMw7BN0Gd9Syp7M2UCrE4ZcA8rPg1sMLEY4hz8CyGVv8+twID mZlWRHZj2L0k60BSXEzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1og2Kj-00Djrr-T9; Wed, 05 Oct 2022 11:13:01 +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 1og2Ke-00Dja7-P3 for linux-arm-kernel@lists.infradead.org; Wed, 05 Oct 2022 11:12:58 +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 81643106F; Wed, 5 Oct 2022 04:12:43 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.3.221]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 781673F73B; Wed, 5 Oct 2022 04:12:34 -0700 (PDT) Date: Wed, 5 Oct 2022 12:12:29 +0100 From: Mark Rutland To: "Paul E. McKenney" Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, Neeraj Upadhyay , Frederic Weisbecker , Boqun Feng , Catalin Marinas , Will Deacon , Thomas Gleixner , John Ogness , Petr Mladek , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH RFC v2 rcu 6/8] arch/arm64: Add ARCH_HAS_NMI_SAFE_THIS_CPU_OPS Kconfig option Message-ID: References: <20220929180714.GA2874192@paulmck-ThinkPad-P17-Gen-1> <20220929180731.2875722-6-paulmck@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220929180731.2875722-6-paulmck@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221005_041256_884257_58C3E40C X-CRM114-Status: GOOD ( 21.22 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Paul, On Thu, Sep 29, 2022 at 11:07:29AM -0700, Paul E. McKenney wrote: > The arm64 architecture uses either an LL/SC loop (old systems) or an LSE > stadd instruction (new systems) to implement this_cpu_add(), both of which > are NMI safe. IIUC "NMI safe" here just means atomic w.r.t. an NMI being taken and modfying the same location the atomic was targetting (i.e. just like ARCH_HAVE_NMI_SAFE_CMPXCHG, which arm64 selects today). Assuming so: Acked-by: Mark Rutland Only this patch went to LAKML, so maybe an earlier patch made that clear, but I didn't spot it. As one minor nit, it would be nice to align the naming with ARCH_HAVE_NMI_SAFE_CMPXCHG and select them next to each other in the Kconfig file is possible, but the Ack stands regardless. Thanks, Mark. > This means that the old and more-efficient srcu_read_lock() > may be used in NMI context, without the need for srcu_read_lock_nmisafe(). > Therefore, add the new Kconfig option ARCH_HAS_NMI_SAFE_THIS_CPU_OPS to > arch/arm64/Kconfig, which will cause NEED_SRCU_NMI_SAFE to be deselected, > thus preserving the current srcu_read_lock() behavior. > > Link: https://lore.kernel.org/all/20220910221947.171557773@linutronix.de/ > > Suggested-by: Neeraj Upadhyay > Suggested-by: Frederic Weisbecker > Suggested-by: Boqun Feng > Signed-off-by: Paul E. McKenney > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Thomas Gleixner > Cc: John Ogness > Cc: Petr Mladek > Cc: > --- > arch/arm64/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index 571cc234d0b3..664725a0b5dd 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -31,6 +31,7 @@ config ARM64 > select ARCH_HAS_KCOV > select ARCH_HAS_KEEPINITRD > select ARCH_HAS_MEMBARRIER_SYNC_CORE > + select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS > select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE > select ARCH_HAS_PTE_DEVMAP > select ARCH_HAS_PTE_SPECIAL > -- > 2.31.1.189.g2e36527f23 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel