Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp687682rdf; Tue, 21 Nov 2023 13:38:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMOOMo3psUuctouEr59xgYfT27NGwOHLieWF1ixvOIzFxs7qHqvabPvLBPlElASxiTsi9+ X-Received: by 2002:a05:6a20:8e23:b0:188:2637:9245 with SMTP id y35-20020a056a208e2300b0018826379245mr336230pzj.55.1700602720793; Tue, 21 Nov 2023 13:38:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700602720; cv=none; d=google.com; s=arc-20160816; b=ZtMLLbbWDdhC45VQ7efUtq8RmfLmJ5uKrkJN5SZCQKhGUrDgy6xk+TKsfAqi//4j7N icz1BhTux/ZoKA6xY9Zwuy4CdTMUTvgji2oulU8JNKsuWbVH6uDUl6yfxDCy+s4wpwBN eSE4ZDZi2jfZCOoA8kuaAaDGSNZizCSRUz7J94j/cQzgAyqjPoZsBZv4fg/n0OJRVuRr zXRs4YQkAnh1xNU+sN3fPnWUESzGU/WZ3i4Wzvvhijd6Yhwp+GZF7YgAqtNKnyehhU5+ nKbZ3u6Vc/0uXeM8ld5sSRxAmdw6qRhd6OKjdZB1B9gOG+dqnAcCFHzMrItYJ5fpU9Na r2aA== 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=xyAeqVR2RuIYHTfxbeZmtaNA/0a2zT1AiZRVxSa+K3k=; fh=vPkT0MUfeSf8F0qTSrwwLC/zJmpdXIshSKgYe92oSUk=; b=NSoO11G11E2aEZPcFF/2ARC+VUllfi+KYQUHjgtp0oC0nd5EVi5X1Lu79BGrp/Ege+ wR2WiLSTCmt6sieJqbKzO7Bzncl/+zDJWKD0wS/smEAz0ApeyfeZPwU7wfN23Mn/PA31 S1/A6U0hMSafaQVIoCNyiLD4JOOQEJV+xTOJW3VuEBMeljr1MetjYW0I55Y3mHMz6n8X YbbdUHLyCqozqoNZV+N9MFq+K1KPhbDcHqDEWLu7WIS4FX5tnivNADYz/m2g74jzxSkg 6riN2oV7mgP8h5WPIlQ6hxQcbQwQ9DWTmeRKXouTx2/V4ocjfZGDMKRdIVnX4rEbfWAB 3wBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id bq20-20020a056a02045400b005b7dd1e13e7si12117578pgb.556.2023.11.21.13.38.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 13:38:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 4A65A805CF1B; Tue, 21 Nov 2023 13:38:38 -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 S234439AbjKUVia (ORCPT + 99 others); Tue, 21 Nov 2023 16:38:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjKUVi3 (ORCPT ); Tue, 21 Nov 2023 16:38:29 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68EDB191 for ; Tue, 21 Nov 2023 13:38:25 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31E17C433C7; Tue, 21 Nov 2023 21:38:21 +0000 (UTC) Date: Tue, 21 Nov 2023 16:38:34 -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: <20231121163834.571abb52@gandalf.local.home> In-Reply-To: <1cdbb0f6-9078-4023-bf37-8d826ca0c711@paulmck-laptop> References: <20231107215742.363031-1-ankur.a.arora@oracle.com> <20231107215742.363031-49-ankur.a.arora@oracle.com> <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> 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 13:38:38 -0800 (PST) On Tue, 21 Nov 2023 13:14:16 -0800 "Paul E. McKenney" wrote: > On Tue, Nov 21, 2023 at 09:30:49PM +0100, Peter Zijlstra wrote: > > On Tue, Nov 21, 2023 at 11:25:18AM -0800, Paul E. McKenney wrote: > > > #define preempt_enable() \ > > > do { \ > > > barrier(); \ > > > if (!IS_ENABLED(CONFIG_PREEMPT_RCU) && raw_cpu_read(rcu_data.rcu_urgent_qs) && \ > > > (preempt_count() & (PREEMPT_MASK | SOFTIRQ_MASK | HARDIRQ_MASK | NMI_MASK) == PREEMPT_OFFSET) && > > > !irqs_disabled()) \ Could we make the above an else case of the below if ? > > > rcu_all_qs(); \ > > > if (unlikely(preempt_count_dec_and_test())) { \ > > > __preempt_schedule(); \ > > > } \ > > > } while (0) > > > > Aaaaahhh, please no. We spend so much time reducing preempt_enable() to > > the minimal thing it is today, this will make it blow up into something > > giant again. Note, the above is only true with "CONFIG_PREEMPT_RCU is not set", which keeps the preempt_count() for preemptable kernels with PREEMPT_RCU still minimal. -- Steve