Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
[CPUFREQ] pcc-cpufreq: remove duplicate statements
[CPUFREQ] Remove the pm_message_t argument from driver suspend
[CPUFREQ] Remove unneeded locks
[CPUFREQ] Remove old, deprecated per cpu ondemand/conservative sysfs files
[CPUFREQ] Remove deprecated sysfs file sampling_rate_max
[CPUFREQ] powernow-k8: The table index is not worth displaying
[CPUFREQ] calculate delay after dbs_check_cpu
[CPUFREQ] Add documentation for sampling_down_factor
[CPUFREQ] drivers/cpufreq: Remove unnecessary semicolons

+36 -248
+11
Documentation/cpu-freq/governors.txt
··· 158 takes to complete as you can 'nice' it and prevent it from taking part 159 in the deciding process of whether to increase your CPU frequency. 160 161 162 2.5 Conservative 163 ----------------
··· 158 takes to complete as you can 'nice' it and prevent it from taking part 159 in the deciding process of whether to increase your CPU frequency. 160 161 + sampling_down_factor: this parameter controls the rate at which the 162 + kernel makes a decision on when to decrease the frequency while running 163 + at top speed. When set to 1 (the default) decisions to reevaluate load 164 + are made at the same interval regardless of current clock speed. But 165 + when set to greater than 1 (e.g. 100) it acts as a multiplier for the 166 + scheduling interval for reevaluating load when the CPU is at its top 167 + speed due to high load. This improves performance by reducing the overhead 168 + of load evaluation and helping the CPU stay at its top speed when truly 169 + busy, rather than shifting back and forth in speed. This tunable has no 170 + effect on behavior at lower speeds/lower CPU loads. 171 + 172 173 2.5 Conservative 174 ----------------
+1 -2
arch/arm/mach-s5pv210/cpufreq.c
··· 390 } 391 392 #ifdef CONFIG_PM 393 - static int s5pv210_cpufreq_suspend(struct cpufreq_policy *policy, 394 - pm_message_t pmsg) 395 { 396 return 0; 397 }
··· 390 } 391 392 #ifdef CONFIG_PM 393 + static int s5pv210_cpufreq_suspend(struct cpufreq_policy *policy) 394 { 395 return 0; 396 }
+1 -2
arch/arm/mach-s5pv310/cpufreq.c
··· 458 } 459 460 #ifdef CONFIG_PM 461 - static int s5pv310_cpufreq_suspend(struct cpufreq_policy *policy, 462 - pm_message_t pmsg) 463 { 464 return 0; 465 }
··· 458 } 459 460 #ifdef CONFIG_PM 461 + static int s5pv310_cpufreq_suspend(struct cpufreq_policy *policy) 462 { 463 return 0; 464 }
+1 -1
arch/arm/plat-s3c24xx/cpu-freq.c
··· 433 static struct cpufreq_frequency_table suspend_pll; 434 static unsigned int suspend_freq; 435 436 - static int s3c_cpufreq_suspend(struct cpufreq_policy *policy, pm_message_t pmsg) 437 { 438 suspend_pll.frequency = clk_get_rate(_clk_mpll); 439 suspend_pll.index = __raw_readl(S3C2410_MPLLCON);
··· 433 static struct cpufreq_frequency_table suspend_pll; 434 static unsigned int suspend_freq; 435 436 + static int s3c_cpufreq_suspend(struct cpufreq_policy *policy) 437 { 438 suspend_pll.frequency = clk_get_rate(_clk_mpll); 439 suspend_pll.index = __raw_readl(S3C2410_MPLLCON);
+1 -1
arch/powerpc/platforms/powermac/cpufreq_32.c
··· 429 return offset; 430 } 431 432 - static int pmac_cpufreq_suspend(struct cpufreq_policy *policy, pm_message_t pmsg) 433 { 434 /* Ok, this could be made a bit smarter, but let's be robust for now. We 435 * always force a speed change to high speed before sleep, to make sure
··· 429 return offset; 430 } 431 432 + static int pmac_cpufreq_suspend(struct cpufreq_policy *policy) 433 { 434 /* Ok, this could be made a bit smarter, but let's be robust for now. We 435 * always force a speed change to high speed before sleep, to make sure
-2
arch/x86/kernel/cpu/cpufreq/pcc-cpufreq.c
··· 315 316 input.count = 4; 317 input.pointer = in_params; 318 - input.count = 4; 319 - input.pointer = in_params; 320 in_params[0].type = ACPI_TYPE_BUFFER; 321 in_params[0].buffer.length = 16; 322 in_params[0].buffer.pointer = OSC_UUID;
··· 315 316 input.count = 4; 317 input.pointer = in_params; 318 in_params[0].type = ACPI_TYPE_BUFFER; 319 in_params[0].buffer.length = 16; 320 in_params[0].buffer.pointer = OSC_UUID;
+1 -2
arch/x86/kernel/cpu/cpufreq/powernow-k8.c
··· 630 data->powernow_table[j].frequency/1000); 631 } else { 632 printk(KERN_INFO PFX 633 - " %d : fid 0x%x (%d MHz), vid 0x%x\n", 634 - j, 635 data->powernow_table[j].index & 0xff, 636 data->powernow_table[j].frequency/1000, 637 data->powernow_table[j].index >> 8);
··· 630 data->powernow_table[j].frequency/1000); 631 } else { 632 printk(KERN_INFO PFX 633 + "fid 0x%x (%d MHz), vid 0x%x\n", 634 data->powernow_table[j].index & 0xff, 635 data->powernow_table[j].frequency/1000, 636 data->powernow_table[j].index >> 8);
+1 -1
drivers/cpufreq/cpufreq.c
··· 1371 goto out; 1372 1373 if (cpufreq_driver->suspend) { 1374 - ret = cpufreq_driver->suspend(cpu_policy, pmsg); 1375 if (ret) 1376 printk(KERN_ERR "cpufreq: suspend failed in ->suspend " 1377 "step on CPU %u\n", cpu_policy->cpu);
··· 1371 goto out; 1372 1373 if (cpufreq_driver->suspend) { 1374 + ret = cpufreq_driver->suspend(cpu_policy); 1375 if (ret) 1376 printk(KERN_ERR "cpufreq: suspend failed in ->suspend " 1377 "step on CPU %u\n", cpu_policy->cpu);
+6 -117
drivers/cpufreq/cpufreq_conservative.c
··· 76 static unsigned int dbs_enable; /* number of CPUs using this policy */ 77 78 /* 79 - * dbs_mutex protects data in dbs_tuners_ins from concurrent changes on 80 - * different CPUs. It protects dbs_enable in governor start/stop. 81 */ 82 static DEFINE_MUTEX(dbs_mutex); 83 ··· 115 if (wall) 116 *wall = (cputime64_t)jiffies_to_usecs(cur_wall_time); 117 118 - return (cputime64_t)jiffies_to_usecs(idle_time);; 119 } 120 121 static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall) ··· 161 }; 162 163 /************************** sysfs interface ************************/ 164 - static ssize_t show_sampling_rate_max(struct kobject *kobj, 165 - struct attribute *attr, char *buf) 166 - { 167 - printk_once(KERN_INFO "CPUFREQ: conservative sampling_rate_max " 168 - "sysfs file is deprecated - used by: %s\n", current->comm); 169 - return sprintf(buf, "%u\n", -1U); 170 - } 171 - 172 static ssize_t show_sampling_rate_min(struct kobject *kobj, 173 struct attribute *attr, char *buf) 174 { 175 return sprintf(buf, "%u\n", min_sampling_rate); 176 } 177 178 - define_one_global_ro(sampling_rate_max); 179 define_one_global_ro(sampling_rate_min); 180 181 /* cpufreq_conservative Governor Tunables */ ··· 183 show_one(ignore_nice_load, ignore_nice); 184 show_one(freq_step, freq_step); 185 186 - /*** delete after deprecation time ***/ 187 - #define DEPRECATION_MSG(file_name) \ 188 - printk_once(KERN_INFO "CPUFREQ: Per core conservative sysfs " \ 189 - "interface is deprecated - " #file_name "\n"); 190 - 191 - #define show_one_old(file_name) \ 192 - static ssize_t show_##file_name##_old \ 193 - (struct cpufreq_policy *unused, char *buf) \ 194 - { \ 195 - printk_once(KERN_INFO "CPUFREQ: Per core conservative sysfs " \ 196 - "interface is deprecated - " #file_name "\n"); \ 197 - return show_##file_name(NULL, NULL, buf); \ 198 - } 199 - show_one_old(sampling_rate); 200 - show_one_old(sampling_down_factor); 201 - show_one_old(up_threshold); 202 - show_one_old(down_threshold); 203 - show_one_old(ignore_nice_load); 204 - show_one_old(freq_step); 205 - show_one_old(sampling_rate_min); 206 - show_one_old(sampling_rate_max); 207 - 208 - cpufreq_freq_attr_ro_old(sampling_rate_min); 209 - cpufreq_freq_attr_ro_old(sampling_rate_max); 210 - 211 - /*** delete after deprecation time ***/ 212 - 213 static ssize_t store_sampling_down_factor(struct kobject *a, 214 struct attribute *b, 215 const char *buf, size_t count) ··· 194 if (ret != 1 || input > MAX_SAMPLING_DOWN_FACTOR || input < 1) 195 return -EINVAL; 196 197 - mutex_lock(&dbs_mutex); 198 dbs_tuners_ins.sampling_down_factor = input; 199 - mutex_unlock(&dbs_mutex); 200 - 201 return count; 202 } 203 ··· 208 if (ret != 1) 209 return -EINVAL; 210 211 - mutex_lock(&dbs_mutex); 212 dbs_tuners_ins.sampling_rate = max(input, min_sampling_rate); 213 - mutex_unlock(&dbs_mutex); 214 - 215 return count; 216 } 217 ··· 219 int ret; 220 ret = sscanf(buf, "%u", &input); 221 222 - mutex_lock(&dbs_mutex); 223 if (ret != 1 || input > 100 || 224 - input <= dbs_tuners_ins.down_threshold) { 225 - mutex_unlock(&dbs_mutex); 226 return -EINVAL; 227 - } 228 229 dbs_tuners_ins.up_threshold = input; 230 - mutex_unlock(&dbs_mutex); 231 - 232 return count; 233 } 234 ··· 234 int ret; 235 ret = sscanf(buf, "%u", &input); 236 237 - mutex_lock(&dbs_mutex); 238 /* cannot be lower than 11 otherwise freq will not fall */ 239 if (ret != 1 || input < 11 || input > 100 || 240 - input >= dbs_tuners_ins.up_threshold) { 241 - mutex_unlock(&dbs_mutex); 242 return -EINVAL; 243 - } 244 245 dbs_tuners_ins.down_threshold = input; 246 - mutex_unlock(&dbs_mutex); 247 - 248 return count; 249 } 250 ··· 258 if (input > 1) 259 input = 1; 260 261 - mutex_lock(&dbs_mutex); 262 - if (input == dbs_tuners_ins.ignore_nice) { /* nothing to do */ 263 - mutex_unlock(&dbs_mutex); 264 return count; 265 - } 266 dbs_tuners_ins.ignore_nice = input; 267 268 /* we need to re-evaluate prev_cpu_idle */ ··· 272 if (dbs_tuners_ins.ignore_nice) 273 dbs_info->prev_cpu_nice = kstat_cpu(j).cpustat.nice; 274 } 275 - mutex_unlock(&dbs_mutex); 276 - 277 return count; 278 } 279 ··· 290 291 /* no need to test here if freq_step is zero as the user might actually 292 * want this, they would be crazy though :) */ 293 - mutex_lock(&dbs_mutex); 294 dbs_tuners_ins.freq_step = input; 295 - mutex_unlock(&dbs_mutex); 296 - 297 return count; 298 } 299 ··· 302 define_one_global_rw(freq_step); 303 304 static struct attribute *dbs_attributes[] = { 305 - &sampling_rate_max.attr, 306 &sampling_rate_min.attr, 307 &sampling_rate.attr, 308 &sampling_down_factor.attr, ··· 316 .attrs = dbs_attributes, 317 .name = "conservative", 318 }; 319 - 320 - /*** delete after deprecation time ***/ 321 - 322 - #define write_one_old(file_name) \ 323 - static ssize_t store_##file_name##_old \ 324 - (struct cpufreq_policy *unused, const char *buf, size_t count) \ 325 - { \ 326 - printk_once(KERN_INFO "CPUFREQ: Per core conservative sysfs " \ 327 - "interface is deprecated - " #file_name "\n"); \ 328 - return store_##file_name(NULL, NULL, buf, count); \ 329 - } 330 - write_one_old(sampling_rate); 331 - write_one_old(sampling_down_factor); 332 - write_one_old(up_threshold); 333 - write_one_old(down_threshold); 334 - write_one_old(ignore_nice_load); 335 - write_one_old(freq_step); 336 - 337 - cpufreq_freq_attr_rw_old(sampling_rate); 338 - cpufreq_freq_attr_rw_old(sampling_down_factor); 339 - cpufreq_freq_attr_rw_old(up_threshold); 340 - cpufreq_freq_attr_rw_old(down_threshold); 341 - cpufreq_freq_attr_rw_old(ignore_nice_load); 342 - cpufreq_freq_attr_rw_old(freq_step); 343 - 344 - static struct attribute *dbs_attributes_old[] = { 345 - &sampling_rate_max_old.attr, 346 - &sampling_rate_min_old.attr, 347 - &sampling_rate_old.attr, 348 - &sampling_down_factor_old.attr, 349 - &up_threshold_old.attr, 350 - &down_threshold_old.attr, 351 - &ignore_nice_load_old.attr, 352 - &freq_step_old.attr, 353 - NULL 354 - }; 355 - 356 - static struct attribute_group dbs_attr_group_old = { 357 - .attrs = dbs_attributes_old, 358 - .name = "conservative", 359 - }; 360 - 361 - /*** delete after deprecation time ***/ 362 363 /************************** sysfs end ************************/ 364 ··· 492 493 mutex_lock(&dbs_mutex); 494 495 - rc = sysfs_create_group(&policy->kobj, &dbs_attr_group_old); 496 - if (rc) { 497 - mutex_unlock(&dbs_mutex); 498 - return rc; 499 - } 500 - 501 for_each_cpu(j, policy->cpus) { 502 struct cpu_dbs_info_s *j_dbs_info; 503 j_dbs_info = &per_cpu(cs_cpu_dbs_info, j); ··· 554 dbs_timer_exit(this_dbs_info); 555 556 mutex_lock(&dbs_mutex); 557 - sysfs_remove_group(&policy->kobj, &dbs_attr_group_old); 558 dbs_enable--; 559 mutex_destroy(&this_dbs_info->timer_mutex); 560
··· 76 static unsigned int dbs_enable; /* number of CPUs using this policy */ 77 78 /* 79 + * dbs_mutex protects dbs_enable in governor start/stop. 80 */ 81 static DEFINE_MUTEX(dbs_mutex); 82 ··· 116 if (wall) 117 *wall = (cputime64_t)jiffies_to_usecs(cur_wall_time); 118 119 + return (cputime64_t)jiffies_to_usecs(idle_time); 120 } 121 122 static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall) ··· 162 }; 163 164 /************************** sysfs interface ************************/ 165 static ssize_t show_sampling_rate_min(struct kobject *kobj, 166 struct attribute *attr, char *buf) 167 { 168 return sprintf(buf, "%u\n", min_sampling_rate); 169 } 170 171 define_one_global_ro(sampling_rate_min); 172 173 /* cpufreq_conservative Governor Tunables */ ··· 193 show_one(ignore_nice_load, ignore_nice); 194 show_one(freq_step, freq_step); 195 196 static ssize_t store_sampling_down_factor(struct kobject *a, 197 struct attribute *b, 198 const char *buf, size_t count) ··· 231 if (ret != 1 || input > MAX_SAMPLING_DOWN_FACTOR || input < 1) 232 return -EINVAL; 233 234 dbs_tuners_ins.sampling_down_factor = input; 235 return count; 236 } 237 ··· 248 if (ret != 1) 249 return -EINVAL; 250 251 dbs_tuners_ins.sampling_rate = max(input, min_sampling_rate); 252 return count; 253 } 254 ··· 262 int ret; 263 ret = sscanf(buf, "%u", &input); 264 265 if (ret != 1 || input > 100 || 266 + input <= dbs_tuners_ins.down_threshold) 267 return -EINVAL; 268 269 dbs_tuners_ins.up_threshold = input; 270 return count; 271 } 272 ··· 282 int ret; 283 ret = sscanf(buf, "%u", &input); 284 285 /* cannot be lower than 11 otherwise freq will not fall */ 286 if (ret != 1 || input < 11 || input > 100 || 287 + input >= dbs_tuners_ins.up_threshold) 288 return -EINVAL; 289 290 dbs_tuners_ins.down_threshold = input; 291 return count; 292 } 293 ··· 311 if (input > 1) 312 input = 1; 313 314 + if (input == dbs_tuners_ins.ignore_nice) /* nothing to do */ 315 return count; 316 + 317 dbs_tuners_ins.ignore_nice = input; 318 319 /* we need to re-evaluate prev_cpu_idle */ ··· 327 if (dbs_tuners_ins.ignore_nice) 328 dbs_info->prev_cpu_nice = kstat_cpu(j).cpustat.nice; 329 } 330 return count; 331 } 332 ··· 347 348 /* no need to test here if freq_step is zero as the user might actually 349 * want this, they would be crazy though :) */ 350 dbs_tuners_ins.freq_step = input; 351 return count; 352 } 353 ··· 362 define_one_global_rw(freq_step); 363 364 static struct attribute *dbs_attributes[] = { 365 &sampling_rate_min.attr, 366 &sampling_rate.attr, 367 &sampling_down_factor.attr, ··· 377 .attrs = dbs_attributes, 378 .name = "conservative", 379 }; 380 381 /************************** sysfs end ************************/ 382 ··· 596 597 mutex_lock(&dbs_mutex); 598 599 for_each_cpu(j, policy->cpus) { 600 struct cpu_dbs_info_s *j_dbs_info; 601 j_dbs_info = &per_cpu(cs_cpu_dbs_info, j); ··· 664 dbs_timer_exit(this_dbs_info); 665 666 mutex_lock(&dbs_mutex); 667 dbs_enable--; 668 mutex_destroy(&this_dbs_info->timer_mutex); 669
+12 -110
drivers/cpufreq/cpufreq_ondemand.c
··· 99 static unsigned int dbs_enable; /* number of CPUs using this policy */ 100 101 /* 102 - * dbs_mutex protects data in dbs_tuners_ins from concurrent changes on 103 - * different CPUs. It protects dbs_enable in governor start/stop. 104 */ 105 static DEFINE_MUTEX(dbs_mutex); 106 ··· 234 235 /************************** sysfs interface ************************/ 236 237 - static ssize_t show_sampling_rate_max(struct kobject *kobj, 238 - struct attribute *attr, char *buf) 239 - { 240 - printk_once(KERN_INFO "CPUFREQ: ondemand sampling_rate_max " 241 - "sysfs file is deprecated - used by: %s\n", current->comm); 242 - return sprintf(buf, "%u\n", -1U); 243 - } 244 - 245 static ssize_t show_sampling_rate_min(struct kobject *kobj, 246 struct attribute *attr, char *buf) 247 { 248 return sprintf(buf, "%u\n", min_sampling_rate); 249 } 250 251 - define_one_global_ro(sampling_rate_max); 252 define_one_global_ro(sampling_rate_min); 253 254 /* cpufreq_ondemand Governor Tunables */ ··· 256 show_one(ignore_nice_load, ignore_nice); 257 show_one(powersave_bias, powersave_bias); 258 259 - /*** delete after deprecation time ***/ 260 - 261 - #define DEPRECATION_MSG(file_name) \ 262 - printk_once(KERN_INFO "CPUFREQ: Per core ondemand sysfs " \ 263 - "interface is deprecated - " #file_name "\n"); 264 - 265 - #define show_one_old(file_name) \ 266 - static ssize_t show_##file_name##_old \ 267 - (struct cpufreq_policy *unused, char *buf) \ 268 - { \ 269 - printk_once(KERN_INFO "CPUFREQ: Per core ondemand sysfs " \ 270 - "interface is deprecated - " #file_name "\n"); \ 271 - return show_##file_name(NULL, NULL, buf); \ 272 - } 273 - show_one_old(sampling_rate); 274 - show_one_old(up_threshold); 275 - show_one_old(ignore_nice_load); 276 - show_one_old(powersave_bias); 277 - show_one_old(sampling_rate_min); 278 - show_one_old(sampling_rate_max); 279 - 280 - cpufreq_freq_attr_ro_old(sampling_rate_min); 281 - cpufreq_freq_attr_ro_old(sampling_rate_max); 282 - 283 - /*** delete after deprecation time ***/ 284 - 285 static ssize_t store_sampling_rate(struct kobject *a, struct attribute *b, 286 const char *buf, size_t count) 287 { ··· 264 ret = sscanf(buf, "%u", &input); 265 if (ret != 1) 266 return -EINVAL; 267 - 268 - mutex_lock(&dbs_mutex); 269 dbs_tuners_ins.sampling_rate = max(input, min_sampling_rate); 270 - mutex_unlock(&dbs_mutex); 271 - 272 return count; 273 } 274 ··· 277 ret = sscanf(buf, "%u", &input); 278 if (ret != 1) 279 return -EINVAL; 280 - 281 - mutex_lock(&dbs_mutex); 282 dbs_tuners_ins.io_is_busy = !!input; 283 - mutex_unlock(&dbs_mutex); 284 - 285 return count; 286 } 287 ··· 292 input < MIN_FREQUENCY_UP_THRESHOLD) { 293 return -EINVAL; 294 } 295 - 296 - mutex_lock(&dbs_mutex); 297 dbs_tuners_ins.up_threshold = input; 298 - mutex_unlock(&dbs_mutex); 299 - 300 return count; 301 } 302 ··· 305 306 if (ret != 1 || input > MAX_SAMPLING_DOWN_FACTOR || input < 1) 307 return -EINVAL; 308 - mutex_lock(&dbs_mutex); 309 dbs_tuners_ins.sampling_down_factor = input; 310 311 /* Reset down sampling multiplier in case it was active */ ··· 313 dbs_info = &per_cpu(od_cpu_dbs_info, j); 314 dbs_info->rate_mult = 1; 315 } 316 - mutex_unlock(&dbs_mutex); 317 - 318 return count; 319 } 320 ··· 331 if (input > 1) 332 input = 1; 333 334 - mutex_lock(&dbs_mutex); 335 if (input == dbs_tuners_ins.ignore_nice) { /* nothing to do */ 336 - mutex_unlock(&dbs_mutex); 337 return count; 338 } 339 dbs_tuners_ins.ignore_nice = input; ··· 346 dbs_info->prev_cpu_nice = kstat_cpu(j).cpustat.nice; 347 348 } 349 - mutex_unlock(&dbs_mutex); 350 - 351 return count; 352 } 353 ··· 362 if (input > 1000) 363 input = 1000; 364 365 - mutex_lock(&dbs_mutex); 366 dbs_tuners_ins.powersave_bias = input; 367 ondemand_powersave_bias_init(); 368 - mutex_unlock(&dbs_mutex); 369 - 370 return count; 371 } 372 ··· 375 define_one_global_rw(powersave_bias); 376 377 static struct attribute *dbs_attributes[] = { 378 - &sampling_rate_max.attr, 379 &sampling_rate_min.attr, 380 &sampling_rate.attr, 381 &up_threshold.attr, ··· 389 .attrs = dbs_attributes, 390 .name = "ondemand", 391 }; 392 - 393 - /*** delete after deprecation time ***/ 394 - 395 - #define write_one_old(file_name) \ 396 - static ssize_t store_##file_name##_old \ 397 - (struct cpufreq_policy *unused, const char *buf, size_t count) \ 398 - { \ 399 - printk_once(KERN_INFO "CPUFREQ: Per core ondemand sysfs " \ 400 - "interface is deprecated - " #file_name "\n"); \ 401 - return store_##file_name(NULL, NULL, buf, count); \ 402 - } 403 - write_one_old(sampling_rate); 404 - write_one_old(up_threshold); 405 - write_one_old(ignore_nice_load); 406 - write_one_old(powersave_bias); 407 - 408 - cpufreq_freq_attr_rw_old(sampling_rate); 409 - cpufreq_freq_attr_rw_old(up_threshold); 410 - cpufreq_freq_attr_rw_old(ignore_nice_load); 411 - cpufreq_freq_attr_rw_old(powersave_bias); 412 - 413 - static struct attribute *dbs_attributes_old[] = { 414 - &sampling_rate_max_old.attr, 415 - &sampling_rate_min_old.attr, 416 - &sampling_rate_old.attr, 417 - &up_threshold_old.attr, 418 - &ignore_nice_load_old.attr, 419 - &powersave_bias_old.attr, 420 - NULL 421 - }; 422 - 423 - static struct attribute_group dbs_attr_group_old = { 424 - .attrs = dbs_attributes_old, 425 - .name = "ondemand", 426 - }; 427 - 428 - /*** delete after deprecation time ***/ 429 430 /************************** sysfs end ************************/ 431 ··· 546 unsigned int cpu = dbs_info->cpu; 547 int sample_type = dbs_info->sample_type; 548 549 - /* We want all CPUs to do sampling nearly on same jiffy */ 550 - int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate 551 - * dbs_info->rate_mult); 552 - 553 - if (num_online_cpus() > 1) 554 - delay -= jiffies % delay; 555 556 mutex_lock(&dbs_info->timer_mutex); 557 ··· 559 /* Setup timer for SUB_SAMPLE */ 560 dbs_info->sample_type = DBS_SUB_SAMPLE; 561 delay = dbs_info->freq_hi_jiffies; 562 } 563 } else { 564 __cpufreq_driver_target(dbs_info->cur_policy, 565 dbs_info->freq_lo, CPUFREQ_RELATION_H); 566 } 567 schedule_delayed_work_on(cpu, &dbs_info->work, delay); 568 mutex_unlock(&dbs_info->timer_mutex); ··· 636 637 mutex_lock(&dbs_mutex); 638 639 - rc = sysfs_create_group(&policy->kobj, &dbs_attr_group_old); 640 - if (rc) { 641 - mutex_unlock(&dbs_mutex); 642 - return rc; 643 - } 644 - 645 dbs_enable++; 646 for_each_cpu(j, policy->cpus) { 647 struct cpu_dbs_info_s *j_dbs_info; ··· 688 dbs_timer_exit(this_dbs_info); 689 690 mutex_lock(&dbs_mutex); 691 - sysfs_remove_group(&policy->kobj, &dbs_attr_group_old); 692 mutex_destroy(&this_dbs_info->timer_mutex); 693 dbs_enable--; 694 mutex_unlock(&dbs_mutex);
··· 99 static unsigned int dbs_enable; /* number of CPUs using this policy */ 100 101 /* 102 + * dbs_mutex protects dbs_enable in governor start/stop. 103 */ 104 static DEFINE_MUTEX(dbs_mutex); 105 ··· 235 236 /************************** sysfs interface ************************/ 237 238 static ssize_t show_sampling_rate_min(struct kobject *kobj, 239 struct attribute *attr, char *buf) 240 { 241 return sprintf(buf, "%u\n", min_sampling_rate); 242 } 243 244 define_one_global_ro(sampling_rate_min); 245 246 /* cpufreq_ondemand Governor Tunables */ ··· 266 show_one(ignore_nice_load, ignore_nice); 267 show_one(powersave_bias, powersave_bias); 268 269 static ssize_t store_sampling_rate(struct kobject *a, struct attribute *b, 270 const char *buf, size_t count) 271 { ··· 300 ret = sscanf(buf, "%u", &input); 301 if (ret != 1) 302 return -EINVAL; 303 dbs_tuners_ins.sampling_rate = max(input, min_sampling_rate); 304 return count; 305 } 306 ··· 317 ret = sscanf(buf, "%u", &input); 318 if (ret != 1) 319 return -EINVAL; 320 dbs_tuners_ins.io_is_busy = !!input; 321 return count; 322 } 323 ··· 336 input < MIN_FREQUENCY_UP_THRESHOLD) { 337 return -EINVAL; 338 } 339 dbs_tuners_ins.up_threshold = input; 340 return count; 341 } 342 ··· 353 354 if (ret != 1 || input > MAX_SAMPLING_DOWN_FACTOR || input < 1) 355 return -EINVAL; 356 dbs_tuners_ins.sampling_down_factor = input; 357 358 /* Reset down sampling multiplier in case it was active */ ··· 362 dbs_info = &per_cpu(od_cpu_dbs_info, j); 363 dbs_info->rate_mult = 1; 364 } 365 return count; 366 } 367 ··· 382 if (input > 1) 383 input = 1; 384 385 if (input == dbs_tuners_ins.ignore_nice) { /* nothing to do */ 386 return count; 387 } 388 dbs_tuners_ins.ignore_nice = input; ··· 399 dbs_info->prev_cpu_nice = kstat_cpu(j).cpustat.nice; 400 401 } 402 return count; 403 } 404 ··· 417 if (input > 1000) 418 input = 1000; 419 420 dbs_tuners_ins.powersave_bias = input; 421 ondemand_powersave_bias_init(); 422 return count; 423 } 424 ··· 433 define_one_global_rw(powersave_bias); 434 435 static struct attribute *dbs_attributes[] = { 436 &sampling_rate_min.attr, 437 &sampling_rate.attr, 438 &up_threshold.attr, ··· 448 .attrs = dbs_attributes, 449 .name = "ondemand", 450 }; 451 452 /************************** sysfs end ************************/ 453 ··· 642 unsigned int cpu = dbs_info->cpu; 643 int sample_type = dbs_info->sample_type; 644 645 + int delay; 646 647 mutex_lock(&dbs_info->timer_mutex); 648 ··· 660 /* Setup timer for SUB_SAMPLE */ 661 dbs_info->sample_type = DBS_SUB_SAMPLE; 662 delay = dbs_info->freq_hi_jiffies; 663 + } else { 664 + /* We want all CPUs to do sampling nearly on 665 + * same jiffy 666 + */ 667 + delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate 668 + * dbs_info->rate_mult); 669 + 670 + if (num_online_cpus() > 1) 671 + delay -= jiffies % delay; 672 } 673 } else { 674 __cpufreq_driver_target(dbs_info->cur_policy, 675 dbs_info->freq_lo, CPUFREQ_RELATION_H); 676 + delay = dbs_info->freq_lo_jiffies; 677 } 678 schedule_delayed_work_on(cpu, &dbs_info->work, delay); 679 mutex_unlock(&dbs_info->timer_mutex); ··· 727 728 mutex_lock(&dbs_mutex); 729 730 dbs_enable++; 731 for_each_cpu(j, policy->cpus) { 732 struct cpu_dbs_info_s *j_dbs_info; ··· 785 dbs_timer_exit(this_dbs_info); 786 787 mutex_lock(&dbs_mutex); 788 mutex_destroy(&this_dbs_info->timer_mutex); 789 dbs_enable--; 790 mutex_unlock(&dbs_mutex);
+1 -10
include/linux/cpufreq.h
··· 230 int (*bios_limit) (int cpu, unsigned int *limit); 231 232 int (*exit) (struct cpufreq_policy *policy); 233 - int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); 234 int (*resume) (struct cpufreq_policy *policy); 235 struct freq_attr **attr; 236 }; ··· 281 static struct freq_attr _name = \ 282 __ATTR(_name, _perm, show_##_name, NULL) 283 284 - #define cpufreq_freq_attr_ro_old(_name) \ 285 - static struct freq_attr _name##_old = \ 286 - __ATTR(_name, 0444, show_##_name##_old, NULL) 287 - 288 #define cpufreq_freq_attr_rw(_name) \ 289 static struct freq_attr _name = \ 290 __ATTR(_name, 0644, show_##_name, store_##_name) 291 - 292 - #define cpufreq_freq_attr_rw_old(_name) \ 293 - static struct freq_attr _name##_old = \ 294 - __ATTR(_name, 0644, show_##_name##_old, store_##_name##_old) 295 - 296 297 struct global_attr { 298 struct attribute attr;
··· 230 int (*bios_limit) (int cpu, unsigned int *limit); 231 232 int (*exit) (struct cpufreq_policy *policy); 233 + int (*suspend) (struct cpufreq_policy *policy); 234 int (*resume) (struct cpufreq_policy *policy); 235 struct freq_attr **attr; 236 }; ··· 281 static struct freq_attr _name = \ 282 __ATTR(_name, _perm, show_##_name, NULL) 283 284 #define cpufreq_freq_attr_rw(_name) \ 285 static struct freq_attr _name = \ 286 __ATTR(_name, 0644, show_##_name, store_##_name) 287 288 struct global_attr { 289 struct attribute attr;