Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4088069ybv; Mon, 10 Feb 2020 12:04:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzyXXpnW36k/YL7wg5KOai074un8zGFaPet1GEKNpGOFxbcyvt0vdTq1YHTWs5zsPZWFvot X-Received: by 2002:aca:f305:: with SMTP id r5mr524108oih.174.1581365054144; Mon, 10 Feb 2020 12:04:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581365054; cv=none; d=google.com; s=arc-20160816; b=qA8uft78R7eWPBUDpNGYwqVwnbH30GicOMKMGQNW5o6tU6HyFnINCE9WiYaqaQ0iwi DSHmu6lb+9Vpj2a2xUgIqKdj8SbsdMaI4DiAePUKr0vCkEn0LWxeA/+1HOdAsfwlWcrH /ejBXz+3rze7JMjlyW3BsQU39/DiPpGJvQpbVGl2ehXGX69+pTIvvAX4+u8DTwAM4AO+ azHogTSaJDmDaCTjGoyJIaS6+l40U2Gbf4hUSmycrPn5RXuO/x1+BWB7/HY11c6WD1Fi zJgntq8H7fNU/Z4BRLRshpncXrWgWUSoM0XaEGTzH2VrmzlN9sFhrTo2bnoJRYtDtlyj /77Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=xG34kmLgOfgJ9ugRWATKxhjUTAYaLD/B0/RrlrkA8Ag=; b=xf4fUSwFVtejxQR+QfKiPcDwCL5re7mROI1T1HDwjTgl1aRlDKn+F71wMCEwGn16mv KRDSftTbDdK9EU9J/HJWvrUJhTuhnqGYJZLY0XDlKlc7nHGQWHEY6FFPzVgIUI4hZzs4 /FXydsSjuwIFuUTa/Vnhm/7v8L4lVtdEV+trAA5hD4qbB8KREZv+jtRNN0BwPMri3GfL XZupGxFIg03EaedBCl9XIWKUu3oOmJYzLXNv6oAUO0Fxg/F7Zdv5qnh9nKEksC/QSlec kWA7XoOcQoUlONui4KJkMXYuoFXtjjuNzmuv+9UX9PYbj2Qatotk0C/8X3nuKk00iNd+ MN+g== ARC-Authentication-Results: i=1; mx.google.com; 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 e26si682814otp.140.2020.02.10.12.04.00; Mon, 10 Feb 2020 12:04:14 -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; 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 S1727254AbgBJUDv (ORCPT + 99 others); Mon, 10 Feb 2020 15:03:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:47430 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727029AbgBJUDv (ORCPT ); Mon, 10 Feb 2020 15:03:51 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1C23120838; Mon, 10 Feb 2020 20:03:50 +0000 (UTC) Date: Mon, 10 Feb 2020 15:03:48 -0500 From: Steven Rostedt To: Joel Fernandes Cc: Mathieu Desnoyers , Peter Zijlstra , linux-kernel , Greg Kroah-Hartman , "Gustavo A. R. Silva" , Ingo Molnar , Richard Fontana , Thomas Gleixner , paulmck , Josh Triplett , Lai Jiangshan , Arnaldo Carvalho de Melo Subject: Re: [RFC 0/3] Revert SRCU from tracepoint infrastructure Message-ID: <20200210150348.7d0979e6@gandalf.local.home> In-Reply-To: <20200210195302.GA231192@google.com> References: <20200207205656.61938-1-joel@joelfernandes.org> <1997032737.615438.1581179485507.JavaMail.zimbra@efficios.com> <20200210094616.GC14879@hirez.programming.kicks-ass.net> <20200210120552.1a06a7aa@gandalf.local.home> <1966694237.616758.1581355984287.JavaMail.zimbra@efficios.com> <20200210133045.3beb774e@gandalf.local.home> <20200210195302.GA231192@google.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 10 Feb 2020 14:53:02 -0500 Joel Fernandes wrote: > > diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h > > index 1fb11daa5c53..a83fd076a312 100644 > > --- a/include/linux/tracepoint.h > > +++ b/include/linux/tracepoint.h > > @@ -179,10 +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) { \ > > + if (rcuidle) \ > > __idx = srcu_read_lock_notrace(&tracepoint_srcu);\ > > - rcu_irq_enter_irqson(); \ > > - } \ > > This would still break out-of-tree modules or future code that does > rcu_read_lock() right in a tracepoint callback right? Yes, and that's fine. > > Or are we saying that rcu_read_lock() in a tracepoint callback is not > allowed? I believe this should then at least be documented somewhere. Also, No, it's only not allowed if you you attached to a tracepoint that can be called without rcu watching. That's up to the caller to figure it out. Tracepoints were never meant to be a generic thing people should use without knowing what they are really doing. > what about code in tracepoint callback that calls rcu_read_lock() indirectly > through a path in the kernel, and also code that may expect RCU readers when > doing preempt_disable()? Then they need to know what they are doing. > > So basically we are saying with this patch: > 1. Don't call in a callback: rcu_read_lock() or preempt_disable() and expect RCU to do > anything for you. We can just say, "If you plan on using RCU, be aware that it man not be watching and you get do deal with the fallout. Use rcu_is_watching() to figure it out." > 2. Don't call code that does anything that 1. needs. > > Is that intended? thanks, > No, look what the patch did for perf. Why make *all* callbacks suffer if only some use RCU? If you use RCU from a callback, then you need to figure it out. The same goes for attaching to the function tracer. -- Steve