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 8A8ECC61D85 for ; Tue, 21 Nov 2023 14:47:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234538AbjKUOrF (ORCPT ); Tue, 21 Nov 2023 09:47:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234535AbjKUOrD (ORCPT ); Tue, 21 Nov 2023 09:47:03 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02CE19A; Tue, 21 Nov 2023 06:46:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=Aze8F9xApdcP3sSDxB0vKPHogCta51Nh1owv78ypPIE=; b=bRlliqlOmmt1m6U87HdTA1PKF/ r57QZUcdhAwp4t6nN0mgH4yyIsCoRBlIpzVc/gDm0lwjyFZj5Bl6WFWJoUjVFmJYg+WRrztocYW3y 0JB5C8EdhLYNa9qNbZpDnzLUxyBMcw6ngn1wbUWlq1TeNneDf9i0yHNvpsElbs6NqwfryRXhS+vLl nFVuo7hpcJIpqKX/iO6QHwKr280ftdAZKtFRFZU30dA4hD9wb0XFBwsVY86pOebC6pjowVjdYDc4v XS32+wv9oA4cjKi/tnutrXsk/t5UjtsGpLJNatekHwqCKAdv5xGTSm4/lZ9GJdIixEnrSt0VebZ4h eU7geMsQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1r5S1T-005g1B-UG; Tue, 21 Nov 2023 14:46:44 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 81FF7300338; Tue, 21 Nov 2023 15:46:43 +0100 (CET) Date: Tue, 21 Nov 2023 15:46:43 +0100 From: Peter Zijlstra To: Mathieu Desnoyers Cc: "Paul E. McKenney" , 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: <20231121144643.GJ8262@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> <20231121084706.GF8262@noisy.programming.kicks-ass.net> <20231121143647.GI8262@noisy.programming.kicks-ass.net> <6f503545-9c42-4d10-aca4-5332fd1097f3@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6f503545-9c42-4d10-aca4-5332fd1097f3@efficios.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 21, 2023 at 09:40:24AM -0500, Mathieu Desnoyers wrote: > On 2023-11-21 09:36, Peter Zijlstra wrote: > > On Tue, Nov 21, 2023 at 09:06:18AM -0500, Mathieu Desnoyers wrote: > > > Task trace RCU fits a niche that has the following set of requirements/tradeoffs: > > > > > > - Allow page faults within RCU read-side (like SRCU), > > > - Has a low-overhead read lock-unlock (without the memory barrier overhead of SRCU), > > > - The tradeoff: Has a rather slow synchronize_rcu(), but tracers should not care about > > > that. Hence, this is not meant to be a generic replacement for SRCU. > > > > > > Based on my reading of https://lwn.net/Articles/253651/ , preemptible RCU is not a good > > > fit for the following reasons: > > > > > > - It disallows blocking within a RCU read-side on non-CONFIG_PREEMPT kernels, > > > > Your counter points are confused, we simply don't build preemptible RCU > > unless PREEMPT=y, but that could surely be fixed and exposed as a > > separate flavour. > > > > > - AFAIU the mmap_sem used within the page fault handler does not have priority inheritance. > > > > What's that got to do with anything? > > > > Still utterly confused about what task-tracing rcu is and how it is > > different from preemptible rcu. > > In addition to taking the mmap_sem, the page fault handler need to block > until its requested pages are faulted in, which may depend on disk I/O. > Is it acceptable to wait for I/O while holding preemptible RCU read-side? I don't know, preemptible rcu already needs to track task state anyway, it needs to ensure all tasks have passed through a safe spot etc.. vs regular RCU which only needs to ensure all CPUs have passed through start. Why is this such a hard question?