Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3726298imm; Tue, 17 Jul 2018 09:17:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdP8PePcsMTTBaAE0q31tsZlIkt80VhYUlGwa06JrNqJG2d8PBmagz3Kwl/hLnALlUSArY5 X-Received: by 2002:a62:569c:: with SMTP id h28-v6mr1311552pfj.201.1531844257027; Tue, 17 Jul 2018 09:17:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531844257; cv=none; d=google.com; s=arc-20160816; b=Q2NlICnbRS/Pqg59e2Pj6TADbx0LI7+OfsyuyUFVo+iHEpZ2elhnBB3w78qJHVF+fg NnGX2wP6t2+zKcVsdiP9mDrP+wxnHsnMW+tE99IZkkkUdo0u/Onfo+W38YeXnkYlAH/I VxacE0cd20jKlsys+ZZfsFJM8Egg0uVVq7MKz27JgUPnwg5NuqVx8KGJiaaPJj4jMLb7 XpSgDJiotUnYkRYfTRxOvtOpYiY7zv2qJVYNGtImWvh+LqQ5wSxpKLK1l/0ESjmm0t1f qU1DrLnMxWMP+E3c6sPPu1Ce5sdepEhGi/SQi5zg06Pr7Yn54jXtqLFl/7SrC6JbyA4K +9QQ== 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=cpcL1O2jb3SP7SwM14B38sRvX7TetP4bgahe4FHKhPU=; b=xaN+hmS3BpemNiO3VyRUzX/SeKz/icSvsClakndT8XKD/ItZgU38qNvdDzC/2AqFkG TX34iUiUT+YnRsT3DsVEGCu4jM1YFzxa3pXpCSl2y0gREOtmjz4rtNp47QcwnelrhMO2 Xw1UBXmDCA13tQy1oYobIVDpfgZcjf0Ptw7YmdBt3BssSMa6v6DXz37L9QCppHaPkCqc 8BYfC/Hw6yNuVAm45RyFZ/G5w/rCJI8qZr+vr0oXEEo8cxrLDjMLzK82QzGF/iB/NrOs nRahWGzqW2w0Ut5jLNiNxxMtOFlpen2V/TM4OXQ8qtvwIWQxZNhKh7xNQSGd9HUcP4ww p8MA== 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 f17-v6si1106814pgv.383.2018.07.17.09.17.21; Tue, 17 Jul 2018 09:17:36 -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 S1730238AbeGQQuC (ORCPT + 99 others); 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 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 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;