Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp743180ybv; Thu, 13 Feb 2020 08:42:32 -0800 (PST) X-Google-Smtp-Source: APXvYqyUwnVcDOrse39OJ2qS+YGjlSOdf+iFG1m+nT2mb3FeCxUyB0RXhTzVqNYm47G4ydCxTVVQ X-Received: by 2002:aca:534f:: with SMTP id h76mr3550414oib.23.1581612152873; Thu, 13 Feb 2020 08:42:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581612152; cv=none; d=google.com; s=arc-20160816; b=RqZwYoTNh5R0gg+cweqjBOu+55ZetwfhtWR7VYqYS4MBwA6degjuIwscbNKUs3Mnbl 6N50a8XADdzRFtLzZ8TfClTr2gThRorfTsyoePnxObNjKH/BrhDIviySj/FSOGwAzn13 Y23lUAKCzTqLRFH3/55tp11+xIKveWjPXRZEUzozrMrjTtVr4JPIJggmb1k3p5lqDA9s bHGJnWWyTQ0YcTKQFEznToIMcSXPx6yRQnnq63wtzcOLaAxppnmaXx7Pmfph5jDaK/ck ipdDFR7Zay6j+OM7gUxcVXTUs7hr5DXTv5BSbqdt7DV3B6dySq03530DNHaHyG+j/ocR nV1A== 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=luwMxyZU6lFzVJt3SO6czFv4ciHzh854fmX24FDkPhk=; b=nFq3hlkHmkkJbQBt4GPDkZE0jMXSWSUyVZKkx4TLAOLAzID5squyxohBB+oZHEILFp YdDgts6d4iSPkPJDR7jQSWFxAVJGTcE8bXn3gpxiTsrinEv0Vt2bicHF/6T9rBR+PPl+ rM7/Xts4UY8ThTbaclcTg/jZL5kDK4MIAYxyA7AriRHPYamrmidp5Hl93MRz1XDq+p15 uez4vr7270sWlPA3bH4nwwtMNvouMx5dszTW5gx7rszxU5MXmDodbPUgIk/6yQi8qbm0 XzHsT4BbLLU/7Meeq7ZDY4Ux+I6Xt/9TDDPqr6U9fJ1bT84nqo8gluCVKuhk+Hnab0Hc je5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=EYB6bMxM; 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 q65si1255159oic.123.2020.02.13.08.42.20; Thu, 13 Feb 2020 08:42: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=EYB6bMxM; 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 S1727930AbgBMQk5 (ORCPT + 99 others); Thu, 13 Feb 2020 11:40:57 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:36710 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727671AbgBMQk4 (ORCPT ); Thu, 13 Feb 2020 11:40:56 -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=luwMxyZU6lFzVJt3SO6czFv4ciHzh854fmX24FDkPhk=; b=EYB6bMxMkcq8ZMZOFxKpztIYpm 8JWzqukpe0Mwhyc9DrWPgOzOCUWcrkOCR57n3FXNizFJHMrXrV5cZYfoQ3/B2mDq5D7TpwAWeOcL1 BscLNMPC3RFO4Z3/WojgVh9vB4h3ihYsKmyxqhBjqQ6mjRulcMC2qo+Am4nG3blmyHSKAhrhjUuLV szuKDgRj+go9B0Ka173GGhy8DJ4cn//+4EkKDYHve6MswcBITTKOin4tfLXaLhQqrnzaVNc2cC8fR WtpM4snTUyzhSzyDVf5fhpq6YGxjnBJwcpRMOq6gHzXTkxOEfayMsz2nYyKfVBwW//BtDF9lX/9Ng a1sKGrCQ==; 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 1j2HXW-0000mE-M2; Thu, 13 Feb 2020 16:40:34 +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 E667D307963; Thu, 13 Feb 2020 17:38:41 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 0EFA620206D69; Thu, 13 Feb 2020 17:40:31 +0100 (CET) Date: Thu, 13 Feb 2020 17:40:31 +0100 From: Peter Zijlstra To: "Paul E. McKenney" Cc: Joel Fernandes , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, rostedt@goodmis.org, mingo@kernel.org, gregkh@linuxfoundation.org, gustavo@embeddedor.com, tglx@linutronix.de, josh@joshtriplett.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com Subject: Re: [PATCH v2 3/9] rcu,tracing: Create trace_rcu_{enter,exit}() Message-ID: <20200213164031.GH14914@hirez.programming.kicks-ass.net> References: <20200212210139.382424693@infradead.org> <20200212210749.971717428@infradead.org> <20200212232005.GC115917@google.com> <20200213082716.GI14897@hirez.programming.kicks-ass.net> <20200213135138.GB2935@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200213135138.GB2935@paulmck-ThinkPad-P72> 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 Thu, Feb 13, 2020 at 05:51:38AM -0800, Paul E. McKenney wrote: > The reason for the irq argument is to avoid invoking > rcu_prepare_for_idle() and rcu_dynticks_task_enter() from NMI context > from rcu_nmi_exit_common(). Similarly, we need to avoid invoking > rcu_dynticks_task_exit() and rcu_cleanup_after_idle() from NMI context > from rcu_nmi_enter_common(). Aaah, I see. I didn't grep hard enough earlier today (I only found stubs). Yes, those take locks, we mustn't call them from NMI context. > It might well be that I could make these functions be NMI-safe, but > rcu_prepare_for_idle() in particular would be a bit ugly at best. > So, before looking into that, I have a question. Given these proposed > changes, will rcu_nmi_exit_common() and rcu_nmi_enter_common() be able > to just use in_nmi()? That _should_ already be the case today. That is, if we end up in a tracer and in_nmi() is unreliable we're already screwed anyway.