From patchwork Mon Oct 24 11:32:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9421 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp478834wru; Mon, 24 Oct 2022 07:18:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7iLNQuBOPl6mvW3iQKmqV8EU8pVLzbvsK54f/cs1LgJZqnx59ujAHqQ60ksA3AghUi9C0J X-Received: by 2002:a05:6402:354d:b0:45c:b772:5ef4 with SMTP id f13-20020a056402354d00b0045cb7725ef4mr31859839edd.225.1666621084250; Mon, 24 Oct 2022 07:18:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666621084; cv=none; d=google.com; s=arc-20160816; b=EaeFmDINwgxnE44cWMa17Bn5LXMLElnVGyZm5/kCaD9IFgUMfDLvh7wsZlhhMufuqt zt+2c73Lk4l7sDYdgnuoxIdp5BkQ7VaXJOqz+R62M6SD68FwE0gfZuUXjDhnwOCSIIBE qaGPCo8CtlLQpEPrC0FoPJ3GT3IwmidzYRFb4MqKlv/tLm+1kuzNaBgNVvUiBpDZ9BwA pl3QY+8x75ozcCv6Z3Yhp67BIOE/j3wgj/6ZdjJsVZ6vWVp3ZhuW8ux4Ug1fYyewUBkX rlcYNd4mSWWomn+M6RF3IFEagpsd0zCMJSz4W7qGCx7UE+cNaW7YcobzolvXH33w799C zdJQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/KLVPlqzKJeqmeUr8+4fAQBzkSIOU+lGHeIxB0RL2G0=; b=GcnTeYerY1BIcEDaHb6rBfQ7eGkfk5zT2KakeVmc1VxEKORxFWY+v1oceJWe9MTp2w cqRKiPOBvoqMcUabk9wThACACUkj1WdXwDesy2Mp+TtBV3+yPpvMHFWtaCaqEzlxrmyD rRw0lq5i6RwWxoZ1Xr54uFcdhXQf/1ZKdi+9Vucgzm4QHlezQkz/460cKcPgFk5jolRS uQsv2tEaJiqU696lt5Yl2r0Xv9QQ6LXO6f1IiuEcf4KH3VugyqCSbIBww6ZY7YiRk4G+ t2FQ3yhVt1A6Avb0MX1vbgcTiATfrvtdp59ni4OfrKGK9f+xvaYsK7bpY+wbc3dLwVGB WQuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YxLvpC4Y; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w16-20020a056402269000b004618ed2dfe2si6930467edd.6.2022.10.24.07.17.36; Mon, 24 Oct 2022 07:18:04 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=YxLvpC4Y; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233087AbiJXOLe (ORCPT + 99 others); Mon, 24 Oct 2022 10:11:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233081AbiJXOIS (ORCPT ); Mon, 24 Oct 2022 10:08:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0181FAEA2E; Mon, 24 Oct 2022 05:50:41 -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 8A7786130D; Mon, 24 Oct 2022 12:50:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F0F0C433D6; Mon, 24 Oct 2022 12:50:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615838; bh=NnNOle+6GdU/dCal8eZzhfxhUebGvSc2Ta5UO/0MGsw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YxLvpC4Y8815m1KbeABB2xJEfxRaYJ6T6dk8Rq2/Q/8jynkF7z4BD04MJoDuZ0EiF gnogpaYtCySSgGh1cKSOrcsSrHDJFKFQ9jBnBKA5zdNbI4Dchs+yBRJtS78V3YlEv4 7rsCEsyBxSqu0cN/++EOtd+6v+gJuoqjboRf1Udo= 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.15 403/530] rcu-tasks: Convert RCU_LOCKDEP_WARN() to WARN_ONCE() Date: Mon, 24 Oct 2022 13:32:27 +0200 Message-Id: <20221024113103.308415317@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747578870327411963?= X-GMAIL-MSGID: =?utf-8?q?1747578870327411963?= From: Zqiang [ Upstream commit fcd53c8a4dfa38bafb89efdd0b0f718f3a03f884 ] 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 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 60c9eacac25b..ae8396032b5d 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 == RCU_SCHEDULER_INACTIVE, + WARN_ONCE(rcu_scheduler_active == RCU_SCHEDULER_INACTIVE, "synchronize_rcu_tasks called too soon"); /* Wait for the grace period. */