From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753521AbcKYIh4 (ORCPT ); Fri, 25 Nov 2016 03:37:56 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58676 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753733AbcKYIfI (ORCPT ); Fri, 25 Nov 2016 03:35:08 -0500 Date: Fri, 25 Nov 2016 00:34:26 -0800 From: "Paul E. McKenney" To: Byungchul Park Cc: josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] rcu: Force resched_cpu when jiffies >= rcu_state.jiffies_resched Reply-To: paulmck@linux.vnet.ibm.com References: <1478673135-25509-1-git-send-email-byungchul.park@lge.com> <1478673135-25509-2-git-send-email-byungchul.park@lge.com> <20161122081220.GG2279@X58A-UD3R> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161122081220.GG2279@X58A-UD3R> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16112508-0004-0000-0000-000010F21394 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006138; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000193; SDB=6.00785215; UDB=6.00379407; IPR=6.00562794; BA=6.00004908; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013434; XFM=3.00000011; UTC=2016-11-25 08:34:28 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16112508-0005-0000-0000-00007AE1E0F5 Message-Id: <20161125083426.GC31360@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-25_01:,, 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-1611250153 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 22, 2016 at 05:12:20PM +0900, Byungchul Park wrote: > On Wed, Nov 09, 2016 at 03:32:15PM +0900, Byungchul Park wrote: > > Currently rcu code forces CPU into scheduler when jiffies >= > > rcu_state.gp_start + jiffies_till_sched_qs, via resched_cpu(). > > > > It would be better to force CPU into scheduler when jiffies >= > > rcu_state.jiffies_resched, too. > > Hello, > > I think these two patches are necessary to call resched_cpu() even in > case of jiffies >= rcu_state.jiffies_resched, too. Am I wrong? > > It would be appriciated if you let me know if I was wrong. My current thought is that both the "if" statement and the call to resched_cpu() should be removed, but I am still testing and working through the timing. Either way, I do very much appreciate your having called my attention to this code! Thanx, Paul > Thank you, > Byungchul > > > > > Signed-off-by: Byungchul Park > > --- > > kernel/rcu/tree.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > index d8e8859..287f468 100644 > > --- a/kernel/rcu/tree.c > > +++ b/kernel/rcu/tree.c > > @@ -1217,11 +1217,10 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp, > > READ_ONCE(*rcrmp) + rdp->rsp->flavor_mask); > > } > > rdp->rsp->jiffies_resched += 5; /* Re-enable beating. */ > > - } > > > > - /* And if it has been a really long time, kick the CPU as well. */ > > - if (ULONG_CMP_GE(jiffies, rdp->rsp->gp_start + jiffies_till_sched_qs)) > > + /* And if it has been a really long time, kick the CPU as well. */ > > resched_cpu(rdp->cpu); /* Force CPU into scheduler. */ > > + } > > > > return 0; > > } > > -- > > 1.9.1 >