From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751743AbdHGOBf (ORCPT ); Mon, 7 Aug 2017 10:01:35 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:56754 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750751AbdHGOBe (ORCPT ); Mon, 7 Aug 2017 10:01:34 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D399160241 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=neeraju@codeaurora.org Subject: Re: [PATCH] rcu: Fix up pending cbs check in rcu_prepare_for_idle To: paulmck@linux.vnet.ibm.com References: <1502085010-30316-1-git-send-email-neeraju@codeaurora.org> <20170807124052.GU3730@linux.vnet.ibm.com> Cc: josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, linux-kernel@vger.kernel.org From: Neeraj Upadhyay Message-ID: Date: Mon, 7 Aug 2017 19:31:27 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20170807124052.GU3730@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > > Thanx, Paul Hi Paul, found the issue while reading the code. > >> --- >> 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