Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp5977rdf; Mon, 20 Nov 2023 14:18:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmzRIlfp7LDipW/18FDgLJnF3MtQw94BbUVeFZ/oXIUfbubVNwmPLb6P7A0Alu7zpmcw91 X-Received: by 2002:a05:6830:168d:b0:6c4:8441:f90 with SMTP id k13-20020a056830168d00b006c484410f90mr9896955otr.24.1700518728844; Mon, 20 Nov 2023 14:18:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700518728; cv=none; d=google.com; s=arc-20160816; b=ZOJ7ZjFJF9cKrgXeW0OBb2pXQm4F4dsfASPpC8ZG8qLYIZyf7sF/Z4+Z2FBe/UEglX 9laUJLzZh3AuYkp4axYZoYigsCU8WNxYXDpkynh05Hvb4UeHSpb91cWwjHn/kdPUglKh RymjUw+ebUTvKwnV2Bvfn8yq1hcY806gBhKagsZMf+cnNe1pUx67f/civxlNbeiAxAgs 3MF1joMSLJKD8z90xycXgYtLk3u3fBcEkK+lHHbBmTpbZ/E8A7xPu2B/bHZOg7gAzDhF 0XUoH3cftUqUTjsHN6MBVThHOcivg/GzWFges5MY/zipuTEqi0IybMC17ZGHRlL/TSRZ UlJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=DUX/3W5p6iqfl0NFQEyb5aQBAfZtCgzNjvYSApfGHrA=; fh=7WdIjnk0GNuVJ8AMOdUE55QExF/wyJClntY/rjhqc0A=; b=QVmweABRst5f+ALsViZfIm5JPYWpvXk8PK8PuXVyJGRwohkyCVcrwTOq1LS2dMHD0a Naa90YyeVQplQHZI0HO1xOT/jwri4GmFs7crKjePCfkmEMTQ61sOQ72ZcoH7af5ga8oe OPxOzcrMfgzS9AeFhpTHgyMs1jDPJQrbEObbvYOT2OzCk7u4UkjYvwTFjtTJeNppiaWP eKy/S8JZBiP9asX/+SRXQ02ctZVYhrskotoe6nVonek8XamC44A0G3+5hq6zDHS9OwvN mJEWxafsKX44cKp1i2xYtTerxFmjoiGYWd6msndzWMF987Z+37sToBO8hHUdgSY5ZaZg P6ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FXHw+2jf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id bz42-20020a056a02062a00b005bda1051dacsi10091588pgb.471.2023.11.20.14.18.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 14:18:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FXHw+2jf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 774EA8039F5B; Mon, 20 Nov 2023 14:18:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229539AbjKTWSi (ORCPT + 99 others); Mon, 20 Nov 2023 17:18:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbjKTWSd (ORCPT ); Mon, 20 Nov 2023 17:18:33 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F61191 for ; Mon, 20 Nov 2023 14:18:30 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 001D1C433C8; Mon, 20 Nov 2023 22:18:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700518710; bh=v2fsGHVEGuyqEdKhN4nMdFZDEWOtc3k1ozVbwEQWDag=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=FXHw+2jf2R1fAf8voab217Rs0FGaYJj5HJ7K8DPo3f8+VyEt2cCONWErgAW9tQRka 01ccqAvjrCvjJtvPgYCAOsjoV8Fp/JJBAzA7nVE6XnG7ZVKwLc1+vQmg5Z+Mi9GQ1a hmBrzVzp/gHL1cuOHUg/MtInbqHDXBdaI8dqzREErwqSs/62KiefWliLTbTsDOH8nC SS7/F/188D7bnjj/IXhPzQXORuIUBD1SH/VUYlhhFQzmjBGA6oXPWdMx9GD+j2Aqmv Sv555YamQ7o9wef+VMT3WyuuOQJ/KZjpGsRirw2dh+5JN/NeHq75BKnJPTvwcVGQ5T 2hSmucLiMNBig== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 71A8BCE1ABD; Mon, 20 Nov 2023 14:18:29 -0800 (PST) Date: Mon, 20 Nov 2023 14:18:29 -0800 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Mathieu Desnoyers , Steven Rostedt , Masami Hiramatsu , linux-kernel@vger.kernel.org, Michael Jeanson , Alexei Starovoitov , Yonghong Song , 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: <62c6e37c-88cc-43f7-ac3f-1c14059277cc@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20231120205418.334172-1-mathieu.desnoyers@efficios.com> <20231120205418.334172-2-mathieu.desnoyers@efficios.com> <20231120214742.GC8262@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231120214742.GC8262@noisy.programming.kicks-ass.net> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 14:18:45 -0800 (PST) On Mon, Nov 20, 2023 at 10:47:42PM +0100, Peter Zijlstra wrote: > 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 ? Tasks Trace RCU avoids SRCU's full barriers and the array accesses in the read-side primitives. This can be important when tracing low-overhead components of fast paths. Thanx, Paul