diff options
-rw-r--r-- | Documentation/cpu-freq/governors.txt | 10 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_conservative.c | 15 | ||||
-rw-r--r-- | drivers/cpufreq/cpufreq_ondemand.c | 17 |
3 files changed, 40 insertions, 2 deletions
diff --git a/Documentation/cpu-freq/governors.txt b/Documentation/cpu-freq/governors.txt index 5b0cfa67aff9..9b1851297d4e 100644 --- a/Documentation/cpu-freq/governors.txt +++ b/Documentation/cpu-freq/governors.txt | |||
@@ -119,8 +119,14 @@ want the kernel to look at the CPU usage and to make decisions on | |||
119 | what to do about the frequency. Typically this is set to values of | 119 | what to do about the frequency. Typically this is set to values of |
120 | around '10000' or more. | 120 | around '10000' or more. |
121 | 121 | ||
122 | show_sampling_rate_(min|max): the minimum and maximum sampling rates | 122 | show_sampling_rate_(min|max): THIS INTERFACE IS DEPRECATED, DON'T USE IT. |
123 | available that you may set 'sampling_rate' to. | 123 | You can use wider ranges now and the general |
124 | cpuinfo_transition_latency variable (cmp. with user-guide.txt) can be | ||
125 | used to obtain exactly the same info: | ||
126 | show_sampling_rate_min = transtition_latency * 500 / 1000 | ||
127 | show_sampling_rate_max = transtition_latency * 500000 / 1000 | ||
128 | (divided by 1000 is to illustrate that sampling rate is in us and | ||
129 | transition latency is exported ns). | ||
124 | 130 | ||
125 | up_threshold: defines what the average CPU usage between the samplings | 131 | up_threshold: defines what the average CPU usage between the samplings |
126 | of 'sampling_rate' needs to be for the kernel to make a decision on | 132 | of 'sampling_rate' needs to be for the kernel to make a decision on |
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index c6b3c6a02fc9..0912d7ca8cd7 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c | |||
@@ -140,11 +140,26 @@ static struct notifier_block dbs_cpufreq_notifier_block = { | |||
140 | /************************** sysfs interface ************************/ | 140 | /************************** sysfs interface ************************/ |
141 | static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf) | 141 | static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf) |
142 | { | 142 | { |
143 | static int print_once; | ||
144 | |||
145 | if (!print_once) { | ||
146 | printk(KERN_INFO "CPUFREQ: conservative sampling_rate_max " | ||
147 | "sysfs file is deprecated - used by: %s\n", | ||
148 | current->comm); | ||
149 | print_once = 1; | ||
150 | } | ||
143 | return sprintf(buf, "%u\n", MAX_SAMPLING_RATE); | 151 | return sprintf(buf, "%u\n", MAX_SAMPLING_RATE); |
144 | } | 152 | } |
145 | 153 | ||
146 | static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf) | 154 | static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf) |
147 | { | 155 | { |
156 | static int print_once; | ||
157 | |||
158 | if (!print_once) { | ||
159 | printk(KERN_INFO "CPUFREQ: conservative sampling_rate_max " | ||
160 | "sysfs file is deprecated - used by: %s\n", current->comm); | ||
161 | print_once = 1; | ||
162 | } | ||
148 | return sprintf(buf, "%u\n", MIN_SAMPLING_RATE); | 163 | return sprintf(buf, "%u\n", MIN_SAMPLING_RATE); |
149 | } | 164 | } |
150 | 165 | ||
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 1fa4420eb33c..32ddeaa42244 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/hrtimer.h> | 21 | #include <linux/hrtimer.h> |
22 | #include <linux/tick.h> | 22 | #include <linux/tick.h> |
23 | #include <linux/ktime.h> | 23 | #include <linux/ktime.h> |
24 | #include <linux/sched.h> | ||
24 | 25 | ||
25 | /* | 26 | /* |
26 | * dbs is used in this file as a shortform for demandbased switching | 27 | * dbs is used in this file as a shortform for demandbased switching |
@@ -203,11 +204,27 @@ static void ondemand_powersave_bias_init(void) | |||
203 | /************************** sysfs interface ************************/ | 204 | /************************** sysfs interface ************************/ |
204 | static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf) | 205 | static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf) |
205 | { | 206 | { |
207 | static int print_once; | ||
208 | |||
209 | if (!print_once) { | ||
210 | printk(KERN_INFO "CPUFREQ: ondemand sampling_rate_max " | ||
211 | "sysfs file is deprecated - used by: %s\n", | ||
212 | current->comm); | ||
213 | print_once = 1; | ||
214 | } | ||
206 | return sprintf(buf, "%u\n", MAX_SAMPLING_RATE); | 215 | return sprintf(buf, "%u\n", MAX_SAMPLING_RATE); |
207 | } | 216 | } |
208 | 217 | ||
209 | static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf) | 218 | static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf) |
210 | { | 219 | { |
220 | static int print_once; | ||
221 | |||
222 | if (!print_once) { | ||
223 | printk(KERN_INFO "CPUFREQ: ondemand sampling_rate_min " | ||
224 | "sysfs file is deprecated - used by: %s\n", | ||
225 | current->comm); | ||
226 | print_once = 1; | ||
227 | } | ||
211 | return sprintf(buf, "%u\n", MIN_SAMPLING_RATE); | 228 | return sprintf(buf, "%u\n", MIN_SAMPLING_RATE); |
212 | } | 229 | } |
213 | 230 | ||