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 X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00E2CC07E96 for ; Tue, 6 Jul 2021 07:51:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC925619A5 for ; Tue, 6 Jul 2021 07:51:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230309AbhGFHyF (ORCPT ); Tue, 6 Jul 2021 03:54:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230223AbhGFHyE (ORCPT ); Tue, 6 Jul 2021 03:54:04 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 484A3C061574 for ; Tue, 6 Jul 2021 00:51:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=h2+X2jUiUw7N4xQlb+2GXTRE5SiK3oXBKYl3mVIx76g=; b=ER59DZ6AwzG4JMo5pUPR+nZpMD DSo3rIqaYKZe2q8/nxrfyF0OdiyiwwZ2daPfS0jIlhfZayhwCpisitfHwpUVueDDqGf1jdkE8/zjO a/Zy2VIkBoo+ClUJ8smti5yk3KlwL7eSpSTl7Mg38gMfJ0su9TnerqWF4DDkLWXC0HeHEVs6Pv48d O1OFDz6IghSin6QuRqz5KTPS6Sl4u3OkM4XXC/rjVTBETxbQ1Pnndw8hAydquQ3xIpZAAYFJ3NUMf pDtVUgxeSdnL+gU9hwcBj50TKQz4/3DmkrC052ixiGPSpFSYP9yuIPpstgiw2z+PmX7UvZJPRkAcT ns+MQGGg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1m0frD-00AyHU-06; Tue, 06 Jul 2021 07:51:11 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id ACE8F3001DC; Tue, 6 Jul 2021 09:51:01 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 92FF1200E1E68; Tue, 6 Jul 2021 09:51:01 +0200 (CEST) Date: Tue, 6 Jul 2021 09:51:01 +0200 From: Peter Zijlstra To: Frederic Weisbecker Cc: "Paul E . McKenney" , LKML , Uladzislau Rezki , Boqun Feng , Ingo Molnar , Neeraj Upadhyay , Joel Fernandes Subject: Re: [PATCH 2/2] rcu: Remove needless preemption disablement in rcu_all_qs() Message-ID: References: <20210705234344.104239-1-frederic@kernel.org> <20210705234344.104239-2-frederic@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210705234344.104239-2-frederic@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 06, 2021 at 01:43:44AM +0200, Frederic Weisbecker wrote: > The preemption is already disabled when we write rcu_data.rcu_urgent_qs. > We can use __this_cpu_write() directly, although that path is mostly > used when CONFIG_PREEMPT=n. > > Signed-off-by: Frederic Weisbecker > Cc: Neeraj Upadhyay > Cc: Joel Fernandes > Cc: Uladzislau Rezki > Cc: Boqun Feng > --- > kernel/rcu/tree_plugin.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h > index 27b74352cccf..38b3d01424d7 100644 > --- a/kernel/rcu/tree_plugin.h > +++ b/kernel/rcu/tree_plugin.h > @@ -871,7 +871,7 @@ void rcu_all_qs(void) > preempt_enable(); > return; > } > - this_cpu_write(rcu_data.rcu_urgent_qs, false); > + __this_cpu_write(rcu_data.rcu_urgent_qs, false); There's another subtle difference between this_cpu_write() and __this_cpu_write() aside from preempt. this_cpu_write() is also IRQ-safe, while __this_cpu_write() is not. I've not looked at the usage here to see if that is relevant, but the Changelog only mentioned the preempt side of things, and that argument is incomplete in general.