Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1196968imm; Wed, 11 Jul 2018 19:53:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpciJY+BVMEE2q44o0ExmXvGNgzWTl7+/S3lTKajsTnguSexTophpx6gRSoz4cZyFByuPS2G X-Received: by 2002:a63:1902:: with SMTP id z2-v6mr430125pgl.86.1531364016742; Wed, 11 Jul 2018 19:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531364016; cv=none; d=google.com; s=arc-20160816; b=KC4qEJyc9ctXy4XiYM30kd0ECc8XqLqui+3XM1Df6yHwBh62PEmFDCZAc0EEOqDmbr 7NFzgb+ZA068JxO+wqINcKsEUaseMKw5Y6QTxJsleZhbDmUY4a9di3nKbEZ7aNT+p8/u kzGbdcHZsTi8+Rtm/jlzOjn5ZiPCO0FXeSSZ9+871aWCPh9fQ4aPGkeKWgoEdtBQy/Jz kPv2PB0eKtl7jIgQamnD0j5sy5OrhO3bfeJnzesF6N5ggzR+Miq5sQgTyGIlOA9Zu6oy ZBrpKejchQlCa0mwgr2Ho+ROA2iYqXhR8xu6a7MDM1iA1cRktV+uhxGauLAQPXtexvv5 U90g== 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:arc-authentication-results; bh=yKIUC/FI2nnX1UG5YYDIuJ1BU6DtcutLnKI9FKrsbA4=; b=rzSOO7+WhCi6dfDaiPT54Rcx/PCmJh/UNbMIVO72U6NioSYgfPwNu8+Sh4OCamtsZc DGfl9PyE0SbGGALsCRynbMG6IUQSuaPqSPF8j4a5oAmGtPryEIY0YaxytXg9/KAxe8GD izecqiqUlk6M2Z7L0N8PK5yw42ChrOx2az3dzlgMY/Th81OVWhhYGXCpgb11BPGmwsRz vzbaeAdTmVutXtuZzV+INgDVZb9OFJUimVqtuOcKmh85FQgUc5mFT7rtazdIDNt/wfd2 h6T45wKUgAhMNUo0zWI64Z+mvKxtMkHLnOwG+TIi6q5KEvSlGfTju7UQVLBTwXoSGtly g3sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=Z66NBm3L; 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 x21-v6si4138341pll.24.2018.07.11.19.53.21; Wed, 11 Jul 2018 19:53:36 -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; dkim=pass header.i=@joelfernandes.org header.s=google header.b=Z66NBm3L; 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 S2388373AbeGKU67 (ORCPT + 99 others); Wed, 11 Jul 2018 16:58:59 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:45591 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726692AbeGKU67 (ORCPT ); Wed, 11 Jul 2018 16:58:59 -0400 Received: by mail-pl0-f66.google.com with SMTP id a17-v6so3825618plm.12 for ; Wed, 11 Jul 2018 13:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yKIUC/FI2nnX1UG5YYDIuJ1BU6DtcutLnKI9FKrsbA4=; b=Z66NBm3LZDuAveisRrScVnvU0EgJqBH11OjpCIvV+8oBhowV11pT8OcDA5yUAVHQU/ VhYgWH5kMzZgySeoCGseNAXXKNSjxy0x3eGx8deeU5J/mNrz1JR/Lf0KXAECCHZegcBO 3pViNAw2fZI4bYy70nOI29g8wP5DcXaO4jW2I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yKIUC/FI2nnX1UG5YYDIuJ1BU6DtcutLnKI9FKrsbA4=; b=oTaRS5wVAGgo+QBV0v0tCxKxWoguufDg7NDrAfIuRjjrjuvd781tLr+kqFqy26x4qR kzkkl+Xc4tzYmsvNErb2KjUQJ85pnRSYvbSXxMFUCA2N9WdDw5eobVLlFmCK6T+tw1tj q1aUu5jRWpcqRpZ5U7UBWkqSpHq4sQNRQXmZ4YWpAEuqpXYcihNCIAIVM57UGL6a4rND Qw5+XwXFf2zG3K2BbeoEK4l5x4iN1p75ogXSmfr7VYUY3dctEw6dcVN6y+RMK1cqNafI EThhH+lBi3lB6MxT5zd9g54rVk8G1pfJuErLAPSwU+LersJBb234BuVzndZhvXjFtaOY GQnw== X-Gm-Message-State: AOUpUlHnzc9jEpdDEoQcUfZQ67yhYndDQymzAzsSxvNwkEgzEJdTaPPy W7LdnUMmUVWLokxXgPJR1Mcqmg== X-Received: by 2002:a17:902:758c:: with SMTP id j12-v6mr156333pll.195.1531342370631; Wed, 11 Jul 2018 13:52:50 -0700 (PDT) Received: from localhost ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id x87-v6sm28256200pfa.143.2018.07.11.13.52.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jul 2018 13:52:50 -0700 (PDT) Date: Wed, 11 Jul 2018 13:52:49 -0700 From: Joel Fernandes To: Steven Rostedt Cc: "Paul E. McKenney" , Peter Zijlstra , 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: <20180711205249.GA32091@joelaf.mtv.corp.google.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> <20180711104618.05dc4b46@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180711104618.05dc4b46@gandalf.local.home> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 11, 2018 at 10:46:18AM -0400, Steven Rostedt wrote: > 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. Sounds good, I'm Ok with making this change. Just to clarify, are you proposing to change the rcu_dereference_sched to rcu_dereference_raw in both __DECLARE_TRACE and __DO_TRACE? thanks! - Joel