Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp49346rdf; Mon, 20 Nov 2023 15:57:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3k4xzyG9hhEM0mqV6GtZ6A37J5rkjAR/gsIRZSoLoyzXbuOStWYymkarva5Ih/iRKpJ3S X-Received: by 2002:a17:90b:1e51:b0:280:a8e2:f2f4 with SMTP id pi17-20020a17090b1e5100b00280a8e2f2f4mr7017733pjb.3.1700524634240; Mon, 20 Nov 2023 15:57:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700524634; cv=none; d=google.com; s=arc-20160816; b=OtE+lKhZOT26PDc/FLMOBTeNf8oyZUJc+O3pRhvFG8HYA3w2M6oHyh6I/RnI4fs01Z ob4EZUrq5Am9aD8R/WwSmODbp5fulmtj7hXQlgI7JSxhGahh7KnRhVS/HDdnOEBwn/16 5n953dQCRaBC38Wdn4sUVNPj1TK+yXfDLhJiMfo+j0wV3PeeUDCKs9WHhYJGTHJJvMDR VJadjdfzAlQqIMTg5bJAIyhxQ1oBJDJR4lUqsuRc4mtviIySc5muMHjROU3+/GHNNrNF FZJZJAAiFaTfUz3SiyeAlxzg8mB1dCcAKj25zdkykyTVAX639bzjIJXOXck77ij+w9GB OSFg== 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=/1nfI0cl1czwZ6x8qL8ezHvYU3UjSSWQa2ji8eXMEhc=; fh=7WdIjnk0GNuVJ8AMOdUE55QExF/wyJClntY/rjhqc0A=; b=UB29acz6ZQGIYumfLdkxMjLsSkssIHgmH2xqMddzksPwFfnTN2f4AMSE/ln/2wexH3 q8Jre1M5AEBPDv46A1Q7ozuOFMSFq6UgLRDRDTWJngUx/11yJiRoGQpyBfPSMew+12Hb VnFw1bPxNugsQ5WEmCFDDn0ad342ogvGtgjsPSSmLf5IXWiliLUCnAhUmXu0LPUhvUrI swWB9ihCN9bFpDUEaaD+kKiCzaZGZfqlqnQSzzu0PlGx+FQHUm9IuBqGwvyjdg7Ziz+j lo8yptlxkzG0+G4oNoZRnrLxYF2Znhm+tuYZeu64wctTIiCcjLBEDThZypwV8JgTaDNT j+qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="b05qD/KI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id a6-20020a17090a854600b002840019a45fsi6675269pjw.148.2023.11.20.15.57.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 15:57:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="b05qD/KI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 320EA80A136D; Mon, 20 Nov 2023 15:56:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232739AbjKTX4o (ORCPT + 99 others); Mon, 20 Nov 2023 18:56:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232620AbjKTX4h (ORCPT ); Mon, 20 Nov 2023 18:56:37 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F2CE194 for ; Mon, 20 Nov 2023 15:56:31 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3570C433C7; Mon, 20 Nov 2023 23:56:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700524590; bh=6w3DroFnugMsjrjsFbvX2IGh8mvPO+6IvxBni4SrCfo=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=b05qD/KI36gPoqG58vbyGpBFNmjVPupy928lnOJWOAxNE3BrZVBYa8cztb6f4jYnU ZimtCrB06Kze69PZcC29FDr3Qu4v8AGjBOgoPsovsN20jMthiKTScxPg8pU+FNjkCI 1VYk4KY1CLvafpmlzeRIl9ghTBbETMKYQ5lmtqRHnUXRO1foo5Fic+me3t+MIczB2H pQWR6TZosjQjvP8/OAkEhCnCs2ReeQ2SA8EKoHla5UgSYYjoP+O6Cfq6kZO5gNMN3V mbI+RN3axfycrk53hPtu/ULKmpyuwNBCJLP6c2h+0VEsErXRGKBNViEWeAb5eqatSG DJPCenK7gFW+w== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 562EBCE1ABD; Mon, 20 Nov 2023 15:56:30 -0800 (PST) Date: Mon, 20 Nov 2023 15:56:30 -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: 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> <62c6e37c-88cc-43f7-ac3f-1c14059277cc@paulmck-laptop> <20231120222311.GE8262@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231120222311.GE8262@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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 20 Nov 2023 15:56:57 -0800 (PST) On Mon, Nov 20, 2023 at 11:23:11PM +0100, Peter Zijlstra wrote: > On Mon, Nov 20, 2023 at 02:18:29PM -0800, Paul E. McKenney wrote: > > 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. > > So why wasn't SRCU improved? That is, the above doesn't much explain. > > What is the trade-off made to justify adding yet another RCU flavour? We didn't think you would be all that happy about having each and every context switch iterating through many tens or even hundreds of srcu_struct structures. For that matter, we didn't think that anyone else would be all that happy either. Us included. Thanx, Paul