Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753740AbdGLSup (ORCPT ); Wed, 12 Jul 2017 14:50:45 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59424 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752279AbdGLSul (ORCPT ); Wed, 12 Jul 2017 14:50:41 -0400 Date: Wed, 12 Jul 2017 11:50:34 -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: <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> <20170712122249.u6y4ymmk6qwvog57@hirez.programming.kicks-ass.net> <20170712155458.GW2393@linux.vnet.ibm.com> <20170712171756.e3fnc3waanbaiiss@hirez.programming.kicks-ass.net> <20170712175732.hlhzc6g3aa47545d@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170712175732.hlhzc6g3aa47545d@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17071218-0048-0000-0000-000001C2787B X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007356; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000214; SDB=6.00886616; UDB=6.00442588; IPR=6.00666765; 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.00016200; XFM=3.00000015; UTC=2017-07-12 18:50:39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17071218-0049-0000-0000-000041DD2CD6 Message-Id: <20170712185034.GA2393@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-12_06:,, 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-1707120302 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1583 Lines: 32 On Wed, Jul 12, 2017 at 07:57:32PM +0200, Peter Zijlstra wrote: > On Wed, Jul 12, 2017 at 07:17:56PM +0200, Peter Zijlstra wrote: > > Could be I'm just not remembering how all that works.. But I was > > wondering if we can do the expensive bits if we've decided to actually > > go NOHZ and avoid doing it on every idle entry. > > > > IIRC the RCU fast NOHZ bits try and flush the callback list (or paw it > > off to another CPU?) such that we can go NOHZ sooner. Having a !empty > > callback list avoid NOHZ from happening. > > > > Now if we've already decided we can't in fact go NOHZ due to other > > concerns, flushing the callback list is pointless work. So I'm thinking > > we can find a better place to do this. > > I'm a wee bit confused by the split between rcu_prepare_for_idle() and > rcu_needs_cpu(). > > There's a fair amount overlap there.. that said, I'm thinking we should > be calling rcu_needs_cpu() as the very last test, not the very first, > such that we can bail out of tick_nohz_stop_sched_tick() without having > to incur the penalty of flushing callbacks. Maybe or maybe not, please see my earlier email for more details. TL;DR: No, callbacks are no longer flushed. Yes, there is dependency. Not hard to make rcu_prepare_for_idle() deal with rcu_needs_cpu() not having been called, but it does need to happen. Putting rcu_needs_cpu() last is not necessarily a good thing. If CPUs going idle normally don't have callbacks, it won't help. So we need hard evidence that rcu_needs_cpu() is consuming significant time before hacking. Thanx, Paul