Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3340378imm; Tue, 17 Jul 2018 03:11:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdR//3J0oOaj+HCYVfUN/Xt67fQQ4RiYkZA/wm5qj8DXSQlv7N4pAnZxY7+/2KFJbRvFkdw X-Received: by 2002:a63:bd51:: with SMTP id d17-v6mr1040055pgp.42.1531822309812; Tue, 17 Jul 2018 03:11:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531822309; cv=none; d=google.com; s=arc-20160816; b=B9mzFoFDNoUKxgq0lpY5AdTrHCH9loCedyrCJ13EbcKd4uvSteSfxP/U2STgdMENOL GMFqnMbcVIZvbgPFXDeENHVSBP39nyD4r0JcmnRSCOsXYu0f2C8bZ9dyLhgdrAsnUH6l 95JfyWSWsz7uU1sF0RivdwB5SJG0jnMlcacZZXUG3chmcCv7qrimgLrQ6l7HEPWNTMva W49gI1sHvyzIU/ORrJ45WB8AZ8z1jd4RKWtZcRozwnhOJnQXQT3lg8Wbs787B7Bu/QVf mxTaUHmkh9kIMM6MoPhOZN0HfiE+/O+AOG4jsuDEauhat5dOO7NjJnigkt6OuzYK52jx fLeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Rw7P251+FTTarp5RVwWUxMB2A7QilYaCPmAC1a3Sxi4=; b=M2zkZEIAYKYD3ZyvhEUAHU0piaR3g/XT9rfAITG5ZozBfBx34KaFgwOPaul0YfpOr8 1hfvIuWI1jZ9nFcD83iFcEtwNMJHcuZh8BIa6UlBs6uBTnfvO3p8o1akvqaMv9uSO8Bg 2KOaYG3Qmi0N3+6CcBcoiztQkyL0VqVH5BiILO4UClVze3KaBBAAerspeOyKt6RLQfNh 7RaKwcGPwiH5szKPOThYlntStzkVpY8EV/4Av/llV5cMJXH2saR2PrYhS93yX3Q71++Y eOx6v2T6L8mK1PFUQBFCTjWoFfUa+miezAZMvOIt2rX+2cy0dn4WMw+bOxZ83zENPrIs Sy+g== 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 k84-v6si582949pfb.309.2018.07.17.03.11.34; Tue, 17 Jul 2018 03:11:49 -0700 (PDT) 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 S1730116AbeGQKmw (ORCPT + 99 others); Tue, 17 Jul 2018 06:42:52 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:42081 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729655AbeGQKmw (ORCPT ); Tue, 17 Jul 2018 06:42:52 -0400 Received: from 79.184.255.17.ipv4.supernova.orange.pl (79.184.255.17) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id 3eadf67fd58805f5; Tue, 17 Jul 2018 12:10:59 +0200 From: "Rafael J. Wysocki" To: Andreas Herrmann Cc: "Rafael J. Wysocki" , Peter Zijlstra , Frederic Weisbecker , Viresh Kumar , Linux PM , Linux Kernel Mailing List Subject: Re: Commit 554c8aa8ecad causing severe performance degression with pcc-cpufreq Date: Tue, 17 Jul 2018 12:09:21 +0200 Message-ID: <3724084.DyflrVPzDS@aspire.rjw.lan> In-Reply-To: <20180717093620.ym6phfmr3rfvsxyo@suselix> References: <20180717065048.74mmgk4t5utjaa6a@suselix> <20180717092721.onkaf3qsu7te6syi@suselix> <20180717093620.ym6phfmr3rfvsxyo@suselix> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, July 17, 2018 11:36:20 AM CEST Andreas Herrmann wrote: > On Tue, Jul 17, 2018 at 11:27:21AM +0200, Andreas Herrmann wrote: > > On Tue, Jul 17, 2018 at 11:23:25AM +0200, Rafael J. Wysocki wrote: > > > On Tue, Jul 17, 2018 at 11:11 AM, Andreas Herrmann wrote: > > > > On Tue, Jul 17, 2018 at 11:06:29AM +0200, Rafael J. Wysocki wrote: > > > >> On Tue, Jul 17, 2018 at 10:50 AM, Andreas Herrmann wrote: > > > >> > > > >> [cut] > > > >> > > > >> > > > > >> > On balance before this commit users could use pcc-cpufreq but had > > > >> > already suboptimal performance (compared to say intel_pstate driver > > > >> > which can be used changing BIOS options). > > > >> > > > >> BTW, I wonder why you need to change the BIOS options for intel_pstate to load. > > > > > > > > I think this is because of (in intel_pstate_init()): > > > > > > > > /* > > > > * The Intel pstate driver will be ignored if the platform > > > > * firmware has its own power management modes. > > > > */ > > > > if (intel_pstate_platform_pwr_mgmt_exists()) > > > > return -ENODEV; > > > > > > > > > > OK, because of the "Proliant" entry, right? > > > > > > So it looks like we have an issue there. We find the entry and we > > > look for _PSS. It is not there, so we assume that the firmware is > > > expected to control performance, which is not the case. > > FYI, there is another BIOS setting on those systems. It's called > "Collaborative Power Control" (AFAIK enabled by default). > > Only if this is disabled, firmware is (alone) in control of > performance. (And of course in this case neither pcc-cpufreq nor > intel_pstate will be loaded). OK, the patch is below. First, I hope that if "Collaborative Power Control" is disabled, it will simply hide the PCCH object and so intel_pstate will still not load then. The main question basically is what the OS is expected to do if "Dynamic Power Savings Mode" is set. If we are *expected* to use the PCC interface then, intel_pstate may not work in that case, but I suspect that the PCC interface allows extra energy to be saved over what is possible without it. --- drivers/cpufreq/intel_pstate.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) Index: linux-pm/drivers/cpufreq/intel_pstate.c =================================================================== --- linux-pm.orig/drivers/cpufreq/intel_pstate.c +++ linux-pm/drivers/cpufreq/intel_pstate.c @@ -2391,6 +2391,18 @@ static bool __init intel_pstate_no_acpi_ return true; } +static bool __init intel_pstate_no_acpi_pcch(void) +{ + acpi_status status; + acpi_handle handle; + + status = acpi_get_handle(NULL, "\\_SB", &handle); + if (ACPI_FAILURE(status)) + return true; + + return !acpi_has_method(handle, "PCCH"); +} + static bool __init intel_pstate_has_acpi_ppc(void) { int i; @@ -2450,7 +2462,10 @@ static bool __init intel_pstate_platform switch (plat_info[idx].data) { case PSS: - return intel_pstate_no_acpi_pss(); + if (!intel_pstate_no_acpi_pss()) + return false; + + return intel_pstate_no_acpi_pcch(); case PPC: return intel_pstate_has_acpi_ppc() && !force_load; }