Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp766046imm; Wed, 11 Jul 2018 10:33:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdSW9koJT/4dZkpTjUd0KHgcLAiFjWUGQO0fc+uRSaGYlAQnsPiOfN9IsykIVYLG/hOo7JS X-Received: by 2002:a63:4703:: with SMTP id u3-v6mr20664859pga.405.1531330411467; Wed, 11 Jul 2018 10:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531330411; cv=none; d=google.com; s=arc-20160816; b=emVkXQQBtJdk7UxnIczikiCZN2lWEYl2Vc+lqTc3yHF3oN8p+V5RilQ/UJkgPUz0XJ VMNEXyeF5kgvPLM0rkV8WGZ6hPR/E6yeOPQ7VPv+4yWg15ZaUxDCYIvLYuzQrf0oD+W/ leKX7h7TxUcH778oq6/ArcqBXAejpcCtMI5bhDIDO+oWx/nfr4CRg75DAA5kmUCFkvJl 2cFqDf8jvz8w6H0cq43v0Wf45jQhQHji+4/HlPxY8RO/j8NR0RSvG+8V9TkB5p4zZo4v dwFUYr+RdDV2xEXEZEoN2PjRSSGk+Wu6xmFjSI253G0L0lmmdZfIQMhWZ00jxbHpFENP aiIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=44qY9p6Rjv04zSj576o5p+5DWcZ8ApcIoCPtK7//jUg=; b=0HGj6b8B01avBFovgHctJ/siVn3Sa3OGuA1eLmRBeqH5Wpk2OHmsaa4BgaKni71PiD pMTUpPSSfSWRMdbKfdx7/1VJDIRBTpkNW203RMciBgaCdhc2z+YixRNSwp5cIMRBs9fS VleXweR1WrJ/6+vLcyki0gqld/wPptse4oQn+P9oqhU6mNV1yOcb0kMBRvR63C/FX6NV GUY1gZgH+Z7+NfIQLxCgL6Bt7HmfsWG6Pm9VD8DKihbYgAgN+iTh2QFXsJXPTjr+/Qxf iMvE1TZNQg5GOlzNmdpWAE1DXoNTPBFVKL1CLIHV7wAj+eKE/opopk/4DO6nclEtTRPA voJQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10-v6si20674379pfb.316.2018.07.11.10.33.15; Wed, 11 Jul 2018 10:33:31 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388901AbeGKPSe (ORCPT + 99 others); Wed, 11 Jul 2018 11:18:34 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43414 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732409AbeGKPSe (ORCPT ); Wed, 11 Jul 2018 11:18:34 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6BF9OZR022714 for ; Wed, 11 Jul 2018 11:13:46 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2k5khq2bym-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 11 Jul 2018 11:13:46 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 11 Jul 2018 11:13:45 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 11 Jul 2018 11:13:41 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6BFDe121573336 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 11 Jul 2018 15:13:40 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3B283B2064; Wed, 11 Jul 2018 11:13:40 -0400 (EDT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 25404B206C; Wed, 11 Jul 2018 11:13:40 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.159]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 11 Jul 2018 11:13:40 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id C18B416C3B66; Wed, 11 Jul 2018 08:15:59 -0700 (PDT) Date: Wed, 11 Jul 2018 08:15:59 -0700 From: "Paul E. McKenney" To: Steven Rostedt 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 Reply-To: paulmck@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> <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.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18071115-0060-0000-0000-0000028A9601 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009351; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01059830; UDB=6.00543966; IPR=6.00837750; MB=3.00022103; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-11 15:13:45 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18071115-0061-0000-0000-000045C2B2E1 Message-Id: <20180711151559.GR3593@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-11_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807110163 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. Indeed, the rcu_dereference_sched() would catch it in that case, so agreed, Peter's suggestion isn't losing any debuggability. Thanx, Paul