Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1528360rwb; Thu, 15 Dec 2022 11:09:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf521p10w3iaN1282oIupSVdbj6PrUMV4oxdJZeEB4I4Opgy5D4kjtoSkaXcwh+zm5TggRIk X-Received: by 2002:a17:906:4a44:b0:7c1:49c:f9cd with SMTP id a4-20020a1709064a4400b007c1049cf9cdmr26391299ejv.54.1671131361487; Thu, 15 Dec 2022 11:09:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671131361; cv=none; d=google.com; s=arc-20160816; b=vkFQnP2TfN59YxrlEuRuAkrpvP9Nr4alaDoqnEJrB9vjyL5DDWjtleTDsT57sYhJrS 7Oq1FHMMW1El73ize/8DntWUwx4OU5Z6JoFRVp2oWE5mXna/AbsVLuFzvDBqFafAYw+H dyIdZsHsrY4KctzqBvggLB56Js/JkkFCzbouS8dkVZybC0Ukll6z4kbW/qOEaCRNs+bo BV+eJk9dEgKwB4SBOmF3bj9jD/eq7ggu2N5lJqQdrFCPUFgNRy0zEsZlfdNb3jsFTg/8 2bqaYy1MdHViOfViSFDKIRJLj04bgo1KvnFffXfFQhFmTP66un9bJszD0+3tPGRQog+4 yaMA== 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:subject:cc:to:from:date; bh=Tv9DpKInPwraJlBsEH4gvohEvjdVB5sImpHhiMDmseo=; b=aKRYsp/TLbQdr2/KsIES8udnv13aDVMpJHs33OQTtrXr0dtXC8ChlK4EfPPHpZQTHP 77scGFnAzfxF7sBUjHdjSI8Xm08NwA9gIxcHNt6Q/Yh9/wlLRAAPeqo66kJEqaran4ni +mYvB+UYBOkpCpAcOZIm4h51aodqCvf2elD0tCDytgbCZmju8E0Gf+ubjFz6WXQ0ULdX kiBdhughuj7E15kkFKsAIkHWEUdOV8flMYsesX042gekDb+Cu6R3ej+Pr5rNTRG39CQG iMzfk0H3BBeFgp9UNbsahsUfJmnwQ9VD8u5Qjy/dpmeGU9wEEcBsPzwTFYcV7HpkBn5/ nAog== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js3-20020a17090797c300b007c164dc0fabsi7876061ejc.904.2022.12.15.11.09.01; Thu, 15 Dec 2022 11:09:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230320AbiLOSvL (ORCPT + 68 others); Thu, 15 Dec 2022 13:51:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230135AbiLOSvJ (ORCPT ); Thu, 15 Dec 2022 13:51:09 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B094621A5; Thu, 15 Dec 2022 10:51:05 -0800 (PST) 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 50CD361ED6; Thu, 15 Dec 2022 18:51:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13790C433D2; Thu, 15 Dec 2022 18:51:03 +0000 (UTC) Date: Thu, 15 Dec 2022 13:51:02 -0500 From: Steven Rostedt To: "Paul E. McKenney" Cc: Masami Hiramatsu , LKML , Linux Trace Kernel , Andrew Morton , Mathieu Desnoyers Subject: Re: [PATCH] tracing: Do not synchronize freeing of trigger filter on boot up Message-ID: <20221215135102.556ee076@gandalf.local.home> In-Reply-To: <20221215170256.GG4001@paulmck-ThinkPad-P17-Gen-1> References: <20221213172429.7774f4ba@gandalf.local.home> <20221214084954.e759647a2f5f1a38bc78b371@kernel.org> <20221214200333.GA3208104@paulmck-ThinkPad-P17-Gen-1> <20221215100241.73a30da8@gandalf.local.home> <20221215170256.GG4001@paulmck-ThinkPad-P17-Gen-1> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 On Thu, 15 Dec 2022 09:02:56 -0800 "Paul E. McKenney" wrote: > On Thu, Dec 15, 2022 at 10:02:41AM -0500, Steven Rostedt wrote: > > On Wed, 14 Dec 2022 12:03:33 -0800 > > "Paul E. McKenney" wrote: > > > > > > > Avoid calling the synchronization function when system_state is > > > > > SYSTEM_BOOTING. > > > > > > > > Shouldn't this be done inside tracepoint_synchronize_unregister()? > > > > Then, it will prevent similar warnings if we expand boot time feature. > > > > > > How about the following wide-spectrum fix within RCU_LOCKDEP_WARN()? > > > Just in case there are ever additional issues of this sort? > > > > Adding more tracing command line parameters is triggering this more. I now > > hit: > > Fair point, and apologies for the hassle. > > Any chance of getting an official "it is now late enough in boot to > safely invoke lockdep" API? ;-) lockdep API isn't the problem, it's that we are still in the earlyboot stage where interrupts are disabled, and you can't enable them. Lockdep works just fine there, and is reporting interrupts being disabled correctly. The backtrace reported *does* have interrupts disabled. The thing is, because we are still running on a single CPU with interrupts disabled, there is no need for synchronization. Even grabbing a mutex is safe because there's guaranteed to be no contention (unless it's not released). This is why a lot of warnings are suppressed if system_state is SYSTEM_BOOTING. > > In the meantime, does the (untested and quite crude) patch at the end > of this message help? I'll go and test it, but I'm guessing it will work fine. You could also test against system_state != SYSTEM_BOOTING, as that gets cleared just before kernel_init() can continue (it waits for the complete() that is called after system_state is set to SYSTEM_SCHEDULING). Which happens shortly after rcu_scheduler_starting(). I wonder if you could even replace RCU_SCHEDULER_RUNNING with system_state != SYSTEM_BOOTING, and remove the rcu_scheduler_starting() call. -- Steve