Message ID | 20221107141638.3790965-2-john.ogness@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2077390wru; Mon, 7 Nov 2022 06:18:51 -0800 (PST) X-Google-Smtp-Source: AMsMyM7AfUDaQ4Soekwd8ItdcwUJdP7Zju2igwAUtSbeTvfSEFkZ1e/oZwHASoBq84x/cK5x2PNU X-Received: by 2002:a17:906:5e14:b0:7ad:cb09:ccbd with SMTP id n20-20020a1709065e1400b007adcb09ccbdmr40884373eju.245.1667830731658; Mon, 07 Nov 2022 06:18:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667830731; cv=none; d=google.com; s=arc-20160816; b=KlBvu4m5zm/P55pwFProia4jJl3z+JVaElyskD1wXJGdAESA/Hix//Y+PP8wMHFffl higYzwkCtV59KfTIMx/xfjKEtalSjBaBk2BBvFbNNtlBP7A+D3vESnRlXG9+0ZtwDvr+ XjxjLFgW1OXnxVxI5tN18acqP4lMyTf1A1C7FkxIQ2uCbIx7uv9WqqU/eQ6DjJ7i5ws7 vQVMn6up3nRSAFXbqZozMIx1yucPSG0UDr0vjNj3oD3q/UhjwIzzrsUjNOB8PXezYmg6 cGpRDuxph7pqRo1089raseYT4tZoNDjHegQzNFa6DYCPXoW1YnDCtU6bmSULNfV/yr/8 p6Hw== 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:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=Hsx1u5F/1CiKvy2GFTZ4ZBzQ1rYlt65AF3SRkTuxsig=; b=IBknCJmel5Ks9PLPZpFR66yYjrP1z20JLfaEZHzuFsQPHJNY2PqPqN6PLW0IcO0eLB otOmz4APb7XwVMD5kPnUgmw9vgK1T5D/WpGDpavHmCDfu9jVKjpwKflzeOxD8SjptTyP vESGlrXRSetsJA/y/6T9mV304gg/WBrUryE5vyf45TIvxJIrxHrXCxeWJT5etscS9+oE Cvto53xsU1BP4sgCLSZhTc7xG3J7x5nGnU+DWNpOH1waJ6KxR9UKmUznXJQw58f+QOI0 FjvMx7L9Hurd4UzYDlhGMDZ0DrDH0KK8GbJEV9ayITWPgjTUwgXyIWJI0Nn07Uy1CAn5 fNXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=gGZzuKnO; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm5-20020a170907948500b0078e19e971b2si10802448ejc.915.2022.11.07.06.18.05; Mon, 07 Nov 2022 06:18:51 -0800 (PST) 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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=gGZzuKnO; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231918AbiKGOQq (ORCPT <rfc822;hjfbswb@gmail.com> + 99 others); Mon, 7 Nov 2022 09:16:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231367AbiKGOQn (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 7 Nov 2022 09:16:43 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16F5E19C2A; Mon, 7 Nov 2022 06:16:42 -0800 (PST) From: John Ogness <john.ogness@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667830600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hsx1u5F/1CiKvy2GFTZ4ZBzQ1rYlt65AF3SRkTuxsig=; b=gGZzuKnOEmjKPxnbVv/2pWVKTnVFnDA6n6uJGrTaFNs5ZYKCtrOZcWBE0nUslYYBrhiBFC wWXzKY0XCcdwU49sdLis2tWo+CqiLw27jBnhr7tjmFvfKL1ktOzUawjgzEsiy43FowPSV+ 2R9HP522uAqxmgAD/Z92yUxYQeOtbus8a/JAigqgIL9U1loZ5DnW140SsJvb8Ab/i7cokn 48tUsK+EubYJAZr2PCtGbTlP1T+9Z/al4ryuJnrvWsLq9PyqJYttnZWggUbaOgfsRQD3bQ FICdkdqh8pvtpKl3+PBEpjQJ6Ky3mRf3ya0jmwlyBd+Q6GZY4U1uV66yHgUUgA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667830600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hsx1u5F/1CiKvy2GFTZ4ZBzQ1rYlt65AF3SRkTuxsig=; b=O0NGeysRpJ2rTQa3JNmWJZLtFDJUBBFvVlOpA/ai0W0bs6FRiXV/Cp6mDv/3mE65r7hslX eRRyPQGXENizajAA== To: Petr Mladek <pmladek@suse.com> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>, Steven Rostedt <rostedt@goodmis.org>, Thomas Gleixner <tglx@linutronix.de>, linux-kernel@vger.kernel.org, "Paul E. McKenney" <paulmck@kernel.org>, Frederic Weisbecker <frederic@kernel.org>, Neeraj Upadhyay <quic_neeraju@quicinc.com>, Josh Triplett <josh@joshtriplett.org>, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, Lai Jiangshan <jiangshanlai@gmail.com>, Joel Fernandes <joel@joelfernandes.org>, rcu@vger.kernel.org Subject: [PATCH printk v3 01/40] rcu: implement lockdep_rcu_enabled for !CONFIG_DEBUG_LOCK_ALLOC Date: Mon, 7 Nov 2022 15:21:59 +0106 Message-Id: <20221107141638.3790965-2-john.ogness@linutronix.de> In-Reply-To: <20221107141638.3790965-1-john.ogness@linutronix.de> References: <20221107141638.3790965-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748847277075414811?= X-GMAIL-MSGID: =?utf-8?q?1748847277075414811?= |
Series |
reduce console_lock scope
|
|
Commit Message
John Ogness
Nov. 7, 2022, 2:15 p.m. UTC
Provide an implementation for debug_lockdep_rcu_enabled() when
CONFIG_DEBUG_LOCK_ALLOC is not enabled. This allows code to check
if rcu lockdep debugging is available without needing an extra
check if CONFIG_DEBUG_LOCK_ALLOC is enabled.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
I also sent this patch to Paul as a suggestion. If it is not
acceptable, I just need to add an ifdef CONFIG_DEBUG_LOCK_ALLOC
into console_list_lock() of patch 21.
include/linux/rcupdate.h | 5 +++++
1 file changed, 5 insertions(+)
Comments
On Mon, Nov 07, 2022 at 03:21:59PM +0106, John Ogness wrote: > Provide an implementation for debug_lockdep_rcu_enabled() when > CONFIG_DEBUG_LOCK_ALLOC is not enabled. This allows code to check > if rcu lockdep debugging is available without needing an extra > check if CONFIG_DEBUG_LOCK_ALLOC is enabled. > > Signed-off-by: John Ogness <john.ogness@linutronix.de> If you would like me to take this one, please let me know. Otherwise: Acked-by: Paul E. McKenney <paulmck@kernel.org> > --- > I also sent this patch to Paul as a suggestion. If it is not > acceptable, I just need to add an ifdef CONFIG_DEBUG_LOCK_ALLOC > into console_list_lock() of patch 21. > > include/linux/rcupdate.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h > index 08605ce7379d..65178c40ab6f 100644 > --- a/include/linux/rcupdate.h > +++ b/include/linux/rcupdate.h > @@ -340,6 +340,11 @@ static inline int rcu_read_lock_any_held(void) > return !preemptible(); > } > > +static inline int debug_lockdep_rcu_enabled(void) > +{ > + return 0; > +} > + > #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ > > #ifdef CONFIG_PROVE_RCU > -- > 2.30.2 >
On 2022-11-07, "Paul E. McKenney" <paulmck@kernel.org> wrote: >> Provide an implementation for debug_lockdep_rcu_enabled() when >> CONFIG_DEBUG_LOCK_ALLOC is not enabled. This allows code to check >> if rcu lockdep debugging is available without needing an extra >> check if CONFIG_DEBUG_LOCK_ALLOC is enabled. >> >> Signed-off-by: John Ogness <john.ogness@linutronix.de> > > If you would like me to take this one, please let me know. Yes, it would be great if you would carry this in the rcu tree. This printk series is already relying on the rcu tree for the NMI-safe work. Thanks! John
On Mon 2022-11-07 15:21:59, John Ogness wrote: > Provide an implementation for debug_lockdep_rcu_enabled() when > CONFIG_DEBUG_LOCK_ALLOC is not enabled. This allows code to check > if rcu lockdep debugging is available without needing an extra > check if CONFIG_DEBUG_LOCK_ALLOC is enabled. > > Signed-off-by: John Ogness <john.ogness@linutronix.de> Reviewed-by: Petr Mladek <pmladek@suse.com> Just a small nit below. > --- > I also sent this patch to Paul as a suggestion. If it is not > acceptable, I just need to add an ifdef CONFIG_DEBUG_LOCK_ALLOC > into console_list_lock() of patch 21. > > include/linux/rcupdate.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h > index 08605ce7379d..65178c40ab6f 100644 > --- a/include/linux/rcupdate.h > +++ b/include/linux/rcupdate.h > @@ -340,6 +340,11 @@ static inline int rcu_read_lock_any_held(void) > return !preemptible(); > } > > +static inline int debug_lockdep_rcu_enabled(void) > +{ > + return 0; > +} > + It would make sense to move this up before rcu_read_lock_held() definition so that the declarations and definitions are in the same order in both #ifdef CONFIG_DEBUG_LOCK_ALLOC branches. > #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ > > #ifdef CONFIG_PROVE_RCU Best Regards, PEtr
On Mon, Nov 07, 2022 at 08:29:01PM +0106, John Ogness wrote: > On 2022-11-07, "Paul E. McKenney" <paulmck@kernel.org> wrote: > >> Provide an implementation for debug_lockdep_rcu_enabled() when > >> CONFIG_DEBUG_LOCK_ALLOC is not enabled. This allows code to check > >> if rcu lockdep debugging is available without needing an extra > >> check if CONFIG_DEBUG_LOCK_ALLOC is enabled. > >> > >> Signed-off-by: John Ogness <john.ogness@linutronix.de> > > > > If you would like me to take this one, please let me know. > > Yes, it would be great if you would carry this in the rcu tree. This > printk series is already relying on the rcu tree for the NMI-safe > work. Thanks! Very good, I have queued it. It is currently on -rcu branch "dev", but will find its way to srcunmisafe.2022.10.21a in the next day or two. Thanx, Paul
On Tue, Nov 08, 2022 at 11:27:24AM -0800, Paul E. McKenney wrote: > On Mon, Nov 07, 2022 at 08:29:01PM +0106, John Ogness wrote: > > On 2022-11-07, "Paul E. McKenney" <paulmck@kernel.org> wrote: > > >> Provide an implementation for debug_lockdep_rcu_enabled() when > > >> CONFIG_DEBUG_LOCK_ALLOC is not enabled. This allows code to check > > >> if rcu lockdep debugging is available without needing an extra > > >> check if CONFIG_DEBUG_LOCK_ALLOC is enabled. > > >> > > >> Signed-off-by: John Ogness <john.ogness@linutronix.de> > > > > > > If you would like me to take this one, please let me know. > > > > Yes, it would be great if you would carry this in the rcu tree. This > > printk series is already relying on the rcu tree for the NMI-safe > > work. Thanks! > > Very good, I have queued it. It is currently on -rcu branch "dev", > but will find its way to srcunmisafe.2022.10.21a in the next day or two. But make that srcunmisafe.2022.11.09a, where it now resides. The old srcunmisafe.2022.10.21a remains in its previous location, just in case someone else is using it. Branches are cheap... Thanx, Paul
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 08605ce7379d..65178c40ab6f 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -340,6 +340,11 @@ static inline int rcu_read_lock_any_held(void) return !preemptible(); } +static inline int debug_lockdep_rcu_enabled(void) +{ + return 0; +} + #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ #ifdef CONFIG_PROVE_RCU