RE: [PATCH 3/6 v4] cpufreq: tolerate inexact values when collecting stats
From: Mark Langsdorf <hidden>
Date: 2012-11-13 19:26:39
Also in:
lkml
From: Mark Langsdorf <hidden>
Date: 2012-11-13 19:26:39
Also in:
lkml
From: linux-pm-owner@vger.kernel.org [linux-pm-owner@vger.kernel.org] On Behalf Of Mark Langsdorf [mark.langsdorf@calxeda.com]
On 11/13/2012 10:24 AM, Borislav Petkov wrote:quoted
On Mon, Nov 12, 2012 at 10:35:49AM -0600, Mark Langsdorf wrote:quoted
The function is buried pretty deep in the cpufreq_stat code. It didn't seem appropriate to make it a function pointer as part of struct cpufreq_driver.Better yet, add a flag or a bitfield called "minimize_jitter" or similar and set it only on your hardware...Doing it in two passes has a similar effect: systems that have exact frequencies will get caught in the first pass when the values match. But adding a flag makes sense.
I went back and looked at implementing this suggestion. Although cpufreq_driver has a flag field, no part of cpufreq_driver is directly passed to the cpufreq_stat code. Only cpufreq_policy is. It's cleaner to do passes of the while loop than to copy the cpufreq_driver.flag field into cpufreq_policy and then store it again in cpufreq_stats. --Mark Langsdorf Calxeda, Inc.