Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3542811ybv; Mon, 10 Feb 2020 01:48:32 -0800 (PST) X-Google-Smtp-Source: APXvYqyLOjh2FGS8JNQ62nKahvBoNlZ9R0DYY1Ea374QKW+u+Y6HaLdl9S40gtOhhX2U9pB2w8te X-Received: by 2002:aca:5588:: with SMTP id j130mr296390oib.122.1581328112853; Mon, 10 Feb 2020 01:48:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581328112; cv=none; d=google.com; s=arc-20160816; b=JNekfNFON3Dd3SFTGiYMZtEpI1ybI+TqNr503DU4iXH6moyAmueyKoTcJ2B7+5EED0 gBSf3yYMGhy1bY7Nlcw1WIl09kdb/JA0hCjhMG5sEQmENfvDjQ7N6utARRc+pHDV82Se icgSOhhI/GoA2wyDgzPgH2mxacbI6jp+HFwGu2TrdDx4v86W0kHWssZXbscv5PrWdTUa mFTgj6KOKw+LWkZbswWQkM15TQDTqoKIe6VMC7I7OWOtsHawP2DiDHL2r885K7hKB9F0 AMmvKFQo3tp87os3yV0L2QjqXOOrw+xe1fNUFSXEi8XIlaIvqffxYGa6cpAA2hh19Rtd 4TzA== 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=HtVwYWV3cLV9hlMU2I2fM3VGcjP7NCI9FS1vAT5oWZk=; b=w789Id+nsNKXgCAIFITsV0v1rU8kdIRJZhZbs+qiLHWhu3wcI+hC7BhPOkwC9Rt8l6 +zZ3EoA3X4FvQ2j66alScVh7GfB1F7DfgNxxucBU7Eay5RQuv9NZj6hCcXn3sJveslfG oyIPtOWp34ISb5BWmtiXcQY0c1lwWXiGmTlhd1FmaChMgXJ4yelP1pfSbpmXiON9yMJ2 8AvctLSNlWrqaG/nYc5ZuwteQ0468kSy4cuFxyttT3fszYG2RwY68ZM0JbHqCu/2YzhQ rzP8UUr7HYZGsV/bQ1a9WSldgZ+kO77wduQYw40u8IaNJWJDhrA3B1wLzDp3otyJcvz0 mXFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="d/miR5Uc"; 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 a11si4608242otq.223.2020.02.10.01.48.20; Mon, 10 Feb 2020 01:48:32 -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="d/miR5Uc"; 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 S1727433AbgBJJqr (ORCPT + 99 others); Mon, 10 Feb 2020 04:46:47 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:34694 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726961AbgBJJqr (ORCPT ); Mon, 10 Feb 2020 04:46:47 -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=HtVwYWV3cLV9hlMU2I2fM3VGcjP7NCI9FS1vAT5oWZk=; b=d/miR5Ucnr1Ko8VrqfQcnmz/m+ MFeAPPC+zn2e9JnXYsEiCfW2hylvQvSwa5/YvVmbyMAlZH1tdNdh7Yr3Ti4dYkjppiAD7FUfkyKxU bir7LbcRxe66ROH1xIaBK304aAKaib7L0p1tmpT+2fADJKlI2yae7j3shGpj4hHX2ikHdqD1gJ2bq q7riMT/was8SXX8aD0MSCdV8dijO1aznFla1eR2KrxeuytBB5qOqBwiSWk4FJBEXmSLgpfyQKI3AQ HuKN3pT1JiQ53PAye6UYjmMfAeFv00lqEE8mAmjgEselawNPP8FTTR5pCj365A2cqxtl3T37teb4X R9lGovDA==; 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 1j15e1-0006V9-9E; Mon, 10 Feb 2020 09:46:21 +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 C4090300739; Mon, 10 Feb 2020 10:44:28 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DB55D2B1D5568; Mon, 10 Feb 2020 10:46:16 +0100 (CET) Date: Mon, 10 Feb 2020 10:46:16 +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: <20200210094616.GC14879@hirez.programming.kicks-ass.net> References: <20200207205656.61938-1-joel@joelfernandes.org> <1997032737.615438.1581179485507.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1997032737.615438.1581179485507.JavaMail.zimbra@efficios.com> 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 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.