Re: [PATCH 1/3] [cpufreq] [retry 1] Add APERF/MPERF support for AMDprocessors

From: Andrew Morton
Date: Thu Mar 04 2010 - 16:17:43 EST


On Wed, 3 Mar 2010 14:56:56 -0600
Mark Langsdorf <mark.langsdorf@xxxxxxx> wrote:

> +unsigned int get_measured_perf(struct cpufreq_policy *policy,
> + unsigned int cpu)
> +{
> + struct aperfmperf perf;
> + unsigned long ratio;
> + unsigned int retval;
> +
> + if (smp_call_function_single(cpu, read_measured_perf_ctrs, &perf, 1))
> + return 0;
> +
> + ratio = calc_aperfmperf_ratio(&per_cpu(acfreq_old_perf, cpu), &perf);
> + per_cpu(acfreq_old_perf, cpu) = perf;
> +
> + retval = (policy->cpuinfo.max_freq * ratio) >> APERFMPERF_SHIFT;
> +
> + return retval;
> +}
> +EXPORT_SYMBOL_GPL(get_measured_perf);

That's a pretty crappy name for a kernel-wide identifier.
cpufreq_get_measured_perf() would be typical and better.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/