Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp756685ybz; Wed, 15 Apr 2020 18:16:38 -0700 (PDT) X-Google-Smtp-Source: APiQypJ95aQ6qUrY0JYPY1iIRjwjxtdYss9OxviameD8zqMFYGxhV/+dribjV+LMI/L4N9t50O3+ X-Received: by 2002:a17:906:7b53:: with SMTP id n19mr4942468ejo.244.1586999797989; Wed, 15 Apr 2020 18:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586999797; cv=none; d=google.com; s=arc-20160816; b=SilxZYY/rzCLTFI7FAq85O9l9cXEycXigoAovVXDJ0mKDF7Vid2+EmG6ukFIb5v5qQ rDoUidjlt8l+5/dUtmfilIXXAnwpiAE0vBSvVqyFMOQfCVYCQFibx72org1rM0AkKthC kmFny8ezCD9EQAhTDGzGYY92ul/PJpqzSC+R4Wy+qgeMAZPCmhU9sqUZ6deqGf3ZgjwA A2IoYXb+GRHE5dMkT1qehNuWuaJSGNDG6I89se9Yh8+zoj+J0J4eHo1whuklYdAK74Cu KYta33gN+U4eW9ctlNtU3V2BKZAgvqPR4FaSS8JiTgGGiMFO0yfX9sSeqhWCIIfa15Yy uzRA== 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=hIyFN2Ena61zMEXKK31Dz5ji33ii82nEDgi+eh+rx8I=; b=lGeJUmNRYM/MyBsQ9O8oJUxD7adD7H1NHd25IdW24LWPu1VVRPpNJVHtXlytTGfg/e iiHzMnstGJ799ziVStyAsEAq1OlHCyZ7eT1B1jUK+uvBg5wPFIMi7m4dEflt0Q9f2t+a xpqAgxL/pWos6n/OjBwSCu+Kxkr/b59aKl2gxqrkyUg3RfoNS7v7dtaDgmcwfgZP3iyC rRoWpbCroflaeK7KrsTx3wihQkdc+DXHN6adkxrdyO+TCwvx9lwunhZPMddlpVTUHthQ MHM23X1bCY9cL3beYGbuA+1qN3s1iVCmV9v9Y05muyNe5lQgftFvZmSAYZDgiRdYauma 8dLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx8si3469214edb.25.2020.04.15.18.16.15; Wed, 15 Apr 2020 18:16:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405032AbgDPAsh convert rfc822-to-8bit (ORCPT + 99 others); Wed, 15 Apr 2020 20:48:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:39854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404980AbgDPAsb (ORCPT ); Wed, 15 Apr 2020 20:48:31 -0400 Received: from oasis.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 A0960206A2; Thu, 16 Apr 2020 00:48:29 +0000 (UTC) Date: Wed, 15 Apr 2020 20:48:27 -0400 From: Steven Rostedt To: John Stultz Cc: "Paul E. McKenney" , Josh Triplett , lkml , Bjorn Andersson , Saravana Kannan , Todd Kjos , Stephen Boyd , Peter Zijlstra , Thomas Gleixner Subject: Re: On trace_*_rcuidle functions in modules Message-ID: <20200415204827.24f2c548@oasis.local.home> In-Reply-To: References: <20200415085348.5511a5fe@gandalf.local.home> <20200415161424.584d07d3@gandalf.local.home> <20200415164116.40564f2c@gandalf.local.home> <20200415174918.154a86d0@gandalf.local.home> <20200415220459.GE17661@paulmck-ThinkPad-P72> <20200415185121.381a4bc3@gandalf.local.home> 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: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 15 Apr 2020 17:06:24 -0700 John Stultz wrote: > So you're saying the recent change to move to using trace_*_rcuidle() > was unnecessary? > > Or is there a different notifier then cpu_pm_register_notifier() that > the driver should be using (that one seems to be using > atomic_notifier_chain_register())? From looking at the trace event in __tcs_buffer_write() in drivers/soc/qcom/rpmh-rsc.c, the _rcuidle() was added by: efde2659b0fe8 ("drivers: qcom: rpmh-rsc: Use rcuidle tracepoints for rpmh") Which shows a backtrace dump of: Call trace: dump_backtrace+0x0/0x174 show_stack+0x20/0x2c dump_stack+0xc8/0x124 lockdep_rcu_suspicious+0xe4/0x104 __tcs_buffer_write+0x230/0x2d0 rpmh_rsc_write_ctrl_data+0x210/0x270 rpmh_flush+0x84/0x24c rpmh_domain_power_off+0x78/0x98 _genpd_power_off+0x40/0xc0 genpd_power_off+0x168/0x208 genpd_power_off+0x1e0/0x208 genpd_power_off+0x1e0/0x208 genpd_runtime_suspend+0x1ac/0x220 __rpm_callback+0x70/0xfc rpm_callback+0x34/0x8c rpm_suspend+0x218/0x4a4 __pm_runtime_suspend+0x88/0xac psci_enter_domain_idle_state+0x3c/0xb4 cpuidle_enter_state+0xb8/0x284 cpuidle_enter+0x38/0x4c call_cpuidle+0x3c/0x68 do_idle+0x194/0x260 cpu_startup_entry+0x24/0x28 secondary_start_kernel+0x150/0x15c There's no notifier that calls this. This is called by the rpm_callback logic. Perhaps that callback will require a call to rcu_irq_enter() before calling the callback. In any case, I think it is wrong that these callbacks are called without RCU watching. The _rcuidle() on that tracepoint should be removed, and we fix the code that gets there to ensure that RCU is enabled. I agree with Peter, that no module code should be executed without RCU watching. -- Steve