Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3454633imb; Tue, 5 Mar 2019 09:41:57 -0800 (PST) X-Google-Smtp-Source: APXvYqy/roIR0tk8e3iGN1B3IAgrM0DB5TBqQ1gtZYLjlv0XmfJZKhUtBp0UUE495oH4OgyLBgWX X-Received: by 2002:a17:902:a508:: with SMTP id s8mr2267668plq.275.1551807717394; Tue, 05 Mar 2019 09:41:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551807717; cv=none; d=google.com; s=arc-20160816; b=Z8rRsI6xxRw6k78t5AKKDaC7Inunp3xItAOt6VbGVmsgfIPMv6r5+WohaaOizaudYe WNbfIduebr0O/tKDw3098v4zcHq/ndqPyMFxROwrosDskKTyc1uYkFcH9u4COEMBcsB4 Zr/vPhy2TjJ5MDV2JUI4UoaCuI60+FcBxSZ+fb11g7GEKM/+n9RMsWyKsNRhXHtANevk MHvo5vPapbjnMlMEb8027jVwKOmtJXKWSeJeup7WNdr/b01DRUyPZMBDsIXAVOuh1NkP tSrAMqhuBAH243HUYlxKPHZxfrDq8AMLou92L8BBUp2CXWz0NtgQNcFLnP7dvkq54XO8 th8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=8WvY0t1XJ9OvhhdqXWvzyGNBWX91BOQlPt7j18CW7Jk=; b=HF7QxZIl46E6h5Z/n9dLeV3oK61bBy2U2+qZ2RH2eBVsXn99o7qAYNSL7nkyE5Ua9/ GAYsJ6q0IinFRPvto0nK6uQGtG2gwH5iogsrNzKUNRrIJPZ5AUXrCMHtBtNf9U/cywXf SRiByHW5lJMiFae1nrH3/O6ulMBab61D5uA5EzMyH36zCU485cNEhdCcBh3z/luasneQ hzJ3YIpa8deZdbsfPRSqlP9I81PmXN+svDiG+0/c4ibozK/F5op6aigJeYG3HzXASf3e ut8/lQ6b8WFjpGNQi7+bNR9RtWEDICTe8YUjcYCoGllwpyJrxIT80Bz+HhZ43f/HkXpc xyCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1si8651118plo.371.2019.03.05.09.41.42; Tue, 05 Mar 2019 09:41:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726453AbfCERhx (ORCPT + 99 others); Tue, 5 Mar 2019 12:37:53 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:51386 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726131AbfCERhw (ORCPT ); Tue, 5 Mar 2019 12:37:52 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 02F49A78; Tue, 5 Mar 2019 09:37:52 -0800 (PST) Received: from queper01-lin (queper01-lin.cambridge.arm.com [10.1.195.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4E9263F703; Tue, 5 Mar 2019 09:37:50 -0800 (PST) Date: Tue, 5 Mar 2019 17:37:48 +0000 From: Quentin Perret To: "Rafael J. Wysocki" Cc: Peter Zijlstra , "Rafael J. Wysocki" , Linux PM , LKML , Viresh Kumar , Srinivas Pandruvada , Chen Yu , Gabriele Mazzotta Subject: Re: [RFT][Update][PATCH 2/2] cpufreq: intel_pstate: Update max CPU frequency on global turbo changes Message-ID: <20190305173746.p32xolcpueudlzwn@queper01-lin> References: <9956076.F4luUDm1Dq@aspire.rjw.lan> <20190305104256.7kvedlttuovmptpc@queper01-lin> <2336151.IZk3Z8DVvP@aspire.rjw.lan> <6357319.Iupbu3ldGQ@aspire.rjw.lan> <20190305114406.GV32494@hirez.programming.kicks-ass.net> <20190305120040.y2vmnxrch6kgya3e@queper01-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 05 Mar 2019 at 18:02:25 (+0100), Rafael J. Wysocki wrote: > But that 128 needs to be compared to > > (SCHED_CAPACITY_SCALE * cpuinfo.min_freq) / cpuinfo.max_freq > > so with SCHED_CAPACITY_SCALE equal to 1024 this means max_freq 8x > higher than min_freq. That is not totally unreasonable IMO and > because sg_cpu->iowait_boost grows exponentially, the difference > between 8x and, say, 4x is one iteration. > > > The first steps will all be below the min freq, so they'll just be > > transparent, while right now the iowait boost kicks in much faster :/ > > There can be one iteration of a difference this way or that way AFAICS > and I'm not even sure how much of a performance difference that makes > in practice. Yeah I don't expect that to have a huge impact TBH but it'd be nice to actually get numbers to verify that, that's all I'm saying :-) You have 'funny' platforms like Juno r0 out there where the min/max frequencies are 450MHz/850Mhz. In this case, starting from 128 you'll need 3 wake-ups to reach what is currently the starting point. I'm not sure if the impact is visible or not, but it's worth checking. > OTOH I fundamentally don't see why the iowait boost should ramp up > faster on CPUs having a higher max_freq to min_freq ratio. Say you > have two platforms, both with max_freq of 2 GHz and with min_freq > equal to 250 MHz and 500 MHz, respectively. The ratios in question > will be 8 and 4 then, so the first one will reliably react 50% slower > to iowait than the second one for no particular reason at all. > > > OTOH, you also have platforms like the recent Snapdragons with 30+ OPPs, > > and for them starting at 128 will speed things up. > > > > So maybe what you want is to start at max(min, 128) ? > > That's not just min, though, or is it? I'm not sure to get the question, so just to make sure it's clearer, I was suggesting to do something along the lines of: sg_cpu->min = max(min_freq * 1024 / max_freq, 128); That basically just prevents you from starting too low -- some boards, unlike juno, have tons of OPPs on the lower end of the curve so these might benefit from getting a higher starting point. But then perhaps this is in fact a good illustration of the issue of having different ramp-up speeds depending on the min_freq so ... :-) Thanks, Quentin