Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp944833imm; Wed, 11 Jul 2018 14:00:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfbb1WDECAfYPH+mebBLD7QtHysIjX8NKjyshZJVsb9v0UlTZvItxxFGTSu7TQ7UaooGpmB X-Received: by 2002:a17:902:4324:: with SMTP id i33-v6mr181039pld.43.1531342812687; Wed, 11 Jul 2018 14:00:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531342812; cv=none; d=google.com; s=arc-20160816; b=hI0FTvuAvSftm7q2F9xG1XO1f5wrO3CpAHn1ocdRWFR+CYQXP2+B+6q0W7CHAlvMAD 7DK2DdUD5zXWNk+x/3P7JaFFiv4h8mLSlw5zgeGab4/BDUCvK5UGAIXpWzRnDMvp2a/g VqK4LXtggLG6HjLsdzqPDfh8ZfH2yTiFm5QwDCebEBeYCcsXiYmfegJrWnCQ5QiinezN xoodaTc2qFKd0B2bD+7QN7AEQmnQxbZ/nyJ1bNKXzGmJO+ygnxk6gsQpi4n7E3QYngmi RwedoJ3ehmNjjeCv1kjaR/7Uprbnhxt6aaF8thhvJR0OoE9vp5UIj9vhY8DlYTnqqMGa oE1w== 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 :arc-authentication-results; bh=wMcxlAi9jq25dxYEX/sNBzkcomP34SAp8W00rRwcHd0=; b=MtsQ8x6i9BcNNe94aXNA0sTgIeKOaDpcsAeHMwDwe8+d5AzMrfUWJNNxWBz/JRg9UV IbyQcG7BeCPdJ2TC3rFrAKv7PCyT5p1Gx2VGgjN2sygjk+T/XXUEckyedqkVeDBUxc/F oHlHngY5VszCx8eK3aMMQicPmqQsyvl/uPrHItKPxYDpwsMu6xsJvytJNhxCRa+5z84v 2jwioUqsA0mMV20PDDS+h7CWVgld1dZXaMB+/IGBgYMODxEiZDQuDpi99qvjiGZ9mFD6 mkCBH/YbpagVT0vDR7IsTdVg6O3k/q5KP+QcGkPT2OYDRAT1HNARJoaIv2wj72YhihP9 uHhA== 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 e14-v6si7410027pgg.345.2018.07.11.13.59.57; Wed, 11 Jul 2018 14:00:12 -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; 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 S2388744AbeGKOvE (ORCPT + 99 others); Wed, 11 Jul 2018 10:51:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:42470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726689AbeGKOvD (ORCPT ); Wed, 11 Jul 2018 10:51:03 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.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 86B6420C0C; Wed, 11 Jul 2018 14:46:20 +0000 (UTC) Date: Wed, 11 Jul 2018 10:46:18 -0400 From: Steven Rostedt To: "Paul E. McKenney" Cc: Peter Zijlstra , Joel Fernandes , linux-kernel@vger.kernel.org, Boqun Feng , Byungchul Park , Ingo Molnar , Julia Cartwright , linux-kselftest@vger.kernel.org, Masami Hiramatsu , Mathieu Desnoyers , Namhyung Kim , Thomas Glexiner , Tom Zanussi Subject: Re: [PATCH v9 4/7] tracepoint: Make rcuidle tracepoint callers use SRCU Message-ID: <20180711104618.05dc4b46@gandalf.local.home> In-Reply-To: <20180711142744.GN3593@linux.vnet.ibm.com> References: <20180628182149.226164-1-joel@joelfernandes.org> <20180628182149.226164-5-joel@joelfernandes.org> <20180711124954.GE2476@hirez.programming.kicks-ass.net> <20180711090003.42596c2b@gandalf.local.home> <20180711142744.GN3593@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.16.0 (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 Wed, 11 Jul 2018 07:27:44 -0700 "Paul E. McKenney" wrote: > On Wed, Jul 11, 2018 at 09:00:03AM -0400, Steven Rostedt wrote: > > On Wed, 11 Jul 2018 14:49:54 +0200 > > Peter Zijlstra wrote: > > > > > On Thu, Jun 28, 2018 at 11:21:46AM -0700, Joel Fernandes wrote: > > > > - it_func_ptr = rcu_dereference_sched((tp)->funcs); \ > > > > > > I would convert to rcu_dereference_raw() to appease sparse. The fancy > > > stuff below is pointless if you then turn off all checking. > > > > The problem with doing this is if we use a trace event without the > > proper _idle() or whatever, we wont get a warning that it is used > > incorrectly with lockdep. Or does lockdep still check if "rcu is > > watching" with rcu_dereference_raw()? > > No lockdep checking is done by rcu_dereference_raw(). Correct, but I think we can do this regardless. So Joel please resend with Peter's suggestion. The reason being is because of this: #define __DECLARE_TRACE(name, proto, args, cond, data_proto, data_args) \ extern struct tracepoint __tracepoint_##name; \ static inline void trace_##name(proto) \ { \ if (static_key_false(&__tracepoint_##name.key)) \ __DO_TRACE(&__tracepoint_##name, \ TP_PROTO(data_proto), \ TP_ARGS(data_args), \ TP_CONDITION(cond), 0); \ if (IS_ENABLED(CONFIG_LOCKDEP) && (cond)) { \ rcu_read_lock_sched_notrace(); \ rcu_dereference_sched(__tracepoint_##name.funcs);\ rcu_read_unlock_sched_notrace(); \ } \ } Because lockdep would only trigger warnings when the tracepoint was enabled and used in a place it shouldn't be, we added the above IS_ENABLED(CONFIG_LOCKDEP) part to test regardless if the the tracepoint was enabled or not. Because we do this, we don't need to have the test in the __DO_TRACE() code itself. That means we can clean up the code as per Peter's suggestion. -- Steve