Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp756668rdf; Tue, 21 Nov 2023 16:12:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSIAInwkxq1dANYiqVQ5gsfgodsQoyK8SAiPScbUYnyWrSOkKfgBFKlz3FKTaKVIVArxhU X-Received: by 2002:a17:90b:38c7:b0:283:2d65:f231 with SMTP id nn7-20020a17090b38c700b002832d65f231mr1356437pjb.22.1700611958951; Tue, 21 Nov 2023 16:12:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700611958; cv=none; d=google.com; s=arc-20160816; b=ROE84ZggJG4009UbUM8UIBNGTpPdC3v1bhSB+jGjZ0N0a0zzREpL52hbogv0LDjp+Y qtkz14BqEE92eeTJ0uvLrKlZSfX2I7w2+rLMlaSPxkxm8W+5Xrg5roGP46OGpDDezrzh JlYYVkLQDxM4XEN5sm1E5zqoMD074td3Sz0VKvJItMqEks7JZVwi/aqoRjBD9zGPbEw3 SoZ3P3aARqLOjeiSc3C0wnUKfWZWjGHtKLIAxLwmoev74geyNckNjS53N2a7I90Q0ZM5 QBdyL81MPn6yU0iJsLim9GBnoEABcT4EoOOUrC8Ovqxi8zlaeX2B2E5NejxI/OcOpcqB WMWA== 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=aPjubadQVqYCa5a2sEA68idorDicvWq62PznNQBMxzc=; fh=vPkT0MUfeSf8F0qTSrwwLC/zJmpdXIshSKgYe92oSUk=; b=eX+YNtVsPeod8sNM0adYIktW/u4wRDg8jScCIHZZi/jmV9t/pxFO95X7FPDu8CT4lJ I8ZQacRCYbKevcX8PH1PrV7OvKVLNnTw7Ndl8kM4PUwnzzAXQUVgWgVkWl4TbWUDNWMs EsG75aFhuQzM1yCKaKzP4T/YpxLWgQHU9vEWmSXCfgBx/s7aVndMikKDnz8ZWHf9AdwL WmX46hxJPwVDeDj+zQlIA5OikA8W2HFXD6q+KhLAcDVFmT6MxhzPY8rlec9j7EKm/Chx rqimeRxH8PfEB1VVC7Q2rZlipd6z6ylR9Y5WG8r+554+k/+YCfo74X3wjGDsDSgbbaHD bfTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id mi6-20020a17090b4b4600b002805a422743si241344pjb.12.2023.11.21.16.12.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 16:12:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 6F12480212F8; Tue, 21 Nov 2023 16:12:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229787AbjKVAM2 (ORCPT + 99 others); Tue, 21 Nov 2023 19:12:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbjKVAM1 (ORCPT ); Tue, 21 Nov 2023 19:12:27 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B78F89F for ; Tue, 21 Nov 2023 16:12:22 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C29CC433C7; Wed, 22 Nov 2023 00:12:18 +0000 (UTC) Date: Tue, 21 Nov 2023 19:12:32 -0500 From: Steven Rostedt To: "Paul E. McKenney" Cc: Peter Zijlstra , Ankur Arora , linux-kernel@vger.kernel.org, tglx@linutronix.de, torvalds@linux-foundation.org, linux-mm@kvack.org, x86@kernel.org, akpm@linux-foundation.org, luto@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, willy@infradead.org, mgorman@suse.de, jon.grimm@amd.com, bharata@amd.com, raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, jgross@suse.com, andrew.cooper3@citrix.com, mingo@kernel.org, bristot@kernel.org, mathieu.desnoyers@efficios.com, geert@linux-m68k.org, glaubitz@physik.fu-berlin.de, anton.ivanov@cambridgegreys.com, mattst88@gmail.com, krypton@ulrich-teichert.org, David.Laight@aculab.com, richard@nod.at, mjguzik@gmail.com Subject: Re: [RFC PATCH 48/86] rcu: handle quiescent states for PREEMPT_RCU=n Message-ID: <20231121191232.630222d3@gandalf.local.home> In-Reply-To: <0d6a8e80-c89b-4ded-8de1-8c946874f787@paulmck-laptop> References: <2027da00-273d-41cf-b9e7-460776181083@paulmck-laptop> <87lear4wj6.fsf@oracle.com> <46a4c47a-ba1c-4776-a6f8-6c2146cbdd0d@paulmck-laptop> <31d50051-e42c-4ef2-a1ac-e45370c3752e@paulmck-laptop> <20231121203049.GN8262@noisy.programming.kicks-ass.net> <1cdbb0f6-9078-4023-bf37-8d826ca0c711@paulmck-laptop> <20231121163834.571abb52@gandalf.local.home> <4605b4f4-8a2b-4653-b684-9c696c36ebd0@paulmck-laptop> <20231121175209.1d7ec202@gandalf.local.home> <0d6a8e80-c89b-4ded-8de1-8c946874f787@paulmck-laptop> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 21 Nov 2023 16:12:36 -0800 (PST) On Tue, 21 Nov 2023 16:01:24 -0800 "Paul E. McKenney" wrote: > > > I stand by that being in the else statement. It looks like that would keep > > the previous work flow. > > Ah, because PREEMPT_NEED_RESCHED is zero when we need to reschedule, > so that when __preempt_count_dec_and_test() returns false, we might > still be in an RCU quiescent state in the case where there was no need > to reschedule. Good point! > > In which case... > > #define preempt_enable() \ > do { \ > barrier(); \ > if (unlikely(preempt_count_dec_and_test())) \ > __preempt_schedule(); \ > else if (!sched_feat(FORCE_PREEMPT) && \ > (preempt_count() & (PREEMPT_MASK | SOFTIRQ_MASK | HARDIRQ_MASK | NMI_MASK) == PREEMPT_OFFSET) && \ > !irqs_disabled()) \ > ) \ > rcu_all_qs(); \ > } while (0) > > Keeping rcu_all_qs() pretty much as is. Or some or all of the "else if" > condition could be pushed down into rcu_all_qs(), depending on whether > Peter's objection was call-site object code size, execution path length, > or both. ;-) > > If the objection is both call-site object code size and execution path > length, then maybe all but the preempt_count() check should be pushed > into rcu_all_qs(). > > Was that what you had in mind, or am I missing your point? Yes, that is what I had in mind. Should we also keep the !IS_ENABLED(CONFIG_PREEMPT_RCU) check, which makes the entire thing optimized out when PREEMPT_RCU is enabled? -- Steve