Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp203008rwb; Tue, 13 Dec 2022 16:16:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf66tv/YJM9Bif+D+rATNnrUEy5cPOjH9bX578W0kgiRfQi2gYOWTNDqXiCD+HUjAW5LYZPp X-Received: by 2002:a05:6a00:1a8c:b0:566:900d:5ae4 with SMTP id e12-20020a056a001a8c00b00566900d5ae4mr26945144pfv.20.1670976988320; Tue, 13 Dec 2022 16:16:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670976988; cv=none; d=google.com; s=arc-20160816; b=MkYVM99ZhuqCDYqlItCztwJaaS4mYM8nIp1erOfMVqpiybedF2jwUWCTGR7S2dzhNW sAVWUJ4Vh2G9fKLBSRfHsI3qSpenkQw0LRZ7WkUVH/OvB2w5aM036Kdb7yXBAvsCwFo3 1xLGQ605DbJ0g+4MXHbfCRka2J8tdhr9270Dl1N9lU3HUXFu7EmZtdlzEo66p2ZMju0k oOm2h/AArQiHbFtpfYBQ3CFH0UykAnuLQYzAl2Qu64SsA4Sor/r1I5INCvXkzvR5vn/a BN0R1MbWk2MbX3sdszGyT3jt7NjLLT9ehYOmIS7gpqJfbfaWryKz+bQJ392rorG38QM9 6Fug== 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 :dkim-signature; bh=rw6gFuZ6KRzDVHY4K14qM9ImhWYRfQxibX+oeKQZQjY=; b=ty91XgQdumv5O7wPt9YUKx+TtPxro/gSvvf04H1JZ39VrKMEbg+1C2YBBtwuNuoAXQ QQGBd6aiXZaMLuWVePcs1KO7DL6qsVGAmjJoe3+ObggyEpJG2X0a4BKgBJ1bcIL1MBAf LhJotl2fmY11aU/oJC3T5E9d7E7i/4eKyb/Lq8tTYJzEXQjVENirCsvXJ+BjvW5P4Mpk 8P67XDukjXiqyeqckixCb4IdsspMIHVdlbx01jw6dzUV/KnQv/BWz48rYLKJVRKXQGbT qTEiSFPwRdadTJpE6AyEAzsjC0034/MrK/zsrcvRN7VpKi5yixv0S4JQ2z7wg32oXbgN ke2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V7vBYbny; 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 v11-20020aa799cb000000b0056d480f7b92si13334760pfi.378.2022.12.13.16.15.21; Tue, 13 Dec 2022 16:16:28 -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=V7vBYbny; 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 S237164AbiLMXuD (ORCPT + 72 others); Tue, 13 Dec 2022 18:50:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236739AbiLMXuA (ORCPT ); Tue, 13 Dec 2022 18:50:00 -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 344622636; Tue, 13 Dec 2022 15:50:00 -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 E9C2EB811FF; Tue, 13 Dec 2022 23:49:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E28EC433EF; Tue, 13 Dec 2022 23:49:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670975397; bh=kLBo0KHQrLyd29Ix59u6434teLEhcjNUfyC6w2bJk6k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=V7vBYbnyp3mjW7ZXEp4kiDEA8RbfSYiWRbTccFe+szrUGhEvtVsr14yAD2SgIUmkg fEpy8t8rCcMZ7HVXaB9rh0OMtrN2/pTDMnUVJooYrEWIQGyf04ivBcR0neGjAnWiQB tpR/v4ettfsmRN/EWBnwWlO+XwhlQBReluZV43m9CXcmkkrBC7ksvBCWMaMgOMAeow AbsBlleMLG7t6jWlTAO+gfcB6oIH4QaMpwpbr0PpLqZ6FqK3p4AgPpZAFuPk0UURkF 4zivL+YRd1VGnH/9vM2062zg94jXDDSo0Bz7qALMksmDmEZibZSbehIBT9FI/MT1MO sqwRytR8Xgl6w== Date: Wed, 14 Dec 2022 08:49:54 +0900 From: Masami Hiramatsu (Google) To: Steven Rostedt Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Andrew Morton Subject: Re: [PATCH] tracing: Do not synchronize freeing of trigger filter on boot up Message-Id: <20221214084954.e759647a2f5f1a38bc78b371@kernel.org> In-Reply-To: <20221213172429.7774f4ba@gandalf.local.home> References: <20221213172429.7774f4ba@gandalf.local.home> X-Mailer: Sylpheed 3.8.0beta1 (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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, 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 Tue, 13 Dec 2022 17:24:29 -0500 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > If a trigger filter on the kernel command line fails to apply (due to > syntax error), it will be freed. The freeing will call > tracepoint_synchronize_unregister(), but this is not needed during early > boot up, and will even trigger a lockdep splat. > > 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. Thank you, > > Signed-off-by: Steven Rostedt (Google) > --- > kernel/trace/trace_events_trigger.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c > index 19ce9d22bfd7..e535959939d3 100644 > --- a/kernel/trace/trace_events_trigger.c > +++ b/kernel/trace/trace_events_trigger.c > @@ -1085,8 +1085,14 @@ int set_trigger_filter(char *filter_str, > rcu_assign_pointer(data->filter, filter); > > if (tmp) { > - /* Make sure the call is done with the filter */ > - tracepoint_synchronize_unregister(); > + /* > + * Make sure the call is done with the filter. > + * It is possible that a filter could fail at boot up, > + * and then this path will be called. Avoid the synchronization > + * in that case. > + */ > + if (system_state != SYSTEM_BOOTING) > + tracepoint_synchronize_unregister(); > free_event_filter(tmp); > } > > -- > 2.35.1 > -- Masami Hiramatsu (Google)