Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3568312ybv; Mon, 10 Feb 2020 02:21:22 -0800 (PST) X-Google-Smtp-Source: APXvYqwVP2wuPEGZnDo/Q8FTx92u+k0/lCLiQT6dJkFUTf/k4dNMWrTYNwZAx7h1VYWOwUSWNImN X-Received: by 2002:a05:6830:1bda:: with SMTP id v26mr494462ota.314.1581330082587; Mon, 10 Feb 2020 02:21:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581330082; cv=none; d=google.com; s=arc-20160816; b=MpnwRq8mQ6OdpeDqMs0xsILHQi+x6MAwA/H/OjzCpKHo4PigmZ/AdSpTRciUR4c+cc FVwJR0YVqZZYtfdC/kHrLVIabmghdP6blmT6nH+ZKIekXgFgiXqUHaXHsN46Aq6a24L2 hSC13OBlviYDQV5Uwnu+MkJjkuMysuf3bWwKZ/6R2qkj69cmu4OnnHHEKSzbXY/x2kM0 bhv3jxdj9mR6DWKERkYww0yx8Qik9p29WgOvM8o03FlrnkVARzllpUdeXqBsmyEMmOJw rCzUmHow34O6WBHNPNyOyc3424L6bk+cKRZ8bFGe91vY0nLct+oFmZ6W1xBhVIQRXcxg G+OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Og2/sR+EpPhzVLDU70FpiS/OXyn2MIXo3lrPW/wFe1Q=; b=tcQIvepL+fEE8yjRal0mDRFvMSUhbhwuCKZqZU8+t8qRxla2+kMgaBxTbwoTTkkTsk r/u5pX+sDfreCVkYFxptGA1rhFRZ6reO+BrnTZNWxWkBLMp1KG9eYOIGKfVsO/HlnyFL ZfpP1isenofJBXaiBqigH4enqV6QJPt8cjrl4Ii3cv3hh8sALDgPaoy1oossh4+Zwx8/ QMKLhvftbFrtl0e1K/2kVjaJOvUn0m2y4SdMgYg8s9dDVZg6cGFuGAboAx9PNa9ZynSK 2QuaQMZmzVHphypPUxUKCXtHQPunGe786S4yhDpZ9zpCHccKYpICSxoctWImUf7PQz0z Wljg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=g8z0NGMI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si7535133oie.240.2020.02.10.02.21.10; Mon, 10 Feb 2020 02:21:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=g8z0NGMI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727079AbgBJKUZ (ORCPT + 99 others); Mon, 10 Feb 2020 05:20:25 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:59620 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726796AbgBJKUY (ORCPT ); Mon, 10 Feb 2020 05:20:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=Og2/sR+EpPhzVLDU70FpiS/OXyn2MIXo3lrPW/wFe1Q=; b=g8z0NGMIzR7qFLDc3lNCPU5Ka7 KCK/YXSRzcKh0ou5w7wRBKYPxJSSq0fPHrBZAaKiTNZDswZ1IRxvTGW7mMuM6eyA8gHphvh5ljry8 h2OMMYS0ktFdDtZ2lpJP7iTd4MAlaGRqNi1ZgI4ZaKN1U3flrMzK3vjWH9RoYeSSZXepQ5sFvlRwn XEx8urRC+jZrLq6e2bTPtqSQrPbFGAU7JlTI4njPjxp2j/l1Y9dLXAtTvVpcMGXY6weKircSoaY1V t1iMpDq2haHicH5VMTsC8SkIRvLtZwWmJte2SJ6GcDJyPyhFvbDS1nIserQM0PtaRUu9XiB3pVqAV /VFm6qZA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1j16Ac-0003kh-1Y; Mon, 10 Feb 2020 10:20:02 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 7A1AC300446; Mon, 10 Feb 2020 11:18:10 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 977DD2B835253; Mon, 10 Feb 2020 11:19:58 +0100 (CET) Date: Mon, 10 Feb 2020 11:19:58 +0100 From: Peter Zijlstra To: Mathieu Desnoyers Cc: "Joel Fernandes, Google" , linux-kernel , Greg Kroah-Hartman , "Gustavo A. R. Silva" , Ingo Molnar , Richard Fontana , rostedt , Thomas Gleixner , paulmck , Josh Triplett , Lai Jiangshan , Arnaldo Carvalho de Melo Subject: Re: [RFC 0/3] Revert SRCU from tracepoint infrastructure Message-ID: <20200210101958.GV14946@hirez.programming.kicks-ass.net> References: <20200207205656.61938-1-joel@joelfernandes.org> <1997032737.615438.1581179485507.JavaMail.zimbra@efficios.com> <20200210094616.GC14879@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200210094616.GC14879@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 10, 2020 at 10:46:16AM +0100, Peter Zijlstra wrote: > On Sat, Feb 08, 2020 at 11:31:25AM -0500, Mathieu Desnoyers wrote: > > ----- On Feb 7, 2020, at 3:56 PM, Joel Fernandes, Google joel@joelfernandes.org wrote: > > > > > Hi, > > > These patches remove SRCU usage from tracepoints. The reason for proposing the > > > reverts is because the whole point of SRCU was to avoid having to call > > > rcu_irq_enter_irqson(). However this was added back in 865e63b04e9b2 ("tracing: > > > Add back in rcu_irq_enter/exit_irqson() for rcuidle tracepoints") because perf > > > was breaking.. > > > > I think the original patch re-enabling the rcu_irq_enter/exit_irqson() is a > > tracepoint band-aid over what should actually been fixed within perf instead. > > > > Perf should not do rcu_read_lock/unlock()/synchronize_rcu(), but rather use > > tracepoint_synchronize_unregister() to match the read-side provided by > > tracepoints. > > > > If perf can then just rely on the underlying synchronization provided by each > > instrumentation providers (tracepoint, kprobe, ...) and not explicitly add its own > > unneeded synchronization on top (e.g. rcu_read_lock/unlock), then it should simplify > > all this. > > It can't. At this point it doesn't know where the event came from. Also, > the whole perf stuff is per definition non-preemptible, as it needs to > run from NMI context. > > Furthermore, using srcu would be detrimental, because of how it has > smp_mb() in the read side primitives. > > The best we can do is move that rcu_irq_enter/exit_*() crud into the > perf tracepoint glue I suppose. I can't even tell how to do that; the knowledge of this is long gone by the time we get there. That is, the @rcuidle state is lost in __DO_TRACE(), it is not passed further down the chain. Just to clarify; perf doesn't care about the tracepoint synchronization beyond the glue code. Perf uses RCU itself for it's own purposes.