Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1887203rwb; Thu, 15 Dec 2022 16:08:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf4rRdDxKVyc8FVQMmS2ZecPSNkb7EY6opOQJSYu04/RZIBa2p7Tv75UZ8SIMxgw1w4Dr+6w X-Received: by 2002:a05:6a20:c6cb:b0:a4:b615:2239 with SMTP id gw11-20020a056a20c6cb00b000a4b6152239mr31151331pzb.24.1671149314970; Thu, 15 Dec 2022 16:08:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671149314; cv=none; d=google.com; s=arc-20160816; b=ec7jlapb7VlJ3JPocCjiemidUGlWmCt+C+ojDtgaBeY8LMxHMNd2Pd6g4KqsujF/IH Ji9snG1/zA9M6jvAUJ1WOwmWBy2ZQIsvE7VkF8qvYyYgQFTZGZ756y1+8NbqWGqghPsR T7xhsb6LRzXgzHwJi/U1jOXoz+AM2ybikjk5zGF1Iul502d1D8kdPg6jWyU9YQoRZN4R vXaZF8HDpQhSdsqce66WAM2ivK/ooyb4V6JhAiNjHMquII2UBG8skJnDTWFM/aQgL+bC b4mpcBUgVchA3X6bdQTVliybbXCCFZR26p7lQxLCfXl9GMeDSPRvxLo6AtPUIaFIuG4H AA+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=faZiwV4qZnqqtJCbbB4ChzB5ZTBGGKMH3HCX2aTsptE=; b=Q2WQiLjlU8T/303vm9DItAfr1bHHqZLbbqhqeGq0FEvMAqgx6OVFfxQZWSlwy0hLIM mOkEViKzXwhYVfSCAxxHQrwOvXdNwhd2PjXOmhtF6ocZ45HkmiVsi/Qk//efl3J0DtmT FRrQV2AoOe0H+yYhrTLHrCFyMOfMOTVceLrBMlLdKlWm5gPgK+LPsl72CpodB/A4y3xX Pz9Hyi6tmxESbOv6IKtBZ6Q7pMz8yP50YQP4Ku/svfLKTq43pzvXXn2PPCrOSSc4Vmai ww1dfIpm+yxOe4Xz6/0P8tlu+sD3kwn0OVfNadE5E9oSfVh0kpMOJlZTXcoqmzPR0GcY 6g4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ITQjdzH/"; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y8-20020a63e248000000b00478a1814885si889170pgj.319.2022.12.15.16.08.26; Thu, 15 Dec 2022 16:08:34 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ITQjdzH/"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229897AbiLOXKx (ORCPT + 68 others); Thu, 15 Dec 2022 18:10:53 -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> X-Spam-Status: No, score=-7.1 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 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