Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1399368

[PATCH v2, 2/3] intel_pstate: Use sample.core_avg_perf in get_avg_pstate()

From "Rafael J. Wysocki" <rjw@rjwysocki.net>
Newsgroups linux.kernel
Subject [PATCH v2, 2/3] intel_pstate: Use sample.core_avg_perf in get_avg_pstate()
Date 2016-05-11 19:10 +0200
Message-ID <rxFO1-42S-1@gated-at.bofh.it> (permalink)
References <rvXFn-6JF-9@gated-at.bofh.it> <rxFO1-42S-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Notice that get_avg_pstate() can use sample.core_avg_perf instead of
carrying the same division again, so make it do that.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---

v1 -> v2: Use mul_ext_fp() to carry out the computation in get_avg_pstate().

---
 drivers/cpufreq/intel_pstate.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-pm/drivers/cpufreq/intel_pstate.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/intel_pstate.c
+++ linux-pm/drivers/cpufreq/intel_pstate.c
@@ -1213,8 +1213,8 @@ static inline int32_t get_avg_frequency(
 
 static inline int32_t get_avg_pstate(struct cpudata *cpu)
 {
-	return div64_u64(cpu->pstate.max_pstate_physical * cpu->sample.aperf,
-			 cpu->sample.mperf);
+	return mul_ext_fp(cpu->pstate.max_pstate_physical,
+			  cpu->sample.core_avg_perf);
 }
 
 static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] intel_pstate: Improvements related to the APERF/MPERF computation "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-05-07 01:50 +0200
  [PATCH v2, 2/3] intel_pstate: Use sample.core_avg_perf in get_avg_pstate() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-05-11 19:10 +0200
  [PATCH v2, 1/3] intel_pstate: Clarify average performance computation "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-05-11 19:10 +0200
  [PATCH v2, 0/3] intel_pstate: Improvements related to the APERF/MPERF computation "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-05-11 19:10 +0200
    [PATCH v2, 3/3] intel_pstate: Clean up get_target_pstate_use_performance() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-05-11 19:20 +0200

csiph-web