From nobody Fri Dec 19 22:01:26 2025 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 C4B0DECAAA1 for ; Mon, 24 Oct 2022 13:26:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233200AbiJXN0e (ORCPT ); Mon, 24 Oct 2022 09:26:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235897AbiJXNX5 (ORCPT ); Mon, 24 Oct 2022 09:23:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC0EA53001; Mon, 24 Oct 2022 05:30:12 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 1B134612E7; Mon, 24 Oct 2022 12:28:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30544C433D6; Mon, 24 Oct 2022 12:28:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614528; bh=oSqopbRO77nvGov1G/esShYNUZjCZlTROPXoWvX/7Ic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KQS5Pd5lTAO8Ztw1Y3n8L2HH0vhbQ2KKUFPJVrOFEKOG2q8cvFdRvgsfpmUAP/cgJ ZyqSoLlDvCOfb17+jhchUPz+x8qZZ082ZALwErZ3cjE2xc1uxioIMdvrNJsmLTn0+V 5z10uEl1Hlwbm1MJaE55WxnrH8r6TApNPF5dC698= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zqiang , "Paul E. McKenney" , Sasha Levin Subject: [PATCH 5.10 296/390] rcu-tasks: Convert RCU_LOCKDEP_WARN() to WARN_ONCE() Date: Mon, 24 Oct 2022 13:31:33 +0200 Message-Id: <20221024113035.607806092@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Zqiang [ Upstream commit fcd53c8a4dfa38bafb89efdd0b0f718f3a03f884 ] Kernels built with CONFIG_PROVE_RCU=3Dy and CONFIG_DEBUG_LOCK_ALLOC=3Dy 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 Signed-off-by: Sasha Levin --- 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 14af29fe1377..8b51e6a5b386 100644 --- a/kernel/rcu/tasks.h +++ b/kernel/rcu/tasks.h @@ -171,7 +171,7 @@ static void call_rcu_tasks_generic(struct rcu_head *rhp= , rcu_callback_t func, static void synchronize_rcu_tasks_generic(struct rcu_tasks *rtp) { /* Complain if the scheduler has not started. */ - RCU_LOCKDEP_WARN(rcu_scheduler_active =3D=3D RCU_SCHEDULER_INACTIVE, + WARN_ONCE(rcu_scheduler_active =3D=3D RCU_SCHEDULER_INACTIVE, "synchronize_rcu_tasks called too soon"); =20 /* Wait for the grace period. */ --=20 2.35.1