Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1197087imm; Wed, 11 Jul 2018 19:53:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcLW3/Eoit4ltEaAOn6mUkI1vpN2I1qjeytYtHxMo16U13uCxD5VHN6gwpY3PNxAAKzGan/ X-Received: by 2002:a62:998:: with SMTP id 24-v6mr446133pfj.99.1531364030152; Wed, 11 Jul 2018 19:53:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531364030; cv=none; d=google.com; s=arc-20160816; b=nHPf1lakO775jJcgvrm+SKQXgheAZjT47hfGvPIXZZTkJ2i3qzddN091zmg5gMpqjl U7Jcd/4wq2ZkwGckEhgDg0sC14zaqNowyjYZKsRMqiDAPxhPI6RHnPnGf6jVdoW/JHor g8+ATkPoN0EpFYQsNceYjQX54yGyhIdfmgWhDMpd1X8TmOYEL+LFhj/TDXx8/5IF+p+g ZXSzN/MtDpJCbTyN0++7xxdPF74pJQE9xPmxKviNsIXBWfey8aKBpGU4KdYE2dDs1jO1 q4SwAwUcMt9/vMWJSjmbZbG6IGCMRFAOQhnbaTQKxhfhtVdkpXjDFrLTsXWi78zNlhWb Obzw== 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=sE2x50FFLciyvqRDFi5ub6kyQefdc0KUgqaTHlYnASY=; b=aGuL+Aj9A9amoUrsbiO5A77k+VJvdd83NyoixTTjeHoN2s/9qYSlkH8j00R0G5aJ6f hgi83CGmOG+F4gqhGXFIWMJQMnWUpDzfeLsEC5aaoPYjcw9r5TgaHvLLvWvCXF8EwoRm f7ilIs6Xg4UDyYGC7i8bwPFey6qgb6ArEDS8kNKOMMBqTDCsV0uTk1gLKz0tIqLnCv+e thCxYSRlxvop2uGEHr7SQ6kZ+IkDIdrPgErZ6IrT10YKxsMDYuzf99U6NB9lfo0SsUdh pfxFmuo3hI9YZyi3cS6x/FqnxEkLUKgMziGfr2BD4u5OvK92bp5RAcVgzPUniVLZn1yL awAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=yparj+AL; 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 c2-v6si18988471pge.124.2018.07.11.19.53.34; Wed, 11 Jul 2018 19:53:50 -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=yparj+AL; 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 S2388668AbeGKVCu (ORCPT + 99 others); Wed, 11 Jul 2018 17:02:50 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35820 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726611AbeGKVCu (ORCPT ); Wed, 11 Jul 2018 17:02:50 -0400 Received: by mail-pf0-f193.google.com with SMTP id q7-v6so18064977pff.2 for ; Wed, 11 Jul 2018 13:56:41 -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=sE2x50FFLciyvqRDFi5ub6kyQefdc0KUgqaTHlYnASY=; b=yparj+ALmTAHDRN5S3JtbbZh6JW4g5colb0AvqKLSSLqpK4iAQQ2Sx3iq9vM80R+Mo PZmBg71oQlwQmnfTRCEqnGUpd5376vKgmzKDciKQ2PVPITaM+taHbuzzYjR/UgmhiO9x Zn90Feyt4Z1xPsGS5BMsILox1AHD3DiM2mdLw= 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=sE2x50FFLciyvqRDFi5ub6kyQefdc0KUgqaTHlYnASY=; b=epOYySVOMCww4O1tqxSsadhWRfSfjbfdM+9r0yUvyiN1NRzEPHzF50pD0G2ZlI3vzE pUdWjXWKy0xdMt5UNhCC9sjVaQtedKg8z3xdRi44ZWQ88B4iSNQ62COp0mcnhr29oXS7 FIMOCLLj4D+KlYHdvNhj4glJhqn2tqK9htnPFJmHX7xfNrfi729QJKnE/FGItdi+3WcO FWzkLBKuXv6hGCzm+t6uTCdUCJIbz+KWR8PBuP5nWwxp7aWYHXJJeG1fETeL6CytyU+j nBtwAwzYbSFEGv10RY1y/RYIdHWlF8GuLHDPaIw9NDpTydjLO6dmmbL1anZRU4ya/WZ5 q9jA== X-Gm-Message-State: AOUpUlHOImcCoEytZqRMpDX2zHoc7QUhsWzFovFZOX8WnmsLUuhHDfMm eurAAeVAEzQc8QL8pmtnwl2YgQ== X-Received: by 2002:a63:1403:: with SMTP id u3-v6mr174570pgl.13.1531342600720; Wed, 11 Jul 2018 13:56:40 -0700 (PDT) Received: from localhost ([2620:0:1000:1600:3122:ea9c:d178:eb]) by smtp.gmail.com with ESMTPSA id e81-v6sm49976930pfb.62.2018.07.11.13.56.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jul 2018 13:56:40 -0700 (PDT) Date: Wed, 11 Jul 2018 13:56:39 -0700 From: Joel Fernandes To: "Paul E. McKenney" Cc: Steven Rostedt , 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: <20180711205639.GB32091@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> <20180711151559.GR3593@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180711151559.GR3593@linux.vnet.ibm.com> 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 08:15:59AM -0700, Paul E. McKenney wrote: > 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. > > Indeed, the rcu_dereference_sched() would catch it in that case, so > agreed, Peter's suggestion isn't losing any debuggability. Hmm, but if we are doing the check later anyway, then why not do it in __DO_TRACE itself? Also I guess we are discussing about changing the rcu_dereference_sched which I think should go into a separate patch since my patch isn't touching how the rcuidle==0 paths use the RCU API. So I think this is an existing issue independent of this series. thanks! - Joel