Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1553084rwb; Mon, 7 Nov 2022 03:03:49 -0800 (PST) X-Google-Smtp-Source: AMsMyM4rD9Iz0dg2aJLZWUqNqzGT01xIIbzoxLiqbnSCb1YCcVrRj/7MVaGDZGFpmmaTMvgNwqY6 X-Received: by 2002:a17:907:6d8c:b0:7ad:b45c:dd24 with SMTP id sb12-20020a1709076d8c00b007adb45cdd24mr44589011ejc.616.1667819028796; Mon, 07 Nov 2022 03:03:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667819028; cv=none; d=google.com; s=arc-20160816; b=gy/0+mGrNNhUH7gzthmYh9dYahvv8wfcNw2iNpZcvnogUEl4d0//jl6IUiginQrj8h /RCMwU53UC29Exmm1mP7w4dYjhq3tKodbv+I67PtskYNtD68wazhR9A35Ks17lhoPVwx RckPWlfxzid+nuQxQhVzdTmkrrHzNuiMAphvSXdDLdCCf0FiIwOBuzgaZWmTzHQKrN7k Iz3DHvAE8lv+sfMkzCWPQo1pf2D6a85sMfsLD2f4bjm4zMsWV8OEQFTqY0umhBB+HJ5t 2fnCiUsyzaM+dUB6BZJ1oeLB3OqP9GyG2acQzzzGBHIOCsoCCZxpYsTcb/uxqkaZuBkk fzQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=DJz2ooychjBsKMZBl04F3l2gQeHKKq6YHrxTeMQ600g=; b=oZE89VEY9FTaZz8fUf0i6ucH8CRmzkzE2vZRiMHGoswDFFE6uyHVKkLCwzOEfkt6Dw mrsEmNJvhEzyxuOwBuVq7CjvlWVgbyGNYZ6DlbC9H+q62ctfAwbquqMfXJ3ZbedcfRG8 a6qe7uFERpj05xpkV19HTfBpJcUGissRwGgfoyx5at+l0bKOO7GGH6j8fp9+2x1CwSMU dpj4TFWVhSCP5BVH2ymC9XBACZT20i0a2mzbGcvFJQ7LzPfjujwaPDFoKRLnuGTRM4Bn tLPCP4IxYIKzAtfdNPEZfE0MhOQprnJCnoqxjn3Dx95G1goQ4q8oXKTLbVZZ10eu795q J5Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=C+9+sbSa; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js3-20020a17090797c300b0073d8e4e8c77si9657473ejc.1005.2022.11.07.03.03.26; Mon, 07 Nov 2022 03:03:48 -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=C+9+sbSa; 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 S231607AbiKGKLF (ORCPT + 93 others); Mon, 7 Nov 2022 05:11:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231727AbiKGKK7 (ORCPT ); Mon, 7 Nov 2022 05:10:59 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D687618B0C for ; Mon, 7 Nov 2022 02:10:58 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667815857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DJz2ooychjBsKMZBl04F3l2gQeHKKq6YHrxTeMQ600g=; b=C+9+sbSajSMFIbT4q21lRn9bRksRO/EsPHUOIed9bl+CI/bCwrGzqKaKJIMbTJ3OrM6uJ1 1eDjRguh0Zc/TExv8YoH7rTab2GarJqMFatQUc1G9TkPoMK/dbMqUOZuWde5eZNpqxTHqx 6JQjW+sk4tPr+xal39nM2/R3Ftu0Ekm29kGtmV6wgdiEniRd+zIF4kGJDy5ZlSTm1XN/I5 In8yEGsiodZQP0Nd+7WPau+H7KtFqoYErn6HcZqYfgBAZhTYI64ulTvzqfF7c4hzaGOZhK 9kVlA/aQkJ2lvC4pZ7tVVdNRFLln3CzvIJh5zIfnO5M5yAZye5xuFbkU0HcBfg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667815857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DJz2ooychjBsKMZBl04F3l2gQeHKKq6YHrxTeMQ600g=; b=R3XyG3gPTBWCXcDWL2NyrsGbGS/q24oaZTmhB8yw7fAdcJx+Sbz09aPHNxzftY+jLENndn wiy1xV4+8HRxeRCw== To: paulmck@kernel.org, Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , boqun.feng@gmail.com Subject: Re: [PATCH printk v2 33/38] printk: introduce console_list_lock In-Reply-To: <20221027185007.GG5600@paulmck-ThinkPad-P17-Gen-1> References: <20221019145600.1282823-1-john.ogness@linutronix.de> <20221019145600.1282823-34-john.ogness@linutronix.de> <20221027185007.GG5600@paulmck-ThinkPad-P17-Gen-1> Date: Mon, 07 Nov 2022 11:16:56 +0106 Message-ID: <87a6539irz.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain 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: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-10-27, "Paul E. McKenney" wrote: > One way to save a line is as follows: > > WARN_ON_ONCE(IS_ENABLED(CONFIG_DEBUG_LOCK_ALLOC) && > debug_lockdep_rcu_enabled() && > srcu_read_lock_held(&console_srcu)); Unfortunately this suggestion does not work because debug_lockdep_rcu_enabled() only exists if CONFIG_DEBUG_LOCK_ALLOC is enabled. Would you be interested in having an empty implementation? Then my check would not need to be concerned about CONFIG_DEBUG_LOCK_ALLOC at all. It would become: WARN_ON_ONCE(debug_lockdep_rcu_enabled() && srcu_read_lock_held(&console_srcu)); The patch below could be used to achieve that. John --------8<------------- From 71d9e484d5128cd1e57e5bff5391d91789f444fa Mon Sep 17 00:00:00 2001 From: John Ogness Date: Mon, 7 Nov 2022 11:06:40 +0106 Subject: [PATCH] rcu: implement lockdep_rcu_enabled for !CONFIG_DEBUG_LOCK_ALLOC 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 --- 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