Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2328983rwd; Sun, 21 May 2023 18:45:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6cdojZGBqx3rURd46T4ZNaV4SEcXOIkcgai/6XN3hjnoYpJ45j6q7VO1DLnrJMG6sDWqBE X-Received: by 2002:a17:902:e887:b0:1ae:8892:7d27 with SMTP id w7-20020a170902e88700b001ae88927d27mr9952281plg.42.1684719955822; Sun, 21 May 2023 18:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684719955; cv=none; d=google.com; s=arc-20160816; b=IRS4c3/9p8IusTiwZeeYk+jgY0+Uq8SEcWdTF2+pA6F8IaO0GgM4EjwPjsspYWMVFr UY/WcJa5nAJQfmz3JGqbVv3I+ogB0Y7B5quM330CNJjFXiDf96EeBODH1umsS5pXggal YN4hwZd3rHTQs+XbkkF74zidR4gtaNsEbyRxUXBwGsVZPUSMz7m11N9EP7CfECyet390 Ns1zUrQ8zDnmAgt6nZ8ZtubHlnb9r6xSPTbljFobyxzBN9tTBnM4phmcPKg3i7jY+PW+ zUBNkF9I/F32mku5Fu3KA4oit4fGbo3XaBokHJGihY3p2Z2w5Q6RJv/i9eRrI6Sc4IMl P5Tw== 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=GFRBVG5gigCf+ET8ssCS7lzXtjjY2DUgJuoyQUVVwqM=; b=pNaZwSg8FykJRDUuoJuH6zGk87qltPoQZDl0CWGepVENwCB8OSPAFxkCSmgzQV9tAX 35h+UIUw9R75bHuaAOR/aiWymWaQ2MaEQmjReMzY5kLIIyG1+HghT9IYchJCLPjNykr6 u0qNgRG5GF4z3IFvemaWELtpIIqvRKUO13nhvFfgZkYnxCZfdSVspXcn4P5nUBSkKxMU SdnuJ7gprCghZ9Pknj9Wzn01oC36coqzVVof/kb2TqXWszj4Izt4ktDsWOJc2GEwJeh8 mdYIjWE8aYHlq58BekIMJxHB1gK1I0tewPpOgwqoK8+IG8c6UQJdJ0DuQpLBAoMtRdiP xczQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fODKzsVE; 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 ju2-20020a170903428200b001ac61add6c0si640116plb.401.2023.05.21.18.45.43; Sun, 21 May 2023 18:45:55 -0700 (PDT) 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=fODKzsVE; 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 S231351AbjEVBhG (ORCPT + 99 others); Sun, 21 May 2023 21:37:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229708AbjEVBhE (ORCPT ); Sun, 21 May 2023 21:37:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B70ACE4; Sun, 21 May 2023 18:37:02 -0700 (PDT) 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 416B1618FB; Mon, 22 May 2023 01:37:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AAF9C433D2; Mon, 22 May 2023 01:36:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684719421; bh=rQqm+d2EFHE384n3OSuP7ZiGPEVYIDUl4XCUxQmHiHw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fODKzsVEdpuUNT4XkenMR4SXPk3B7CrscOcXbn7e90X7TRp+hpkWjfCI69nsRnPMe QddI+4EluM2i7qZrEtYkhWZ5Zl9ZY1hs+ibe/vgajauD7cI4rLUZROLpXK0Fk5itXg zd6YYGwZ9RJHnsBdUQZIFoGVAagT4KON1juorPMzHZmOHSPMavAJdmsxrl0l3TtPPo CCJ+oUJc3cJLKhHADaVm2H45tX7X41evI5TTeNIM8aXsi9lVzRq3YjpwPZwTx6Ygpm Q1dgynMmMhEKyVvnmZJAMS/W/AuHfWFPGljHQqg/YRBzAzZcX41dN9wHlV3IhooRAi BOuzepKu4OVHg== Date: Mon, 22 May 2023 10:36:52 +0900 From: Masami Hiramatsu (Google) To: Jiri Olsa Cc: Ze Gao , Yonghong Song , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Hao Luo , John Fastabend , KP Singh , Martin KaFai Lau , Masami Hiramatsu , Song Liu , Stanislav Fomichev , Steven Rostedt , Yonghong Song , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, kafai@fb.com, kpsingh@chromium.org, netdev@vger.kernel.org, paulmck@kernel.org, songliubraving@fb.com, Ze Gao Subject: Re: Message-Id: <20230522103652.4c1680bb945cba22ccba6a79@kernel.org> In-Reply-To: References: <20220515203653.4039075-1-jolsa@kernel.org> <20230520094722.5393-1-zegao@tencent.com> 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.2 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,T_SCC_BODY_TEXT_LINE 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 Sun, 21 May 2023 22:26:37 +0200 Jiri Olsa wrote: > On Sun, May 21, 2023 at 11:10:16PM +0800, Ze Gao wrote: > > > kprobe_multi/fprobe share the same set of attachments with fentry. > > > Currently, fentry does not filter with !rcu_is_watching, maybe > > > because this is an extreme corner case. Not sure whether it is > > > worthwhile or not. > > > > Agreed, it's rare, especially after Peter's patches which push narrow > > down rcu eqs regions > > in the idle path and reduce the chance of any traceable functions > > happening in between. > > > > However, from RCU's perspective, we ought to check if rcu_is_watching > > theoretically > > when there's a chance our code will run in the idle path and also we > > need rcu to be alive, > > And also we cannot simply make assumptions for any future changes in > > the idle path. > > You know, just like what was hit in the thread. > > > > > Maybe if you can give a concrete example (e.g., attachment point) > > > with current code base to show what the issue you encountered and > > > it will make it easier to judge whether adding !rcu_is_watching() > > > is necessary or not. > > > > I can reproduce likely warnings on v6.1.18 where arch_cpu_idle is > > traceable but not on the latest version > > so far. But as I state above, in theory we need it. So here is a > > gentle ping :) . > > hum, this change [1] added rcu_is_watching check to ftrace_test_recursion_trylock, > which we use in fprobe_handler and is coming to fprobe_exit_handler in [2] > > I might be missing something, but it seems like we don't need another > rcu_is_watching call on kprobe_multi level Good point! OK, then it seems we don't need it. The rethook continues to use the rcu_is_watching() because it is also used from kprobes, but the kprobe_multi doesn't need it. Thank you, > > jirka > > > [1] d099dbfd3306 cpuidle: tracing: Warn about !rcu_is_watching() > [2] https://lore.kernel.org/bpf/20230517034510.15639-4-zegao@tencent.com/ -- Masami Hiramatsu (Google)