From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759265AbcEFXoG (ORCPT ); Fri, 6 May 2016 19:44:06 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:48159 "HELO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756722AbcEFXoD (ORCPT ); Fri, 6 May 2016 19:44:03 -0400 From: "Rafael J. Wysocki" To: Linux PM list Cc: Srinivas Pandruvada , Linux Kernel Mailing List Subject: [PATCH 2/3] intel_pstate: Use sample.core_avg_perf in get_avg_pstate() Date: Sat, 07 May 2016 01:45:37 +0200 Message-ID: <1500006.fx2d5NQrW2@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.5.0-rc1+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <2638272.Bq3MnQEe4U@vostro.rjw.lan> References: <2638272.Bq3MnQEe4U@vostro.rjw.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki 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 --- drivers/cpufreq/intel_pstate.c | 3 +-- 1 file changed, 1 insertion(+), 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 @@ -1201,8 +1201,7 @@ 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 fp_toint(cpu->pstate.max_pstate_physical * cpu->sample.core_avg_perf); } static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu)