Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3510376pxx; Mon, 2 Nov 2020 10:45:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwd/yBbDNOIHI8jpClXbXnGGOxlpUIg7Bvep7b4lkGpvr53msNe8Cuov1/VY+OnyRESP7lK X-Received: by 2002:a17:906:b312:: with SMTP id n18mr7140497ejz.353.1604342750111; Mon, 02 Nov 2020 10:45:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604342750; cv=none; d=google.com; s=arc-20160816; b=cJ0fWQHohm+z/0NMzkyFh0qm+x4qGpRMJXy27zkaIPdNlWP59FmaeaVHfIOw0RxVtR D2Qq2JJH8YCSDS+bgZSupRzGBN1tqnj5eQlCcsgMjnjLIpiziy2809Xcg+HqeTk+wUK9 Erb/4LeqfwtJclhao5XXGktijnJ7m+H5YJ9Lc+IMXy0Y/2dWhLwdrb/Ar6z7TIbL4v88 3Di1SGG62PS8O6DyihnfZ6eeX/36EdY1Ui+xbB7H2KNI56ZVfXuQXHZc1aVMVkVDLjGk 39weoXiNEwpHBFAwmF4UwyniQW+0Tbj/TGJ37jmJmKYVDqwLD/KG0uq1UUzF99/OR491 b2Nw== 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=qiHZ1hrsvinTv/K83q0Rhp/LFKZP3RXggPFNrMPda6o=; b=0/eH01M0Bp3OqrtZcLMp44pm/rUEu8+kzjs1TyJADZDb8VuwFridWGoygelBVU29KJ GD9M/NWoPISKCDTJf8BuCm1rfbQmvocbrlSTPA9LwjDSk7pam1VMqYU9YOTTzRhk+pgn IGId99W12MqkZTpnCvKVF01lNXeytVF36McF1bKWHtQwqBSB8XfbfdYMRWwnJzYLFOnV 8/MxYuGC31ybhcZWMUO0TC6xk8EggTrHFXp+MQqjdFOVe8KZr2P0Mxi2mAR1bMiOChaO qqGxWJgZGFCi8KtNFy9AxzwiOTvgLmwH3eaqvyF/c2BlsF79yqO3oFuGTDFcdt/Bl+VA 8OYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=mlUxWUYc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k10si6391777edk.529.2020.11.02.10.45.27; Mon, 02 Nov 2020 10:45:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=mlUxWUYc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726512AbgKBSny (ORCPT + 99 others); Mon, 2 Nov 2020 13:43:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725805AbgKBSnx (ORCPT ); Mon, 2 Nov 2020 13:43:53 -0500 Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95E38C061A04 for ; Mon, 2 Nov 2020 10:43:53 -0800 (PST) Received: by mail-qk1-x741.google.com with SMTP id k9so12400505qki.6 for ; Mon, 02 Nov 2020 10:43:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qiHZ1hrsvinTv/K83q0Rhp/LFKZP3RXggPFNrMPda6o=; b=mlUxWUYczJS33fR/iEwt/7WalH3MyWBBWGTZPF3zH1DpEprnioF1fYaxu2gUKfLdKw 1WMZTm5lKn3mAjOa41gApSWGp+MEayPPgZTLRwmfUBDhuWArFWjsSASOHXFb+IfhiElE SmHeEPC+CaEHSaIUeDgtVjphVl0ukNHXln5sE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qiHZ1hrsvinTv/K83q0Rhp/LFKZP3RXggPFNrMPda6o=; b=k692CoAwJraimqle2rUQJL0fUEquqV945JbL8TGUA0u7w+v+yi2ZipiJdZV8xWp0Zf CeEjy3vguJOlI/xsJw54HDzM5U0s+23KZcollngXuSuDZCDCoJbxb9/FDgVBM8R4nETo q982F6CAAlm3f2Jc1eqO/grWDt/C9R04+Cr7bBHPndlZqRWmy53KlLY6pg0BzGlHJNNR erx8VsIQwLh+IuJNlt+i446woPqPMEmnRqe9KyPyAmjw2K9XiJPnh6C1CSqGNlErQkNt 8t9GnzzEzANCsw3L6eAB3cFY6F8p+neCOZ27HSHops+ngllcU0k8xwhxSPOIYq+m+1MU SUeA== X-Gm-Message-State: AOAM532NAsUgb5KKVR27YZ14j5goBhn3wA62fjZw8OSzvK2f5ou6sWck 0yN8mN2VUL1yQ64vFO7ml7P93Q== X-Received: by 2002:a05:620a:2144:: with SMTP id m4mr16144470qkm.269.1604342632790; Mon, 02 Nov 2020 10:43:52 -0800 (PST) Received: from localhost ([2620:15c:6:411:cad3:ffff:feb3:bd59]) by smtp.gmail.com with ESMTPSA id 71sm8719856qko.55.2020.11.02.10.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Nov 2020 10:43:52 -0800 (PST) Date: Mon, 2 Nov 2020 13:43:51 -0500 From: Joel Fernandes To: Mathieu Desnoyers Cc: Peter Zijlstra , Thomas Gleixner , Michael Jeanson , linux-kernel , rostedt , Alexei Starovoitov , Yonghong Song , paulmck , Ingo Molnar , acme , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , bpf Subject: Re: [RFC PATCH 6/6] tracing: use sched-RCU instead of SRCU for rcuidle tracepoints Message-ID: <20201102184351.GA595952@google.com> References: <20201023195352.26269-1-mjeanson@efficios.com> <20201023195352.26269-7-mjeanson@efficios.com> <20201023211359.GC3563800@google.com> <20201026082010.GC2628@hirez.programming.kicks-ass.net> <73192641.37901.1603722487627.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <73192641.37901.1603722487627.JavaMail.zimbra@efficios.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 26, 2020 at 10:28:07AM -0400, Mathieu Desnoyers wrote: > ----- On Oct 26, 2020, at 4:20 AM, Peter Zijlstra peterz@infradead.org wrote: > > > On Fri, Oct 23, 2020 at 05:13:59PM -0400, Joel Fernandes wrote: > >> On Fri, Oct 23, 2020 at 03:53:52PM -0400, Michael Jeanson wrote: > >> > From: Mathieu Desnoyers > >> > > >> > Considering that tracer callbacks expect RCU to be watching (for > >> > instance, perf uses rcu_read_lock), we need rcuidle tracepoints to issue > >> > rcu_irq_{enter,exit}_irqson around calls to the callbacks. So there is > >> > no point in using SRCU anymore given that rcuidle tracepoints need to > >> > ensure RCU is watching. Therefore, simply use sched-RCU like normal > >> > tracepoints for rcuidle tracepoints. > >> > >> High level question: > >> > >> IIRC, doing this increases overhead for general tracing that does not use > >> perf, for 'rcuidle' tracepoints such as the preempt/irq enable/disable > >> tracepoints. I remember adding SRCU because of this reason. > >> > >> Can the 'rcuidle' information not be pushed down further, such that perf does > >> it because it requires RCU to be watching, so that it does not effect, say, > >> trace events? > > > > There's very few trace_.*_rcuidle() users left. We should eradicate them > > and remove the option. It's bugs to begin with. > > I agree with Peter. Removing the trace_.*_rcuidle weirdness from the tracepoint > API and fixing all callers to ensure they trace from a context where RCU is > watching would simplify instrumentation of the Linux kernel, thus making it harder > for subtle bugs to hide and be unearthed only when tracing is enabled. This is > AFAIU the general approach Thomas Gleixner has been aiming for recently, and I > think it is a good thing. > > So if we consider this our target, and that the current state of things is that > we need to have RCU watching around callback invocation, then removing the > dependency on SRCU seems like an overall simplification which does not regress > feature-wise nor speed-wise compared with what we have upstream today. The next > steps would then be to audit all rcuidle tracepoints and make sure the context > where they are placed has RCU watching already, so we can remove the tracepoint > rcuidle API. That would effectively remove the calls to rcu_irq_{enter,exit}_irqson > from the tracepoint code. > > This is however beyond the scope of the proposed patch set. You are right, it doesn't regress speedwise - I got confused since the code was modified to call rcu_enter_irqson() even for the rcuidle case (which I had avoided when I added SRCU). So in current code, SRCU is kind of pointless. I think keep the patch in the series. thanks, - Joel