Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751346AbdGQJVZ (ORCPT ); Mon, 17 Jul 2017 05:21:25 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:52109 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751178AbdGQJVY (ORCPT ); Mon, 17 Jul 2017 05:21:24 -0400 Date: Mon, 17 Jul 2017 11:21:11 +0200 From: Peter Zijlstra To: Andi Kleen Cc: Arjan van de Ven , "Li, Aubrey" , Frederic Weisbecker , Christoph Lameter , Aubrey Li , tglx@linutronix.de, 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 Subject: Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods Message-ID: <20170717092111.j3tisx6gwifckuhv@hirez.programming.kicks-ass.net> References: <20170713083649.febfflfl5hafkko5@hirez.programming.kicks-ass.net> <16e12e23-6b28-f174-7c4b-4d719225cd3b@linux.intel.com> <20170713145311.z4zxlyd2dospeoqg@hirez.programming.kicks-ass.net> <4a577bd6-20b1-abb6-2153-f9870f0a721e@linux.intel.com> <20170713182820.sn3fjitnd3mca27p@hirez.programming.kicks-ass.net> <31170ac6-9db1-f0b8-4841-f1661c8ed6e1@linux.intel.com> <20170714153818.pjauqxebxyhs6ljp@hirez.programming.kicks-ass.net> <3d2d06e2-a2ee-bcf7-7727-07f72de5d32d@linux.intel.com> <20170714155853.xvoyyzjg6l2ytqx7@hirez.programming.kicks-ass.net> <20170714160314.GI3441@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170714160314.GI3441@tassilo.jf.intel.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 756 Lines: 29 On Fri, Jul 14, 2017 at 09:03:14AM -0700, Andi Kleen wrote: > fast idle doesn't have an upper bound. > > If the prediction exceeds the fast idle threshold any C state can be used. > > It's just another state (fast C1), but right now it has an own threshold > which may be different from standard C1. Given it uses the same estimate we end up with: select_c_state(idle_est) { if (idle_est < fast_threshold) return C1; if (idle_est < C1_threshold) return C1; if (idle_est < C2_threshold) return C2; /* ... */ return C6 } Now, unless you're mister Turnbull, C2 will never get selected when fast_threshold > C2_threshold. Which is wrong. If you want to effectively scale the selection of C1, why not also change the C2 and further criteria.