WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCH] 3/3 [retry 1] Add support for AMD MPERF/APERF

To: Mark Langsdorf <mark.langsdorf@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "osrc-patches@xxxxxxxxxxxx" <osrc-patches@xxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] 3/3 [retry 1] Add support for AMD MPERF/APERF
From: "Yu, Ke" <ke.yu@xxxxxxxxx>
Date: Tue, 30 Mar 2010 17:16:51 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: Tue, 30 Mar 2010 02:18:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <201003291328.36113.mark.langsdorf@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <201003291328.36113.mark.langsdorf@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcrPbgvIfHvPHfBvSoCnTljIUtLapAAdkESQ
Thread-topic: [Xen-devel] [PATCH] 3/3 [retry 1] Add support for AMD MPERF/APERF
> -----Original Message-----
> From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx [mailto:xen-devel-
> bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Mark Langsdorf
> Sent: Tuesday, March 30, 2010 2:29 AM
> To: xen-devel@xxxxxxxxxxxxxxxxxxx; osrc-patches@xxxxxxxxxxxx
> Subject: [Xen-devel] [PATCH] 3/3 [retry 1] Add support for AMD
> MPERF/APERF
> 
> # HG changeset patch
> # User mark.langsdorf@xxxxxxx
> # Date 1269570377 18000
> # Node ID 4009c47dfed487f0432b7cbe3b5bac2f805ada73
> # Parent  d7401eeeac32a315aa9228d012dea2e78052120d
> Starting with Family 0x10, model 10 processors, some AMD processors
> will have support for the APERF/MPERF MSRs.  This patch adds the
> checks necessary to support those MSRs.
> 
> It also makes the get_measured_perf function defined inside cpufreq.c
> driver independent.  The max_freq is passed to the function by the caller
> instead of being taking from the acpi-cpufreq only drv_data structure.
> 
> This patch supersedes the patch "Add APERF/MPERF support for AMD
> processors"
> I sent on March 1, 2010.
> 
> Signed-off-by: Mark Langsdorf <mark.langsdorf@xxxxxxx>
> 
> diff -r d7401eeeac32 -r 4009c47dfed4 xen/arch/x86/acpi/cpufreq/cpufreq.c
> --- a/xen/arch/x86/acpi/cpufreq/cpufreq.c     Thu Mar 25 13:02:43 2010 -0500
> +++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c     Thu Mar 25 21:26:17
> 2010 -0500
> @@ -269,7 +269,7 @@
>   * Only IA32_APERF/IA32_MPERF ratio is architecturally defined and
>   * no meaning should be associated with absolute values of these MSRs.
>   */
> -static unsigned int get_measured_perf(unsigned int cpu, unsigned int flag)
> +unsigned int get_measured_perf(unsigned int cpu, unsigned int flag,
> unsigned
> int max_freq)
>  {
>      struct cpufreq_policy *policy;
>      struct perf_pair readin, cur, *saved;
> @@ -353,7 +353,7 @@
> 
>  #endif
> 
> -    retval = drv_data[policy->cpu]->max_freq * perf_percent / 100;
> +    retval = max_freq * perf_percent / 100;
> 
>      return retval;
>  }

Changing the get_measured_perf interface definition looks not good idea.  
Leaving interface unchanged and modifying the implementation is more reasonable 
to me, e.g. 

-    retval = drv_data[policy->cpu]->max_freq * perf_percent / 100;
+    retval = policy->cpuinfo.max_freq * perf_percent / 100;

Best Regards
Ke

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>