Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3454177imb; Tue, 5 Mar 2019 09:41:18 -0800 (PST) X-Google-Smtp-Source: APXvYqzbl2yRsuvf2ePjcLqmpaTNbmHZsHtzyiX5Bs22WehUvNhqmZ5v9OLqKkKMATSJyrVmwjPG X-Received: by 2002:a62:f201:: with SMTP id m1mr2981863pfh.97.1551807678801; Tue, 05 Mar 2019 09:41:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551807678; cv=none; d=google.com; s=arc-20160816; b=U2ZUeF/jmiE7Nrg75SmTU0L3clcDNDFT6Ru2pip4qmpsDWEkTlsN2vOSCFb9YCCMlz L6xnwOB8CEF4glc4Up/rNi8jcS7aD9A5/6vkwNtYKk9n38WZBuqCs+TPZLEVuTb7JFLa FRgvF5oHVVszRDAdGXuAeLNWJs7TUyt1u1cNXs4fflc1en+cgRAfIuV6I130xbDmtN1c ClK/GP+BJbmKgUX1ySBpAqs5KKgFgvB8Y/JgKd3jWL13P8DqPUUSByY768lE13+R/1bA pFhdkUNvMa2817tUTyLOX4g7W0YiXHSTVxHBI8jyk12o4I7Iz2HBR91Qyl2v9RoWsCyS wblg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Tvr8polrrIwEJt+aU5d+gHKuaz0gHGZpVKpThry6+z0=; b=Q1LqHbwmXnprO62wLIYXRL0A8ZIk3OP1fr1d28YGtjj7jvu3/2BGbZYAcyH/3+QsIh jlCzV1+Lm2uSZqvEKdza3byA4Jd6+2MIgpMB5Qv/M6LY5MRkG7oTgXHQU05SK52QfJqw p6RwL+J8UeJ99v36B32oyg8GR5oIPizWvt2Wu6nrZeEveUKpFCdLaTWGrmvFNNjXY5Fr 3bN2PVgHWvcR59ji4KLToxfG23kha7EObS2186un7is6B2wQp4Bw2hKcEIIZqWupehLh HdP57Hw7fTAjpdcqWqMQQjVdPZ1iQdcrBoJsMQKDUUquxCsFx5z89RoFef+paFYMLltg pk6w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v12si7963399pgs.427.2019.03.05.09.41.03; Tue, 05 Mar 2019 09:41:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727448AbfCERCj (ORCPT + 99 others); Tue, 5 Mar 2019 12:02:39 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:45442 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbfCERCi (ORCPT ); Tue, 5 Mar 2019 12:02:38 -0500 Received: by mail-ot1-f67.google.com with SMTP id i12so8030002otp.12; Tue, 05 Mar 2019 09:02:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Tvr8polrrIwEJt+aU5d+gHKuaz0gHGZpVKpThry6+z0=; b=Gpo1i3JEZ49icwu0riowhJgjsvLIUHuAezG5LKZVcnfVqe6VyXzV5OHNuGUtgCVZuf QBA4gudbcb8lkO8GPDNxCSiAFsJkLeccHU7C9wdFMsrG7PjTn04N/k44eBdfvwjOzAmU nDSZi9DscSu9cy3zWJA4Sojlj4GYydsJpvKw4GQ+lYnH0nn56t6X3CRG7/7HqHTOLKJB vyCgy/TVOvn8y4h4xJ/9m2mcPBNYIdvMom22ve0MzWh6O4j97mwaOWLGHTqVsMeQEBWb zXhbNdSuUoLGOdG/9sHLxv/N2eJf+Om4RtwVUssHB4Clo2VDXtAPlvqLGkneYhaTiHXc kC0A== X-Gm-Message-State: APjAAAVQuKIgRthp7YR7zCHUlkyoU18tLMQ+MUcznHw9DqMvAwYNqMuL LoaI84z1+IQV08RVSrQkV9pLSsUr5NFs5TDTMYY= X-Received: by 2002:a9d:6498:: with SMTP id g24mr1570223otl.343.1551805357424; Tue, 05 Mar 2019 09:02:37 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: <20190305120040.y2vmnxrch6kgya3e@queper01-lin> From: "Rafael J. Wysocki" Date: Tue, 5 Mar 2019 18:02:25 +0100 Message-ID: Subject: Re: [RFT][Update][PATCH 2/2] cpufreq: intel_pstate: Update max CPU frequency on global turbo changes To: Quentin Perret Cc: Peter Zijlstra , "Rafael J. Wysocki" , Linux PM , LKML , Viresh Kumar , Srinivas Pandruvada , Chen Yu , Gabriele Mazzotta Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 5, 2019 at 1:00 PM Quentin Perret wrote: > > On Tuesday 05 Mar 2019 at 12:44:06 (+0100), Peter Zijlstra wrote: > > On Tue, Mar 05, 2019 at 11:58:37AM +0100, Rafael J. Wysocki wrote: > > > So after the Peter's patch "sched/cpufreq: Fix 32bit math overflow" > > > I will need to recompute sg_cpu->min in sugov_limits(). > > > > So there's still an open question; do we want that ->min thing to depend > > on available frequencies _at_all_ ? > > > > I'm thinking it might be a good thing to have the iowait boost curve be > > independent of all that. > > > > Like said; if we set it at 128 (static), it takes 9 consequtive wake-ups > > for it to reach 1024 (max). While now the curve depends on how wide the > > gap is between min_freq and max_freq. And it seems weird to have this > > behaviour depend on that. To me at least. > > I'm not conceptually against it, but that really wants testing I think. > I can already see how we're gonna see regressions: 128 is much lower > than 'min' on my juno for ex, so with the approach you suggest it's > gonna take several wake-up before the iowait stuff does anything at all. 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. 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?