Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4293655ybe; Mon, 9 Sep 2019 07:15:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaKV1/DwvlSCjmeGEunnksFuv8HBcOG7+y2ApWim1oLU9OGAEMCauWfQR9eppyXOfu17vw X-Received: by 2002:a05:6402:611:: with SMTP id n17mr24993931edv.33.1568038549340; Mon, 09 Sep 2019 07:15:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568038549; cv=none; d=google.com; s=arc-20160816; b=JBg6Thu7fTuU5CELbC9GIbqDYaKkL+VbynklHu2Xthli0AZR0itilh57wGagMKmYNT VsFoDpAU1chjozE2F4vjL4HU62Au/jsx/mu7c6an/RwD2tvb86M7HhYCFO/FH4t/fhWY OrTbrkU0EFabnExBjyo4MjVuFnmkZIT/RwlP0Fn/xpwR0f27sscaD9KmmNMdAjA076xX qvm/b9DmG5vCH1V1I3m9dbg0771zs5/C2YCfhYgdazF6D/ISNMYWD/j5lXNHZ9M6L+Uj lL97t6PW/+Ho7SASFIc9xfLLDP3LDbxC9dW9et8l3Lw2KNPFqkw5WFeNWrj7ooWh7bJz 4Rww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=khmhvw47QZOJkD0/Kujj3V0FpojVhwyDtLn7Eyj7Sfg=; b=J5A4edA4Gd/EsoKTJoozbZ+14tShY0jWPpFq1zaXqdAPa210O2RggfKA+3RIBgCMn+ +nE0MdOKygg3f5bGmvB8+Guo/rKxOtoQTwUezTwi8JVzB+l5lqoLH7LxqqWNARsDQbDP H30uxWZ/WEdmMR0d37A7Ww1yLO9JFyKk7aEa5g1nkQcOVJBEJQ/jkAw3CMruv9n4Hc53 Nu4UlrEoHWdG1IF5ucHAb3AwlCqaq5UMMMmEDPlgMPXzw87ScxepAY6SFTcsHNzhxCDX 7GfVC5i2xh/WO/ueqWtj4R3reVZIo33t4u+fdsSl41fidMS6pdcQ7l/1SK8vQF0f9d23 Exuw== 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 y19si9607452edc.363.2019.09.09.07.15.25; Mon, 09 Sep 2019 07:15: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 S1733097AbfIIChc (ORCPT + 99 others); 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