Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1817730rwb; Wed, 5 Oct 2022 05:23:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7SQb6Nkjq8rywkDfHS8qDba7d6tdFVYPwln1qH6q4LuXwA6Htxaod2X6P1NYQdHP9iUROc X-Received: by 2002:a63:f250:0:b0:44e:633b:23ae with SMTP id d16-20020a63f250000000b0044e633b23aemr13382155pgk.17.1664972590745; Wed, 05 Oct 2022 05:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664972590; cv=none; d=google.com; s=arc-20160816; b=UX75jlO1K7/mIUGQPgRmVK8D8trK2cc+FrPPCG8TTFdvAJnYUX+VxBvIu+LUUiRopc acda4+YV7kqiH8GcFrDdl6apDqaSOYtlUX5HpJYn9pS0vdr0aDQb95negcOkAPtsikqH IzByMrLDCP9blrJNiHU0FpZHcFBf7UWpRySLyYl12GTarBXq/k+vVYQXFJ5/2GRyxUTu 1JyCtEEE70J2OTzwwEsEzVJNilc+0mpjic7UbFa6nBC1m/d3IvAtcMvPh9D10749ak1r 7aZY60jOhZnY9hu0bHHttkkHkky+1mhuN8hASthk62M3Jr4ghCnRz8tXlQks7iJuJuI4 510g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=/whAxD2PDgRZ0DllUe6fden7NBfCXhbIs4kVYozJmLU=; b=B5gwzYCHiNIzNodBoXCMXBNzc25ckgecQ4KehZ7gxdYWr/JUUDR6QO+tk9Pls5Gt9Q o9g9jw9+20/4KJGJ2wWNPfMeUsHAYtoQwLC15eapCLjVPZawJ53LYVkkyvP6OVcH+sXy hRDYiy54xlEW7bJdbqQxwEo83cP2l7jVpSHwIwBuuwnAlCTp04UM4uXfcXRGdytlZmtM dAZlkiV7g77upN9otBeDr+bExyYg/JKtNIv9MA6pEOoKPpf+zV/bmAZ/9TB8941+fgWw z0EqtF+nLFHr35V1eqAcL2eJROElXqKolPx5ZdXvEdDNFCu8zjKqookkbLpsquGBQj/G 1Tqg== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f60-20020a17090a704200b0020ab86146b2si1861522pjk.108.2022.10.05.05.22.58; Wed, 05 Oct 2022 05:23:10 -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=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229791AbiJELMk (ORCPT + 99 others); Wed, 5 Oct 2022 07:12:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbiJELMi (ORCPT ); Wed, 5 Oct 2022 07:12:38 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4BA8452FC6; Wed, 5 Oct 2022 04:12:37 -0700 (PDT) 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220929180731.2875722-6-paulmck@kernel.org> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE 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 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 >