Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935117AbcKNSo3 (ORCPT ); Mon, 14 Nov 2016 13:44:29 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40702 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933715AbcKNSo1 (ORCPT ); Mon, 14 Nov 2016 13:44:27 -0500 Date: Mon, 14 Nov 2016 10:44:21 -0800 From: "Paul E. McKenney" To: Josh Triplett Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com, bobby.prani@gmail.com Subject: Re: [PATCH tip/core/rcu 5/7] torture: Trace long read-side delays Reply-To: paulmck@linux.vnet.ibm.com References: <20161114165648.GA15216@linux.vnet.ibm.com> <1479142633-15315-5-git-send-email-paulmck@linux.vnet.ibm.com> <20161114172110.yybjdk6p6754nlih@jtriplet-mobl2.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161114172110.yybjdk6p6754nlih@jtriplet-mobl2.jf.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16111418-0028-0000-0000-00000608D686 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006077; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000189; SDB=6.00780638; UDB=6.00376458; IPR=6.00558139; BA=6.00004878; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013322; XFM=3.00000011; UTC=2016-11-14 18:44:26 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16111418-0029-0000-0000-000030D72961 Message-Id: <20161114184421.GP4127@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-14_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611140369 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3324 Lines: 86 On Mon, Nov 14, 2016 at 09:21:10AM -0800, Josh Triplett wrote: > On Mon, Nov 14, 2016 at 08:57:11AM -0800, Paul E. McKenney wrote: > > Although rcutorture will occasionally do a 50-millisecond grace-period > > delay, these delays are quite rare. And rightly so, because otherwise > > the read rate would be quite low. Thie means that it can be important > > to identify whether or not a given run contained a long-delay read. > > This commit therefore inserts a trace_rcu_torture_read() event to flag > > runs containing long delays. > > > > Signed-off-by: Paul E. McKenney > > A couple of apparent typos below. With those fixed: > Reviewed-by: Josh Triplett > > > include/trace/events/rcu.h | 5 ++++- > > kernel/rcu/rcutorture.c | 11 ++++++++++- > > 2 files changed, 14 insertions(+), 2 deletions(-) > > > > diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h > > index d3e756539d44..b31e05bc8e26 100644 > > --- a/include/trace/events/rcu.h > > +++ b/include/trace/events/rcu.h > > @@ -698,7 +698,10 @@ TRACE_EVENT(rcu_batch_end, > > /* > > * Tracepoint for rcutorture readers. The first argument is the name > > * of the RCU flavor from rcutorture's viewpoint and the second argument > > - * is the callback address. > > + * is the callback address. The third callback is the start time in > > + * seconds, and the last two arguments are the grace period numbers > > + * and the beginning and end of the read, respectively. Note that the > > + * callback address can be NULL. > > s/third callback/third argument/? Good catch, fixed! > Also, s/and the beginning/of the beginning/? Let's see... "the last two arguments are the grace period numbers and the beginning and end of the read, respectively." -ENONSENSE for sure. I believe that the "and" needs to become "at" as follows: "the last two arguments are the grace period numbers at the beginning and end of the read, respectively." Does that help? Thanx, Paul > > TRACE_EVENT(rcu_torture_read, > > > > diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c > > index bf08fee53dc7..87c51225ceec 100644 > > --- a/kernel/rcu/rcutorture.c > > +++ b/kernel/rcu/rcutorture.c > > @@ -289,15 +289,24 @@ static int rcu_torture_read_lock(void) __acquires(RCU) > > > > static void rcu_read_delay(struct torture_random_state *rrsp) > > { > > + unsigned long started; > > + unsigned long completed; > > const unsigned long shortdelay_us = 200; > > const unsigned long longdelay_ms = 50; > > + unsigned long long ts; > > > > /* We want a short delay sometimes to make a reader delay the grace > > * period, and we want a long delay occasionally to trigger > > * force_quiescent_state. */ > > > > - if (!(torture_random(rrsp) % (nrealreaders * 2000 * longdelay_ms))) > > + if (!(torture_random(rrsp) % (nrealreaders * 2000 * longdelay_ms))) { > > + started = cur_ops->completed(); > > + ts = rcu_trace_clock_local(); > > mdelay(longdelay_ms); > > + completed = cur_ops->completed(); > > + do_trace_rcu_torture_read(cur_ops->name, NULL, ts, > > + started, completed); > > + } > > if (!(torture_random(rrsp) % (nrealreaders * 2 * shortdelay_us))) > > udelay(shortdelay_us); > > #ifdef CONFIG_PREEMPT > > -- > > 2.5.2 > > >