From patchwork Wed Aug 31 18:15:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 12961277 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55914ECAAD4 for ; Wed, 31 Aug 2022 18:30:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233004AbiHaSam (ORCPT ); Wed, 31 Aug 2022 14:30:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232455AbiHaSaT (ORCPT ); Wed, 31 Aug 2022 14:30:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE31011A24; Wed, 31 Aug 2022 11:25:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0288AB82220; Wed, 31 Aug 2022 18:16:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9089DC433D7; Wed, 31 Aug 2022 18:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661969758; bh=vAqwYNsiS6egYw7ZedEOtoVgOp435w0oQaSAHoj18bA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F8ujJA9VEAg5qDXZG560Dml6+TqsFiw5tWVN4V3aFk5s8aUIN89fb9vgHH1IFNvVC i8nKfYtAS0xBTI+Dgrh371CC4Q/WUGtM1dLKaMaynkl7Xs7wiU87o96fNivnsvEzoY 1hg6FO+Rzg13ASnThr4F3mGh93BFBfhciHJrqOnB+xSsmr79OkI7reqhroceB9XGkX eMzdngAtEwJhfTFsH6/iVLDy80P0AUCdSCbtcuKScMgYcX/3GPR7cx4ttAR3QvhVsV 1uPrPbfk42WwsNWIHxDsOoSi/HVC19AlOb5ywDxhtuPggk60zogIjsdy3pjW9ExLEN 6VMz6bcemZwmQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 5142A5C015D; Wed, 31 Aug 2022 11:15:58 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, Zqiang , "Paul E . McKenney" Subject: [PATCH rcu 1/3] rcu-tasks: Convert RCU_LOCKDEP_WARN() to WARN_ONCE() Date: Wed, 31 Aug 2022 11:15:54 -0700 Message-Id: <20220831181556.2696404-1-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20220831181553.GA2696186@paulmck-ThinkPad-P17-Gen-1> References: <20220831181553.GA2696186@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: rcu@vger.kernel.org From: Zqiang Kernels built with CONFIG_PROVE_RCU=y and CONFIG_DEBUG_LOCK_ALLOC=y attempt to emit a warning when the synchronize_rcu_tasks_generic() function is called during early boot while the rcu_scheduler_active variable is RCU_SCHEDULER_INACTIVE. However the warnings is not actually be printed because the debug_lockdep_rcu_enabled() returns false, exactly because the rcu_scheduler_active variable is still equal to RCU_SCHEDULER_INACTIVE. This commit therefore replaces RCU_LOCKDEP_WARN() with WARN_ONCE() to force these warnings to actually be printed. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney --- kernel/rcu/tasks.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h index 83c7e6620d403..469bf2a3b505e 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -560,7 +560,7 @@ static int __noreturn rcu_tasks_kthread(void *arg) static void synchronize_rcu_tasks_generic(struct rcu_tasks *rtp) { /* Complain if the scheduler has not started. */ - RCU_LOCKDEP_WARN(rcu_scheduler_active == RCU_SCHEDULER_INACTIVE, + WARN_ONCE(rcu_scheduler_active == RCU_SCHEDULER_INACTIVE, "synchronize_rcu_tasks called too soon"); // If the grace-period kthread is running, use it.