From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751837AbdHGOLr (ORCPT ); Mon, 7 Aug 2017 10:11:47 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54893 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751399AbdHGOLq (ORCPT ); Mon, 7 Aug 2017 10:11:46 -0400 Date: Mon, 7 Aug 2017 07:09:39 -0700 From: "Paul E. McKenney" To: Neeraj Upadhyay Cc: josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcu: Fix up pending cbs check in rcu_prepare_for_idle Reply-To: paulmck@linux.vnet.ibm.com References: <1502085010-30316-1-git-send-email-neeraju@codeaurora.org> <20170807124052.GU3730@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17080714-2213-0000-0000-00000205DB21 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007501; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000217; SDB=6.00898876; UDB=6.00449861; IPR=6.00679082; BA=6.00005515; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016574; XFM=3.00000015; UTC=2017-08-07 14:09:39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17080714-2214-0000-0000-00005723B871 Message-Id: <20170807140939.GV3730@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-07_10:,, 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-1706020000 definitions=main-1708070237 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 07, 2017 at 07:31:27PM +0530, Neeraj Upadhyay wrote: > > > On 08/07/2017 06:10 PM, Paul E. McKenney wrote: > >On Mon, Aug 07, 2017 at 11:20:10AM +0530, Neeraj Upadhyay wrote: > >>Pending cbs check in rcu_prepare_for_idle is inversed > >>in the sense that, it should accelerate if there are > >>pending cbs; but, the check does the opposite. So, > >>fix it. > >> > >>Fixes: 15fecf89e46a ("srcu: Abstract multi-tail callback list handling") > >>Signed-off-by: Neeraj Upadhyay > >Good catch! Queued for review and testing. > > > >Just out of curiosity, how did you find this one? > > Hi Paul, found the issue while reading the code. Very good, and please feel free to continue reading and finding more bugs! ;-) Thanx, Paul > >>--- > >> kernel/rcu/tree_plugin.h | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >>diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h > >>index 908b309..b8f51df 100644 > >>--- a/kernel/rcu/tree_plugin.h > >>+++ b/kernel/rcu/tree_plugin.h > >>@@ -1493,7 +1493,7 @@ static void rcu_prepare_for_idle(void) > >> rdtp->last_accelerate = jiffies; > >> for_each_rcu_flavor(rsp) { > >> rdp = this_cpu_ptr(rsp->rda); > >>- if (rcu_segcblist_pend_cbs(&rdp->cblist)) > >>+ if (!rcu_segcblist_pend_cbs(&rdp->cblist)) > >> continue; > >> rnp = rdp->mynode; > >> raw_spin_lock_rcu_node(rnp); /* irqs already disabled. */ > >>-- > >>QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a > >>member of the Code Aurora Forum, hosted by The Linux Foundation > >> > > -- > QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a > member of the Code Aurora Forum, hosted by The Linux Foundation >