Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp8525rdf; Mon, 20 Nov 2023 14:24:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNogYuwr18FP41nn6WAs8wjdMurnwQBqMG3GQh1jIdJ6SORZNAnYwMZxKSI5/UqJovqYwA X-Received: by 2002:a05:6a00:3a13:b0:6b6:7a04:6f9 with SMTP id fj19-20020a056a003a1300b006b67a0406f9mr7498282pfb.28.1700519052666; Mon, 20 Nov 2023 14:24:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700519052; cv=none; d=google.com; s=arc-20160816; b=FM/thyq97Ka+pn/38J2WnA+2uP24RGuabdnc60/x8C6UfcqUV5fXsHhpedJLVqLNjd Dn16Gbfu1nhH7VdClM2jt8ZcFjaJO5w+X5XZVh33PfPscc2kXlhjzYT/SjurCxENpVGB C8IptReEb2tiEoz4T7GnNHZTTuAscPL2sO+TEGh12fOhCZdKt8BqsYqgDWhat8WncapC BVtqnJtEJ1gZ0IqAmjkFcftFgOZRa/nhRDlbaRWDt569vB54X2X+k4Us/J2iQgVxzNAD Pw0D7bkiX6x+9tI8xLVDV2RXf3pH+aANgXLnnkSEPXidz2YD9FgVEBspxdP6Qr7bWys5 2gNA== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=Y/JajRYmQ+h2cb3Gyfto2dmvsOFVpvsOEjip8jRBOVk=; fh=tkL3jDD5YtxKGjIuGdSmFwwrnohHV8gPoUcW+brgpK8=; b=UYuzg3+UctQWgRG4H/pJhepj1PKgko2oT9YbkxtWorDUlc/XowTATiBwx0USJy2QSk 0ijFXQwMM3OwKIx/giUKH72NZbO16uKEOhvFUmB8rGL7hz6PhGOKB8UckyTYMzfXwKVC SAbLQApBwH0gruF/PFb6vXwP8juBFb5Y5tmjvgprt6RWx8ntrnlntCzMAfu6zMVK1/3v hD7fdUFLznT/EH1V05ElkmZBVJ+2QmzISM7W6bNUBeDZTeV5PiVFE4Bzozy/3o8GbGAl cqYqPujDpE8AyFJHA1mm60frBOAqmtEO+qk/u9afAop/VK3Vs2nphXfDifIbga5AGClu 5bVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=JiNJJw1e; 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 Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id o14-20020a056a0015ce00b006cb4d47cfa9si6534414pfu.270.2023.11.20.14.24.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 14:24:12 -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=@infradead.org header.s=desiato.20200630 header.b=JiNJJw1e; 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 Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 49735808292E; Mon, 20 Nov 2023 14:24:08 -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 S229732AbjKTWXu (ORCPT + 99 others); Mon, 20 Nov 2023 17:23:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbjKTWXt (ORCPT ); Mon, 20 Nov 2023 17:23:49 -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 E53FBA2; Mon, 20 Nov 2023 14:23:45 -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=Y/JajRYmQ+h2cb3Gyfto2dmvsOFVpvsOEjip8jRBOVk=; b=JiNJJw1egbrWkoPgw2BOaR185l fjrLRFf6vjCinRkBKhhMg9n8qQhyGDzdQOHCObo9cc3x4oUsCmdlfSVoy5vbo/jsI55CAdGRxqMO4 ZI/uBo4zx0NsbLwlmyAL09cV5NZz9OZhU4Y14e3UVrTmTgN4r2NV66t8sb+UB6mKKlDeFSddt9PgP mluxO2cet9nSO3/G7JDm/qrqVniTRe8wT2JAUCUBgOebY00o9jVfgeY8bSnWlOgeMciZ2cQAbyN6J L6AW91r5CxBB3GX6SK7oY4l8Kev11uQNQp0GWNvsV24pwEiA554S03HhDZotYMCZvzQ1VuCyq35I3 +AmK9y2w==; 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 1r5Cfg-00B9Pw-2T; Mon, 20 Nov 2023 22:23:13 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 0829A300419; Mon, 20 Nov 2023 23:23:12 +0100 (CET) Date: Mon, 20 Nov 2023 23:23:11 +0100 From: Peter Zijlstra To: "Paul E. McKenney" 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: <20231120222311.GE8262@noisy.programming.kicks-ass.net> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <62c6e37c-88cc-43f7-ac3f-1c14059277cc@paulmck-laptop> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 14:24:08 -0800 (PST) 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?