Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753682AbdGLP6Y (ORCPT ); Wed, 12 Jul 2017 11:58:24 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:60811 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753541AbdGLP5L (ORCPT ); Wed, 12 Jul 2017 11:57:11 -0400 Date: Wed, 12 Jul 2017 08:56:51 -0700 From: "Paul E. McKenney" To: Peter Zijlstra Cc: Frederic Weisbecker , Christoph Lameter , "Li, Aubrey" , Andi Kleen , Aubrey Li , tglx@linutronix.de, len.brown@intel.com, rjw@rjwysocki.net, tim.c.chen@linux.intel.com, arjan@linux.intel.com, yang.zhang.wz@gmail.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods Reply-To: paulmck@linux.vnet.ibm.com References: <20170710084647.zs6wkl3fumszd33g@hirez.programming.kicks-ass.net> <20170710144609.GD31832@tassilo.jf.intel.com> <20170710164206.5aon5kelbisxqyxq@hirez.programming.kicks-ass.net> <20170710172705.GA3441@tassilo.jf.intel.com> <20170711094157.5xcwkloxnjehieqv@hirez.programming.kicks-ass.net> <20170711160926.GA18805@lerouge> <20170711163422.etydkhhtgfthpfi5@hirez.programming.kicks-ass.net> <20170711180931.GP2393@linux.vnet.ibm.com> <20170712115451.xxz3jkau7ape76n5@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170712115451.xxz3jkau7ape76n5@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17071215-0056-0000-0000-000003A54CA8 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007355; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000214; SDB=6.00886558; UDB=6.00442553; IPR=6.00666707; BA=6.00005468; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016198; XFM=3.00000015; UTC=2017-07-12 15:56:56 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071215-0057-0000-0000-000007DB5996 Message-Id: <20170712155651.GX2393@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-12_05:,, 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-1707120251 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2358 Lines: 71 On Wed, Jul 12, 2017 at 01:54:51PM +0200, Peter Zijlstra wrote: > On Tue, Jul 11, 2017 at 11:09:31AM -0700, Paul E. McKenney wrote: > > On Tue, Jul 11, 2017 at 06:34:22PM +0200, Peter Zijlstra wrote: > > > > But I think we can at the very least do this; it only gets called from > > > kernel/sched/idle.c and both callsites have IRQs explicitly disabled by > > > that point. > > > > > > > > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > > index 51d4c3acf32d..dccf2dc8155a 100644 > > > --- a/kernel/rcu/tree.c > > > +++ b/kernel/rcu/tree.c > > > @@ -843,13 +843,8 @@ static void rcu_eqs_enter(bool user) > > > */ > > > void rcu_idle_enter(void) > > > { > > > - unsigned long flags; > > > - > > > - local_irq_save(flags); > > > > With this addition, I am all for it: > > > > RCU_LOCKDEP_WARN(!irqs_disabled(), "rcu_idle_enter() invoked with irqs enabled!!!"); > > > > If you are OK with this addition, may I please have your Signed-off-by? > > Sure, > > Signed-off-by: Peter Zijlstra (Intel) Very good, I have queued the patch below. I left out the removal of the export as I need to work out why the export was there. If it turns out not to be needed, I will remove the related ones as well. Fair enough? Thanx, Paul ------------------------------------------------------------------------ commit 95f3e587ce6388028a51f0c852800fca944e7032 Author: Peter Zijlstra (Intel) Date: Wed Jul 12 07:59:54 2017 -0700 rcu: Make rcu_idle_enter() rely on callers disabling irqs All callers to rcu_idle_enter() have irqs disabled, so there is no point in rcu_idle_enter disabling them again. This commit therefore replaces the irq disabling with a RCU_LOCKDEP_WARN(). Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Paul E. McKenney diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 6de6b1c5ee53..c78b076653ce 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -840,11 +840,8 @@ static void rcu_eqs_enter(bool user) */ void rcu_idle_enter(void) { - unsigned long flags; - - local_irq_save(flags); + RCU_LOCKDEP_WARN(!irqs_disabled(), "rcu_idle_enter() invoked with irqs enabled!!!"); rcu_eqs_enter(false); - local_irq_restore(flags); } EXPORT_SYMBOL_GPL(rcu_idle_enter);