From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2807C433EF for ; Mon, 9 Sep 2019 02:37:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A598B2067B for ; Mon, 9 Sep 2019 02:37:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733116AbfIIChc (ORCPT ); Sun, 8 Sep 2019 22:37:32 -0400 Received: from mx2.suse.de ([195.135.220.15]:54660 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731928AbfIIChc (ORCPT ); Sun, 8 Sep 2019 22:37:32 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4B818AF25; Mon, 9 Sep 2019 02:37:30 +0000 (UTC) From: Giovanni Gherdovich To: srinivas.pandruvada@linux.intel.com, tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org, bp@suse.de, lenb@kernel.org, rjw@rjwysocki.net Cc: x86@kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, mgorman@techsingularity.net, matt@codeblueprint.co.uk, viresh.kumar@linaro.org, juri.lelli@redhat.com, pjt@google.com, vincent.guittot@linaro.org, qperret@qperret.net, dietmar.eggemann@arm.com, Giovanni Gherdovich Subject: [PATCH 2/2] cpufreq: intel_pstate: Conditional frequency invariant accounting Date: Mon, 9 Sep 2019 04:42:16 +0200 Message-Id: <20190909024216.5942-3-ggherdovich@suse.cz> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190909024216.5942-1-ggherdovich@suse.cz> References: <20190909024216.5942-1-ggherdovich@suse.cz> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Pandruvada From: Srinivas Pandruvada intel_pstate has two operating modes: active and passive. In "active" mode, the in-built scaling governor is used and in "passive" mode, the driver can be used with any governor like "schedutil". In "active" mode the utilization values from schedutil is not used and there is a requirement from high performance computing use cases, not to read any APERF/MPERF MSRs. In this case no need to use CPU cycles for frequency invariant accounting by reading APERF/MPERF MSRs. With this change frequency invariant account is only enabled in "passive" mode. Signed-off-by: Srinivas Pandruvada Signed-off-by: Giovanni Gherdovich --- drivers/cpufreq/intel_pstate.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index cc27d4c59dca..d55da8604d50 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2381,6 +2381,8 @@ static int intel_pstate_register_driver(struct cpufreq_driver *driver) { int ret; + x86_arch_scale_freq_tick_disable(); + memset(&global, 0, sizeof(global)); global.max_perf_pct = 100; @@ -2393,6 +2395,9 @@ static int intel_pstate_register_driver(struct cpufreq_driver *driver) global.min_perf_pct = min_perf_pct_min(); + if (driver == &intel_cpufreq) + x86_arch_scale_freq_tick_enable(); + return 0; } -- 2.16.4