From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F37F3C0B; Sat, 11 Nov 2023 01:44:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C1ADC433C7; Sat, 11 Nov 2023 01:44:16 +0000 (UTC) Date: Fri, 10 Nov 2023 20:44:22 -0500 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: Alexei Starovoitov , Florent Revest , linux-trace-kernel@vger.kernel.org, LKML , Martin KaFai Lau , bpf , Sven Schnelle , Alexei Starovoitov , Jiri Olsa , Arnaldo Carvalho de Melo , Daniel Borkmann , Alan Maguire , Mark Rutland , Peter Zijlstra , Thomas Gleixner , Guo Ren Subject: Re: [RFC PATCH v2 26/31] fprobe: Rewrite fprobe on function-graph tracer Message-ID: <20231110204422.05ac4581@gandalf.local.home> In-Reply-To: <20231110161739.f0ff9c50f20ebcfb57be6459@kernel.org> References: <169945345785.55307.5003201137843449313.stgit@devnote2> <169945376173.55307.5892275268096520409.stgit@devnote2> <20231110161739.f0ff9c50f20ebcfb57be6459@kernel.org> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 10 Nov 2023 16:17:39 +0900 Masami Hiramatsu (Google) wrote: > > + used = 0; > > + hlist_for_each_entry_from_rcu(node, hlist) { > > + if (node->addr != func) > > + break; > > + fp = READ_ONCE(node->fp); > > + if (!fp || fprobe_disabled(fp)) > > + continue; > > + > > + if (fprobe_shared_with_kprobes(fp)) > > + ret = __fprobe_kprobe_handler(func, ret_ip, > > + fp, fregs, fgraph_data + used); > > + else > > + ret = __fprobe_handler(func, ret_ip, fp, > > + fregs, fgraph_data + used); > > > Since the fgraph callback is under rcu-locked but not preempt-disabled, rcu-locked? The only rcu-locked is task rcu. > fprobe unittest fails. I need to add preempt_disable_notrace() and > preempt_enable_notrace() around this. Note that kprobe_busy_begin()/end() > also access to per-cpu variable, so it requires to disable preemption. Just around the __fprobe_*handler()? Or the loop? -- Steve