Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965019AbdGTNss (ORCPT ); Thu, 20 Jul 2017 09:48:48 -0400 Received: from mga09.intel.com ([134.134.136.24]:61852 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934130AbdGTNsq (ORCPT ); Thu, 20 Jul 2017 09:48:46 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,384,1496127600"; d="scan'208";a="289291813" Subject: Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods To: Thomas Gleixner , "Li, Aubrey" References: <20170713182820.sn3fjitnd3mca27p@hirez.programming.kicks-ass.net> <31170ac6-9db1-f0b8-4841-f1661c8ed6e1@linux.intel.com> <20170714153818.pjauqxebxyhs6ljp@hirez.programming.kicks-ass.net> <20170714155356.GH3441@tassilo.jf.intel.com> <20170714160648.tg2u6eo2id6gmnjz@hirez.programming.kicks-ass.net> <20170714162619.GJ3441@tassilo.jf.intel.com> <20170717192309.ubn5muvc3u7htuaw@hirez.programming.kicks-ass.net> <34371ef8-b8bc-d2bf-93de-3fccd6beb032@linux.intel.com> <20170718044521.GO3441@tassilo.jf.intel.com> <20170718065926.GP3441@tassilo.jf.intel.com> <348019f4-85ae-ba91-3fce-9886533e8d22@linux.intel.com> <0c346d95-baae-715a-bff5-4738b924ccff@linux.intel.com> Cc: Andi Kleen , Peter Zijlstra , Frederic Weisbecker , Christoph Lameter , Aubrey Li , len.brown@intel.com, rjw@rjwysocki.net, tim.c.chen@linux.intel.com, paulmck@linux.vnet.ibm.com, yang.zhang.wz@gmail.com, x86@kernel.org, linux-kernel@vger.kernel.org, daniel.lezcano@linaro.org From: Arjan van de Ven Message-ID: <970eb7df-1a42-9ed7-a69d-58af8c206f7b@linux.intel.com> Date: Thu, 20 Jul 2017 06:48:41 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: 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 Content-Length: 1469 Lines: 40 On 7/20/2017 1:11 AM, Thomas Gleixner wrote: > On Thu, 20 Jul 2017, Li, Aubrey wrote: >> Don't get me wrong, even if a fast path is acceptable, we still need to >> figure out if the coming idle is short and when to switch. I'm just worried >> about if irq timings is not an ideal statistics, we have to skip it too. > > There is no ideal solution ever. > > Lets sit back and look at that from the big picture first before dismissing > a particular item upfront. > > The current NOHZ implementation does: > > predict = nohz_predict(timers, rcu, arch, irqwork); > > if ((predict - now) > X) > stop_tick() > > The C-State machinery does something like: > > predict = cstate_predict(next_timer, scheduler); > > cstate = cstate_select(predict); > > That disconnect is part of the problem. What we really want is: > > predict = idle_predict(timers, rcu, arch, irqwork, scheduler, irq timings); two separate predictors is clearly a recipe for badness. (likewise, C and P states try to estimate "performance sensitivity" and sometimes estimate in opposite directions) to be honest, performance sensitivity estimation is probably 10x more critical for C state selection than idle duration; a lot of modern hardware will do the energy efficiency stuff in a microcontroller when it coordinates between multiple cores in the system on C and P states. (both x86 and ARM have such microcontroller nowadays, at least for the higher performance designs)