Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2733969ybh; Mon, 9 Mar 2020 11:54:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu7GkpkeXtyTSFjXGlOdtQzN3QndL3CsX2xJWJeCo5dm+7hZyptOIdq3iVMp81oUKs2XOdU X-Received: by 2002:a9d:30c7:: with SMTP id r7mr1592681otg.289.1583780074112; Mon, 09 Mar 2020 11:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583780074; cv=none; d=google.com; s=arc-20160816; b=X3sOibyP5NDuQoizTvQzNFBGb0r4UoJrlUDbh26wpGqF4Vt8HWTY6wFe94BVF9gOBR K+VgMBBFe0sOx2imYyDT6VbV2GufJj+pdJf7xZ0+UWbHJgaDnVUdu+QjwuW1Wlcptv3g yG+hQKUr4kb8y2S+4KfhKTIz3ZC/eEY3ngfgEnHOQoEip+0nZK+3omkO2WwDR/QdA14Y pkW7sVVl2YMVoHP169/ASuKNQ9/wnHt3jByyeg7+uXWOpiG+Y/q0hMMFEuB/GS+2wZdP ZWdRbM6Kkm+liS3RpoBHWo+PNFeEosUOOzWjLgMMsuvJfy4E0heYaHWZOv9q/XCynoEC HJhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=pE8bJ9ixsc7cm2JfC2ndvLTF4nXTDmZja0Dbm38GqhM=; b=X0hp8qll3/RysFwki2rqKHO+jjRUU+HKgQRQdLY7VArSGV4IbnqoF0A0+1CSQK+RPS vT+jejOe72C+U2ifyrk1sWTnfmo5oXcR3MbQ2IeiQVcYXmbJOkxgzciqM1Gw9e14950z VxosRAKQUphn7oyYy8xNK9+onb+mxMjwKagxg/dNzQjkElOPbYqCu9sf0nTeNW2hn1Ku M+Ov5FhxXnkG94fxQkyvNMT05NtqSiOvTcRXGqiOBcqz+YSD6NPZzhaJvQpLuerCj30w SAJbzfS+lokVxZIh5ZuvTKkNmI4YHrkTABVPjarKKoBfPmJM8hwA+DMaiKbIV3Q5eQIt DpNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b=GYqByHGE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12si4461625oiv.13.2020.03.09.11.54.21; Mon, 09 Mar 2020 11:54:34 -0700 (PDT) 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=pass header.i=@efficios.com header.s=default header.b=GYqByHGE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727442AbgCISwm (ORCPT + 99 others); Mon, 9 Mar 2020 14:52:42 -0400 Received: from mail.efficios.com ([167.114.26.124]:42734 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727334AbgCISwm (ORCPT ); Mon, 9 Mar 2020 14:52:42 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 7A6EC268442; Mon, 9 Mar 2020 14:52:40 -0400 (EDT) Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id unUE-b_3TSZu; Mon, 9 Mar 2020 14:52:40 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.efficios.com (Postfix) with ESMTP id 336B2268722; Mon, 9 Mar 2020 14:52:40 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 336B2268722 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1583779960; bh=pE8bJ9ixsc7cm2JfC2ndvLTF4nXTDmZja0Dbm38GqhM=; h=Date:From:To:Message-ID:MIME-Version; b=GYqByHGEkCTsDiWNmXVoDMf+F0+Xg+MvIb3gf7SAq62tWNg2Ok9zz+tb+J2ZPmEvi czlzV2bCpyas3Lc+++jfI3rxJxfFMR48C0Zq4i3k9p2uoMqEgB5DSGQLPlFnj7QBh1 Cd6966Ss+9ilIBAzNku7N6lyZutGwVGbULDy8/V1qUBmEjW/BZyl9+Zzbs/CY38lGz L/5dhsnJgcavErn+qvesncShw/2UnWd3r2O39AczFSWyqE/44MQrSSb/m2szrpyfJQ jMqkyO2dVd+N5A8uhQD5/sygPOGaRFfYtdtZTLLcbILXO3dHNczuTp46d7i45pV6Tt IDG38QXW9Wcvg== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([127.0.0.1]) by localhost (mail03.efficios.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id if5RhueP52Ff; Mon, 9 Mar 2020 14:52:40 -0400 (EDT) Received: from mail03.efficios.com (mail03.efficios.com [167.114.26.124]) by mail.efficios.com (Postfix) with ESMTP id 26AA3268441; Mon, 9 Mar 2020 14:52:40 -0400 (EDT) Date: Mon, 9 Mar 2020 14:52:40 -0400 (EDT) From: Mathieu Desnoyers To: rostedt Cc: Thomas Gleixner , linux-kernel , Peter Zijlstra , Masami Hiramatsu , Alexei Starovoitov , paulmck , "Joel Fernandes, Google" , Frederic Weisbecker Message-ID: <1851876075.21840.1583779960064.JavaMail.zimbra@efficios.com> In-Reply-To: <20200309144427.0ce0eabc@gandalf.local.home> References: <87mu8p797b.fsf@nanos.tec.linutronix.de> <1403546357.21810.1583779060302.JavaMail.zimbra@efficios.com> <20200309144427.0ce0eabc@gandalf.local.home> Subject: Re: Instrumentation and RCU MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.26.124] X-Mailer: Zimbra 8.8.15_GA_3901 (ZimbraWebClient - FF73 (Linux)/8.8.15_GA_3895) Thread-Topic: Instrumentation and RCU Thread-Index: NW7KV4uXEwGhR5W3UrelonrIpWyYaQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Mar 9, 2020, at 2:44 PM, rostedt rostedt@goodmis.org wrote: > On Mon, 9 Mar 2020 14:37:40 -0400 (EDT) > Mathieu Desnoyers wrote: > >> So I think we could go back to plain RCU for rcuidle tracepoints if we do >> the cheaper "rcu_is_watching()" check rather than invoking >> rcu_irq_{enter,exit}_irqson() unconditionally. > > You mean something like this? I have a hard time applying this patch to any tree I can fetch, so I will use caution and say: probably not. ;-) And when I say "go back to plain RCU", I really mean removing use of SRCU from the tracepoints until we have other purposes for it (e.g. taking faults within specific tracepoint probes such as syscall enter/exit). Thanks, Mathieu > > -- Steve > > diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h > index 5f4de82ffa0f..1904dbb3a921 100644 > --- a/include/linux/tracepoint.h > +++ b/include/linux/tracepoint.h > @@ -164,7 +164,7 @@ static inline struct tracepoint > *tracepoint_ptr_deref(tracepoint_ptr_t *p) > struct tracepoint_func *it_func_ptr; \ > void *it_func; \ > void *__data; \ > - int __maybe_unused __idx = 0; \ > + int __maybe_unused __idx = -1; \ > \ > if (!(cond)) \ > return; \ > @@ -179,8 +179,8 @@ static inline struct tracepoint > *tracepoint_ptr_deref(tracepoint_ptr_t *p) > * For rcuidle callers, use srcu since sched-rcu \ > * doesn't work from the idle path. \ > */ \ > - if (rcuidle) \ > - __idx = srcu_read_lock_notrace(&tracepoint_srcu);\ > + if (rcuidle && !rcu_is_watching()) \ > + __idx = srcu_read_lock_notrace(&tracepoint_srcu); \ > \ > it_func_ptr = rcu_dereference_raw((tp)->funcs); \ > \ > @@ -199,7 +199,7 @@ static inline struct tracepoint > *tracepoint_ptr_deref(tracepoint_ptr_t *p) > } while ((++it_func_ptr)->func); \ > } \ > \ > - if (rcuidle) \ > + if (rcuidle && __idx != -1) \ > rcu_irq_exit_irqson(); \ > \ > preempt_enable_notrace(); \ -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com