Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3444251imm; Tue, 17 Jul 2018 05:05:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcgMZVD8GKnNXsT2TBPCE7/ynhek3CABwpb3q0mTg0Mv6kyx961gR256ajdD2JB7/Z3c8a2 X-Received: by 2002:a63:9a01:: with SMTP id o1-v6mr1302388pge.439.1531829145995; Tue, 17 Jul 2018 05:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531829145; cv=none; d=google.com; s=arc-20160816; b=ccowujCq64Dg3qpcAm6+mlE+0198sXDSJlKw4tlAQ3Lyeov2ZPgmJriT92FwcFZqSq cHV/QXhcSSBd05cNpYCBNYPEQ2j5grupmCshpf8J3dxzYFd4ECLYlZZyQy1nZ2QTUQFO MYnIGwmcWZe3ZsdsA0I9MO0S71v9u10o5s2nMa2pVNaHC10vM0mTj8kTJJjFKMwyycsE rVZH8WMm6MfJBSzq7A8DersAoPiHDgoCUCwXN8YlaP5m1lnUUbcfpHVan9pWybJio35c IbwvemcJNkQijcLVevHaMrsInhphLv8umbCx+Vrc6qauaTxjXwtwOwedOsfz4b6xwMrp Pnvw== 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=83HQRCDKDZRrPPWWu7Gnl2kMNcTJL5HjTlbd41kGyK0=; b=zYnEi3R5kWM0t+/IAR6Bz2jyMffTIphEt+afriU4G+9RHGrPonmO1Ob3gdsTTrmUnK Oufs9aR7NR0EksPS+TagHaXlMNx4MID0qn4BjtOxHexlJ9ykNvJ5N9HHZXzm5EnzpauU WxLZS8jhWj2rmvsHAVYV+VDWb6h90YKB2RVQULSaaFgs5tldAwXMAQtGe6HhtjbSKC27 CWTOEOB7n3bBUeefj1utZUZio6LWB/JH43siKIZMjnhFA4uHLF7amgqPqnY1XnXj5HIz E8TTRBIA3pr6u5ZNBJNe4z/vyx4MHCWHAAq+5w+9wZUjowy+t5kTDDMKvHxj6o2DV1Q9 8szg== 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 t16-v6si619917pgu.487.2018.07.17.05.05.30; Tue, 17 Jul 2018 05:05:45 -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 S1731252AbeGQMg3 (ORCPT + 99 others); Tue, 17 Jul 2018 08:36:29 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:57191 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731179AbeGQMg2 (ORCPT ); Tue, 17 Jul 2018 08:36:28 -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 978821eeaaa6221c; Tue, 17 Jul 2018 14:04:07 +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] cpufreq: pcc-cpufreq: Disable dynamic scaling on many-CPU systems Date: Tue, 17 Jul 2018 14:02:29 +0200 Message-ID: <306375154.NhdH6AhdAd@aspire.rjw.lan> In-Reply-To: <20180717065048.74mmgk4t5utjaa6a@suselix> References: <20180717065048.74mmgk4t5utjaa6a@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 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 --- drivers/cpufreq/pcc-cpufreq.c | 8 ++++++++ 1 file changed, 8 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,14 @@ 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: Unsuitable system, dynamic performance scaling disabled\n", + __func__); + pr_err("%s: Change BIOS settings and complain to the hardware vendor\n", + __func__); + } + ret = cpufreq_register_driver(&pcc_cpufreq_driver); return ret;