Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp700656ybz; Wed, 15 Apr 2020 17:02:17 -0700 (PDT) X-Google-Smtp-Source: APiQypLDogc2GjSEPybFT/6ojQ7V1URatCJbaZFwrHHWQrnWipxPeslhF88CFzHKhlPy1yWCxEz+ X-Received: by 2002:a05:6402:2032:: with SMTP id ay18mr99889edb.16.1586995337504; Wed, 15 Apr 2020 17:02:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586995337; cv=none; d=google.com; s=arc-20160816; b=DxUycWEmyJ6pjJ2PO8paENec1t1Y3nruXtxhl/uC3kk9IlUaVVTTSik43NIzSFAaFk kf39iKkyUqv2jIt9QhK3DiVgS7LYOMTyQwPK5PAXRd1BfE1qrJsYQ6msj6xVg50vFAoe 6iVteDz4ICl9z1W9KyLdMFqKknOfRMG4NWmbQmErEgos5lAKhnkMkPFabfut0hgFaJjq NbdxfPDYxw/YhHhojBEmdQEDnXKyfhbdxt+Bz6O1K1GJAiu128H8qzLxqgkhTehx/mPd /k0RCkmwKYvb7fw6RtoESo/bgF/3DK5o3mUuXLwvswuCQI3giBlowt2Vl6XnUYWR39BL tsGQ== 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:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=g7MEdqoXZKnlCdRzuwIALA5R83/CqGBt+nOpvNF7t/c=; b=ryyIz8L20jXMDQxd0EgWTuDzX0BB3kqKuyrnBTq7IsGWeWouldufuLsilkq0X9TPRA iRrv4Faezkp6RkLT7RhPZxfwV7c+wbGJlAIh40W68lo1+bSzwG/4Y4FBA9POy+sDKpaJ VmR3XnXqTiXN0P2nTwfSW+peaBqRMR0TcSexzSdX+q0xDolLHyQc45jIjUq2DozBi+HL weewIHaoQyCaY2n5d+qrbc6h9kZX4G0TtAYqypOLl5FfYzA5VfUs/VJwSBuDQ4GYl0SY ikib6POHHL6zwPo6f0vVlm71mvPTwndQpOeyUhcfgCrG28TzwNXbJtTgp/FlLnIulXzM BW0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gw+Ghbx4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p12si10958274eju.367.2020.04.15.17.01.54; Wed, 15 Apr 2020 17:02:17 -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; dkim=pass header.i=@kernel.org header.s=default header.b=gw+Ghbx4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504715AbgDONMa (ORCPT + 99 others); Wed, 15 Apr 2020 09:12:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:51644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504663AbgDONMB (ORCPT ); Wed, 15 Apr 2020 09:12:01 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (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 A38AC2076D; Wed, 15 Apr 2020 13:12:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586956320; bh=Zi/f9H0m1a1c3VA6JImQDC0eq32jZrjXYXX9wes3NTA=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=gw+Ghbx4l4gaDRyLA18tSmh+2JKbBXj/Mh+xDF0D8UMW6SuKr+4Nlfre6IaC8aO+I S6B3crjk+bwTXrBb2TAk5KzT1w/i7eQzRT3PXFC+qIP+DcIaYIszDhFhkQzEd+XBGV YLPzdGY8QhQXPgN9tauA8PCeqlOhnZxGePLaWc/Q= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 6EE6D3522B45; Wed, 15 Apr 2020 06:12:00 -0700 (PDT) Date: Wed, 15 Apr 2020 06:12:00 -0700 From: "Paul E. McKenney" To: John Stultz Cc: Josh Triplett , Steven Rostedt , lkml , Bjorn Andersson , Saravana Kannan , Todd Kjos , Stephen Boyd Subject: Re: On trace_*_rcuidle functions in modules Message-ID: <20200415131200.GW17661@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200415025748.GV17661@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 14, 2020 at 08:47:18PM -0700, John Stultz wrote: > On Tue, Apr 14, 2020 at 7:57 PM Paul E. McKenney wrote: > > > > On Tue, Apr 14, 2020 at 07:20:01PM -0700, John Stultz wrote: > > > Hey folks, > > > So recently I was looking at converting some drivers to be loadable > > > modules instead of built-in only, and one of my patches just landed in > > > -next and started getting build error reports. > > > > > > It ends up, recently in the merge window, the driver I was converting > > > to module switched a trace_*() function to trace_*_rcuidle() to fix a > > > bug. Now when building as a module, if tracing is configured on, it > > > can't seem to find the trace_*_rcuidle() symbol. > > > > > > This is because, as you are aware, we don't declare trace_*_rcuidle > > > functions in modules - and haven't for quite some time: > > > https://lore.kernel.org/lkml/20120905062306.GA14756@leaf/ > > > > > > I wanted to better understand the background rationale for that patch, > > > to understand if not exporting the rcu_idle_exit and rcu_idle_enter, > > > calls was because they weren't used or if it was a more intentional > > > decision to avoid allowing modules to use them. > > > > > > Would it be reasonable to revisit that patch? Or is there some > > > recommended alternative solution? > > > > I will defer to Steven and Josh on the rationale. (Cowardly of me, > > I know!) > > > > What I do is to maintain a wrapper for tracepoints within a built-in > > portion of RCU, export the wrapper, and invoke the wrapper from the > > rcutorture module. Maybe you can do something similar? > > That feels a little hackish, but I guess if there isn't a better option... It is just rcutorture, so I am not going to claim that I put a huge amount of energy into researching better options. ;-) > > But why would a module be invoked from the idle loop? Is the module > > supplying an idle driver or some such? > > The driver (qcom rpmh driver) registers a cpu_pm notifier callback, > which gets called when entering idle. That would do it! And yes, the idle-loop power-management code is in an interesting situation in that RCU is not watching it by default, but it does need to be debugged. One straightforward approach would be for the PM code to tell RCU to watch on entry and exit, but I don't have a feel for how this would affect energy efficiency. Thanx, Paul