From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0186FC197A0 for ; Mon, 20 Nov 2023 21:49:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232496AbjKTVt2 (ORCPT ); Mon, 20 Nov 2023 16:49:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232459AbjKTVtM (ORCPT ); Mon, 20 Nov 2023 16:49:12 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B12610FC; Mon, 20 Nov 2023 13:48:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=hzOe2enBknKNcyvCj309YPBAk627Y0xGtmve14rms6k=; b=NQE4sGwXqrKvpQE0PUfdGJYOxk QoVIQqphWu14PC11GFCxMatjak1imrI/sBvCezt47WIfkxno/elH7UJOtPovP3vyzVghB/uNNgl+s Dmnz6OrEVNu/mQBBgDrA4o6D7u4ZrECl9RmDtl+Q/ix+8wBRUaj6sT1+uBu/YhKAuEVae+yZkp766 nCNCLLvIXFWbJPnGMATM1nAdTgEhPFJ7rjbDx+NYnIpbuLSpxwAK0J6KnbO4mZxcFd3R3J9fI4yKK v4LqNKuvxWwJjlGFE14+dQSr8eqYA6Eqd+u6FDvhVLQUNVAaZJB2RCocu/VMV0an7mvx+katTgblo PicpdKOA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1r5C7L-00B8c0-15; Mon, 20 Nov 2023 21:47:45 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 0404D3002A6; Mon, 20 Nov 2023 22:47:43 +0100 (CET) Date: Mon, 20 Nov 2023 22:47:42 +0100 From: Peter Zijlstra To: Mathieu Desnoyers Cc: Steven Rostedt , Masami Hiramatsu , linux-kernel@vger.kernel.org, Michael Jeanson , Alexei Starovoitov , Yonghong Song , "Paul E . McKenney" , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , bpf@vger.kernel.org, Joel Fernandes Subject: Re: [PATCH v4 1/5] tracing: Introduce faultable tracepoints Message-ID: <20231120214742.GC8262@noisy.programming.kicks-ass.net> References: <20231120205418.334172-1-mathieu.desnoyers@efficios.com> <20231120205418.334172-2-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231120205418.334172-2-mathieu.desnoyers@efficios.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 20, 2023 at 03:54:14PM -0500, Mathieu Desnoyers wrote: > When invoked from system call enter/exit instrumentation, accessing > user-space data is a common use-case for tracers. However, tracepoints > currently disable preemption around iteration on the registered > tracepoint probes and invocation of the probe callbacks, which prevents > tracers from handling page faults. > > Extend the tracepoint and trace event APIs to allow defining a faultable > tracepoint which invokes its callback with preemption enabled. > > Also extend the tracepoint API to allow tracers to request specific > probes to be connected to those faultable tracepoints. When the > TRACEPOINT_MAY_FAULT flag is provided on registration, the probe > callback will be called with preemption enabled, and is allowed to take > page faults. Faultable probes can only be registered on faultable > tracepoints and non-faultable probes on non-faultable tracepoints. > > The tasks trace rcu mechanism is used to synchronize read-side > marshalling of the registered probes with respect to faultable probes > unregistration and teardown. What is trace-trace rcu and why is it needed here? What's wrong with SRCU ?