From patchwork Tue Jul 17 16:14:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 10530095 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E118460247 for ; Tue, 17 Jul 2018 16:16:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C730929577 for ; Tue, 17 Jul 2018 16:16:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB21829578; Tue, 17 Jul 2018 16:16:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64E56294DF for ; Tue, 17 Jul 2018 16:16:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729677AbeGQQuC (ORCPT ); Tue, 17 Jul 2018 12:50:02 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:48852 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729640AbeGQQuC (ORCPT ); Tue, 17 Jul 2018 12:50:02 -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 d902f7ba3a093b45; Tue, 17 Jul 2018 18:16:36 +0200 From: "Rafael J. Wysocki" To: linux-pm@vger.kernel.org Cc: Andreas Herrmann , "Rafael J. Wysocki" , Peter Zijlstra , Frederic Weisbecker , Viresh Kumar , linux-kernel@vger.kernel.org Subject: [PATCH v2] cpufreq: pcc-cpufreq: Disable dynamic scaling on many-CPU systems Date: Tue, 17 Jul 2018 18:14:58 +0200 Message-ID: <5423012.ZZnfdYddaT@aspire.rjw.lan> In-Reply-To: <306375154.NhdH6AhdAd@aspire.rjw.lan> References: <20180717065048.74mmgk4t5utjaa6a@suselix> <306375154.NhdH6AhdAd@aspire.rjw.lan> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafael J. Wysocki The firmware interface used by the pcc-cpufreq driver is fundamentally not scalable and using it for dynamic CPU performance scaling on systems with many CPUs leads to degraded performance. For this reason, disable dynamic CPU performance scaling on systems with pcc-cpufreq where the number of CPUs present at the driver init time is greater than 4. Also make the driver print corresponding complaints to the kernel log. Reported-by: Andreas Herrmann Signed-off-by: Rafael J. Wysocki --- -> v2: Rework the messages printed in the problematic case. --- drivers/cpufreq/pcc-cpufreq.c | 9 +++++++++ 1 file changed, 9 insertions(+) Index: linux-pm/drivers/cpufreq/pcc-cpufreq.c =================================================================== --- linux-pm.orig/drivers/cpufreq/pcc-cpufreq.c +++ linux-pm/drivers/cpufreq/pcc-cpufreq.c @@ -589,6 +589,15 @@ static int __init pcc_cpufreq_init(void) return ret; } + if (num_present_cpus() > 4) { + pcc_cpufreq_driver.flags |= CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING; + pr_err("%s: Too many CPUs, dynamic performance scaling disabled\n", + __func__); + pr_err("%s: Try to enable a different scaling driver through BIOS settings\n", + __func__); + pr_err("%s: and complain to the system vendor\n", __func__); + } + ret = cpufreq_register_driver(&pcc_cpufreq_driver); return ret;