From mboxrd@z Thu Jan 1 00:00:00 1970 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 06DCBC4332F for ; Thu, 15 Dec 2022 23:10:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbiLOXKu (ORCPT ); Thu, 15 Dec 2022 18:10:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbiLOXKb (ORCPT ); Thu, 15 Dec 2022 18:10:31 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A32C52497A; Thu, 15 Dec 2022 15:10:30 -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 ams.source.kernel.org (Postfix) with ESMTPS id 4B772B81CD8; Thu, 15 Dec 2022 23:10:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E139CC433F0; Thu, 15 Dec 2022 23:10:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671145827; bh=9ET6dNSpK/yx9s+5+oLBMdonkIl0n5X4rrrQmmt7Xn0=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=ITQjdzH/0Nnmg79x4+7uU48x4NCzVodMPKsOclWFAwg/Tuvb/FNeiBGBG349RCecj SICT2hINGuJMKQj3tEDmlmLL4gT31y/QsP8tI75BHZqQMue1yd/VMVzUcFs01FM3X0 l4GWSaUIu6G6MPOr1GMxfvHX5trWNRlhM9EjXiQGDdSUhIqs+dMEsUg0hAHrpq8ran hp1qEFJohLnc5RQSqIUzyKRImyv7DjM1XNtItCtkrxYZKno2jPS/UOBbM0YmOzxVeb cro6OkJprMFXUp5OuHq5uhg5N+RGnxxmqKa+BmCYt2xQ6okfUse0ieNorrStqajBlY DfkfKyiBVxeLg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 82CFB5C1C5B; Thu, 15 Dec 2022 15:10:27 -0800 (PST) Date: Thu, 15 Dec 2022 15:10:27 -0800 From: "Paul E. McKenney" To: Steven Rostedt 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: <20221215231027.GS4001@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org 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> <20221215135102.556ee076@gandalf.local.home> <20221215190158.GK4001@paulmck-ThinkPad-P17-Gen-1> <20221215173913.5432bfbf@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221215173913.5432bfbf@gandalf.local.home> Precedence: bulk List-ID: X-Mailing-List: linux-trace-kernel@vger.kernel.org On Thu, Dec 15, 2022 at 05:39:13PM -0500, Steven Rostedt wrote: > On Thu, 15 Dec 2022 11:01:58 -0800 > "Paul E. McKenney" wrote: > > > What case? > > > > Here is one: > > > > o The newly spawned init process does something that uses RCU, > > but is preempted while holding rcu_read_lock(). > > > > o The boot thread, which did the preempting, waits for a grace > > period. If we use rcu_scheduler_active, all is well because > > synchronize_rcu() will do a real run-time grace period, thus > > waiting for that reader. > > > > But system_state has not yet been updated, so if synchronize_rcu() > > were instead to pay attention to that one, there might be a > > tragically too-short RCU grace period. > > The thing is, preemption is disabled the entire time here. > > That is, from: > > void kthread_show_list(void); > noinline void __ref rest_init(void) > { > struct task_struct *tsk; > int pid; > > rcu_scheduler_starting(); > > through: > > system_state = SYSTEM_SCHEDULING; > > complete(&kthreadd_done); > > > Preemption is disabled and other CPUs have not even been started yet. > > Although the might_sleep() call might schedule the kernel_init() task but > that will only block on the completion. > > In other words, I don't think anything can cause any issues this early in > the boot up. The nice thing about the current placement of rcu_scheduler_starting() is that there is not yet any other task to switch to. ;-) Thanx, Paul