Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp236907rdf; Tue, 21 Nov 2023 00:48:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcYmT1JXxpLAEhP1A7bM0X3ebrLy1S89jjtcfRwYTrvtGJ4a9bjLqC+/drlaqrwoRJgTm8 X-Received: by 2002:a05:6a20:7da0:b0:187:e4a6:10a with SMTP id v32-20020a056a207da000b00187e4a6010amr9388028pzj.53.1700556493699; Tue, 21 Nov 2023 00:48:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700556493; cv=none; d=google.com; s=arc-20160816; b=TYj4KXJII51zbLX/Fn/naGba5zNsXQlX754/dUN2vZ8ilUWH3L5rMnUnVuFPqtqzQq SQ+06ytXtOt5UwKG+TSHZvdMZWbhN+HzEUxZyeAqDJD7AhjKaWoLqkMkJa+9Ra/fUefe fzhV8Ih0Ah9p+kaBqbmhxEA7Z4JJTvOFoE+Y8lyt4G1s4RvVlj7HscEtjZ5eXl1FkJ0Z SkV/fLmet6kEXgYai9oacw0gQhMQYUXdtbXpNpwF8J/G+H0RZT3e7PDLvlHWgTQ+Xl9c WuQqbxq0XM4jDfb+gx2zg7aEGBwE7fdkk9RIWZk7/JpK+i9GkeWE2O6tQww1JvoigiPg B1lw== 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=hhIFmglu/0fpqKkrzBroixh2PqCL29HzySd71uSn2AQ=; fh=tkL3jDD5YtxKGjIuGdSmFwwrnohHV8gPoUcW+brgpK8=; b=Hpcsu8Bj2cZS0f1Ev6/2ZaMMP6M5ecQRPYlHPQba8WQshccgxFx9EI7hohRKh97omT ck1y1pxhx/Jpp3Rh4KV+2zOf138dlOQWLE53kPHY1yE5bgxb86bLfu4teXYcyChhpbb/ /NyZK3ufHabpCre7k/Dcb6tyo2n1Y2WzR/L9mHWZ6HFFha+NE7P7gfa5DqhrgfyHYpfE n/mZd1+uQ2+ZmWWreHHXDxRBfYu7wyPZ9tTy8bxhaMv+phCiE7VoHcE5HT2wrcS/EFiE H9NcZQoD99hpx1GkCurlF3rgcyGUBskcQ9UnpK2GAOP10XpbzywzKAggz1fqZ8fcVGwl h65Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=Btsk4SRK; 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 f1-20020a170902ff0100b001c62cfff798si9595586plj.372.2023.11.21.00.48.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 00:48:13 -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=Btsk4SRK; 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 69ED380BE603; Tue, 21 Nov 2023 00:48:10 -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 S231445AbjKUIrz (ORCPT + 99 others); Tue, 21 Nov 2023 03:47:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233096AbjKUIrc (ORCPT ); Tue, 21 Nov 2023 03:47:32 -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 E4ACEFA; Tue, 21 Nov 2023 00:47:26 -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=hhIFmglu/0fpqKkrzBroixh2PqCL29HzySd71uSn2AQ=; b=Btsk4SRKjcFPnTCxdpZd5Qo+Uo 9EVDEk/ALQJXF4Rj+e4+9sysr0RIy7syNjT+hhHA9nFjB9NM4nMPzGoSVSTZ1j2BRtI6QzVQX5ELE jVdyJ/f4tSGroIpdflsOWJ/lXWh748ZKaqoHWhwN/zDY8+x5BQGJvcwTzpu/FGa9mZr+UYKNAY1Bu 2+FewHujQiC4XnKaKntKB/6iT2EDILFuls6CVOASeRspYWl2yGgyKsOjWSTPcUDltWaCTH6az2pOy nmb6bcsdQ9LkuL3muaM7PSEppkAgECmk9X95wQjlGCwly6PM1k1Tpqmb27V+UNm/xdP9+NZGxZ3Sn bK8Kddwg==; 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 1r5MPU-00BNDn-1c; Tue, 21 Nov 2023 08:47:08 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 8304B3006F6; Tue, 21 Nov 2023 09:47:06 +0100 (CET) Date: Tue, 21 Nov 2023 09:47:06 +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: <20231121084706.GF8262@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> <20231120222311.GE8262@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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]); Tue, 21 Nov 2023 00:48:10 -0800 (PST) On Mon, Nov 20, 2023 at 03:56:30PM -0800, Paul E. McKenney wrote: > 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. So again, what is task-trace RCU ? How does it differ from say preemptible rcu, which AFAICT could be used here too, no?