From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751684AbdG1BiT (ORCPT ); Thu, 27 Jul 2017 21:38:19 -0400 Received: from smtprelay0099.hostedemail.com ([216.40.44.99]:33492 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751610AbdG1BiS (ORCPT ); Thu, 27 Jul 2017 21:38:18 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3874:4250:4321:5007:6261:6742:7875:7901:8957:9010:9040:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12296:12438:12555:12740:12760:12895:13161:13229:13255:13439:14096:14097:14181:14659:14721:21080:21324:21627:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: trick64_82454676f1c27 X-Filterd-Recvd-Size: 3376 Date: Thu, 27 Jul 2017 21:38:10 -0400 From: Steven Rostedt To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com Subject: Re: [PATCH tip/core/rcu 07/15] rcu: Add event tracing to ->gp_tasks update at GP start Message-ID: <20170727213810.2a1c03d1@vmware.local.home> In-Reply-To: <1500932684-10469-7-git-send-email-paulmck@linux.vnet.ibm.com> References: <20170724214425.GA9665@linux.vnet.ibm.com> <1500932684-10469-7-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 24 Jul 2017 14:44:36 -0700 "Paul E. McKenney" wrote: > There is currently event tracing to track when a task is preempted > within a preemptible RCU read-side critical section, and also when that > task subsequently reaches its outermost rcu_read_unlock(), but none > indicating when a new grace period starts when that grace period must > wait on pre-existing readers that have been been preempted at least once > since the beginning of their current RCU read-side critical sections. > > This commit therefore adds an event trace at grace-period start in > the case where there are such readers. Note that only the first > reader in the list is traced. > > Signed-off-by: Paul E. McKenney > --- > kernel/rcu/tree_plugin.h | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h > index 14ba496a13cd..3e3f92e981a1 100644 > --- a/kernel/rcu/tree_plugin.h > +++ b/kernel/rcu/tree_plugin.h > @@ -636,10 +636,17 @@ static int rcu_print_task_exp_stall(struct rcu_node *rnp) > */ > static void rcu_preempt_check_blocked_tasks(struct rcu_node *rnp) > { > + struct task_struct *t; > + > RCU_LOCKDEP_WARN(preemptible(), "rcu_preempt_check_blocked_tasks() invoked with preemption enabled!!!\n"); > WARN_ON_ONCE(rcu_preempt_blocked_readers_cgp(rnp)); > - if (rcu_preempt_has_tasks(rnp)) > + if (rcu_preempt_has_tasks(rnp)) { The only function of this if block is to fill the content of the trace event, correct? What about doing: if (trace_rcu_unlock_preempted_task_enabled() && rcu_preempt_has_tasks(rnp)) { instead? The trace_rcu_unlock_preempted_task_enabled() is a static branch (aka jump_label), which would make the above a constant branch when tracing is not enabled, and would keep this from adding any extra overhead. -- Steve > rnp->gp_tasks = rnp->blkd_tasks.next; > + t = container_of(rnp->gp_tasks, struct task_struct, > + rcu_node_entry); > + trace_rcu_unlock_preempted_task(TPS("rcu_preempt-GPS"), > + rnp->gpnum, t->pid); > + } > WARN_ON_ONCE(rnp->qsmask); > } >