Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1507493imm; Tue, 15 May 2018 21:54:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrZb07uWpA7QU8Sh7O628zQ8BOisIFyhUC4L3+0cXQaXYk5iC5xz+7R+QFGZ5TNWiKCsQ9N X-Received: by 2002:a63:84c6:: with SMTP id k189-v6mr14177101pgd.298.1526446457527; Tue, 15 May 2018 21:54:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526446457; cv=none; d=google.com; s=arc-20160816; b=DAQa4cfXofNwEEfgYCO+hfO281JqBlDcDb8ka+fpof+kDKkY1jdn9Q0h7xq9ZJ0yqJ ZPQyKyJIAkqqXQE+h0bF3tRv6DcbMzXKgLFloGOrZ5IsuAKeFbaVwhhRt40iUIYYeQGP 6bxsYkeoB3tg8s/Tstbu+ubR4oSZ2fBcB9hL/JsmHyG6dcOESmuc8zhI7J8yema82Lse XUCIRYCe0QeUlG/G9FEjMR1dtaZzWOtGuWc9x4BZmfYvmf1TPPh9fLs+XEJrRjw33Fvx VSQhb88T7Ac7VBJbbhqs/A1hIIOpZBUfcQzFJWSlqs0RdMXxsipTr4pwT1KtYDxi14BX Envg== 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:arc-authentication-results; bh=VnavB2nqnb4RXy99B9ddh0du8HlA49klpM5/vd/oL3Y=; b=ZpebyngdqLruQ3Y4jZEsqodh2K+1CGi/Kq+WjPsa7B71mYUHnJwnQs9K6z3kfKolW8 9WOqSGz9LTuNKcNsWpZp4kLc/CFoRZT9HKfPl+1hWXvgriO+76tZsGgfR7eB0Ed696xi EB+bOf28lkWf9iBKhgeDbUHGSgQn46aOhxgRxwfvC7zt8jGunfoysUah722QnOm4IS33 xZM7oU8qigDn8PhijZeW37x1yx6lQGxSUtDkI7L3MtMcLgs5oqaR4RKo2Wu8k3bGPvou PkH2vJQOxE2y/ZosVkHxP1kvWlirnWCwWo4QSuM9Un4SVaI6ZV5L1MIzcGB06JArd9Tc Ysog== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s129-v6si1813406pfc.33.2018.05.15.21.54.03; Tue, 15 May 2018 21:54:17 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752272AbeEPEvR (ORCPT + 99 others); Wed, 16 May 2018 00:51:17 -0400 Received: from mga04.intel.com ([192.55.52.120]:1168 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751449AbeEPEtT (ORCPT ); Wed, 16 May 2018 00:49:19 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2018 21:49:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,404,1520924400"; d="scan'208";a="41300342" Received: from sunandaa-mobl.amr.corp.intel.com (HELO spandruv-mobl.jf.intel.com) ([10.252.135.192]) by orsmga007.jf.intel.com with ESMTP; 15 May 2018 21:49:18 -0700 From: Srinivas Pandruvada To: srinivas.pandruvada@linux.intel.com, tglx@linutronix.de, mingo@redhat.com, peterz@infradead.org, bp@suse.de, lenb@kernel.org, rjw@rjwysocki.net, mgorman@techsingularity.net Cc: x86@kernel.org, linux-pm@vger.kernel.org, viresh.kumar@linaro.org, juri.lelli@arm.com, linux-kernel@vger.kernel.org Subject: [RFC/RFT] [PATCH 02/10] cpufreq: intel_pstate: Conditional frequency invariant accounting Date: Tue, 15 May 2018 21:49:03 -0700 Message-Id: <20180516044911.28797-3-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180516044911.28797-1-srinivas.pandruvada@linux.intel.com> References: <20180516044911.28797-1-srinivas.pandruvada@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- [Note: The tick will be enabled later in the series when hwp dynamic boost is enabled] 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 17e566af..f686bbe 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -2040,6 +2040,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; @@ -2052,6 +2054,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.9.5