Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1814088rwb; Thu, 15 Dec 2022 15:00:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf43jS6H3ThKWM8uxxhNnSovEOnTdXpS3dTs2v0etcoIbWJ4cNNZSr541g33UIaRAISGT80x X-Received: by 2002:a05:6402:3895:b0:467:7775:ba8 with SMTP id fd21-20020a056402389500b0046777750ba8mr26400596edb.1.1671145222437; Thu, 15 Dec 2022 15:00:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671145222; cv=none; d=google.com; s=arc-20160816; b=BYKwgPZkcElT8NhuBciC7OfQc6ihxvNwSISNqGidCu/I/eAyzhxoRJoFZZ6+Vy4FCu XhbVFqd0z1qi1CulwReFk1gAg14hh0ICXHdIFYicjHmfVVl+/8hysGrheSnUL68hB/G9 n+DlCZgKBDUUD79jYyP+q4UBVIDevdupDsBJdadq8H3ifgDDMlVTkHR/YU9///ZixgUO 45nebnSDIrca736VjYZwJT1UT6+TvGDuFc8m/joq42XDS9ipAwwzvmjiAl12qxeE+zzO sHbkBiMspuEnpzvvaAKkzvri0pe4+ko9fur+oC4C7OiiQVjU2aeP3MwCwvgEfOnpgupJ CUfA== 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=cJY2DN0beXkElZh3BlOxNIzjD8+2zAi9R7wnC7wRIG8=; b=W+Vm0Poa4h7HRcDbsKAl/C70GvXNTZwus/B4vTtczo1E/jve2HamR3wngnR+wWCVrW gBfO0GNT6T3ZINADSqnAiepy/6GZq1FX8czQw63A5ba+fqgm8efiy2KFw2cd5dsRdj3F Ga79SGMd7EaJYMj/EzXOEElsma1Pyx+Q1x2KG0iHke4WvQGD/sXpOdgi6NePaHk/4xFO b/8Gby5ZHjJch4WVyHvtLjy2jH9Ya/wMEuUzrJe68V2Yw7rAdFuRwAcHpSP6ZvJwgtd4 Lhr0fAOqkJusptRF3k3RtXF1w7rwDaTRbbw5CWTjkGCnxvMAYYFejMrv3KEFPL0mO53A 4zCg== 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 t22-20020aa7db16000000b0046eff87103esi484678eds.368.2022.12.15.15.00.05; Thu, 15 Dec 2022 15:00:22 -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 S229620AbiLOWjU (ORCPT + 68 others); Thu, 15 Dec 2022 17:39:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbiLOWjT (ORCPT ); Thu, 15 Dec 2022 17:39:19 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC2BF5E08B; Thu, 15 Dec 2022 14:39:18 -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 7A773B81B25; Thu, 15 Dec 2022 22:39:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 729FAC433D2; Thu, 15 Dec 2022 22:39:15 +0000 (UTC) Date: Thu, 15 Dec 2022 17:39:13 -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: <20221215173913.5432bfbf@gandalf.local.home> In-Reply-To: <20221215190158.GK4001@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> <20221215135102.556ee076@gandalf.local.home> <20221215190158.GK4001@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 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. -- Steve