cpufreq_conservative.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. /*
  2. * drivers/cpufreq/cpufreq_conservative.c
  3. *
  4. * Copyright (C) 2001 Russell King
  5. * (C) 2003 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>.
  6. * Jun Nakajima <jun.nakajima@intel.com>
  7. * (C) 2009 Alexander Clouter <alex@digriz.org.uk>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/module.h>
  15. #include <linux/init.h>
  16. #include <linux/cpufreq.h>
  17. #include <linux/cpu.h>
  18. #include <linux/jiffies.h>
  19. #include <linux/kernel_stat.h>
  20. #include <linux/mutex.h>
  21. #include <linux/hrtimer.h>
  22. #include <linux/tick.h>
  23. #include <linux/ktime.h>
  24. #include <linux/sched.h>
  25. /*
  26. * dbs is used in this file as a shortform for demandbased switching
  27. * It helps to keep variable names smaller, simpler
  28. */
  29. #define DEF_FREQUENCY_UP_THRESHOLD (80)
  30. #define DEF_FREQUENCY_DOWN_THRESHOLD (20)
  31. /*
  32. * The polling frequency of this governor depends on the capability of
  33. * the processor. Default polling frequency is 1000 times the transition
  34. * latency of the processor. The governor will work on any processor with
  35. * transition latency <= 10mS, using appropriate sampling
  36. * rate.
  37. * For CPUs with transition latency > 10mS (mostly drivers with CPUFREQ_ETERNAL)
  38. * this governor will not work.
  39. * All times here are in uS.
  40. */
  41. #define MIN_SAMPLING_RATE_RATIO (2)
  42. static unsigned int min_sampling_rate;
  43. #define LATENCY_MULTIPLIER (1000)
  44. #define MIN_LATENCY_MULTIPLIER (100)
  45. #define DEF_SAMPLING_DOWN_FACTOR (1)
  46. #define MAX_SAMPLING_DOWN_FACTOR (10)
  47. #define TRANSITION_LATENCY_LIMIT (10 * 1000 * 1000)
  48. static void do_dbs_timer(struct work_struct *work);
  49. struct cpu_dbs_info_s {
  50. cputime64_t prev_cpu_idle;
  51. cputime64_t prev_cpu_wall;
  52. cputime64_t prev_cpu_nice;
  53. struct cpufreq_policy *cur_policy;
  54. struct delayed_work work;
  55. unsigned int down_skip;
  56. unsigned int requested_freq;
  57. int cpu;
  58. unsigned int enable:1;
  59. /*
  60. * percpu mutex that serializes governor limit change with
  61. * do_dbs_timer invocation. We do not want do_dbs_timer to run
  62. * when user is changing the governor or limits.
  63. */
  64. struct mutex timer_mutex;
  65. };
  66. static DEFINE_PER_CPU(struct cpu_dbs_info_s, cs_cpu_dbs_info);
  67. static unsigned int dbs_enable; /* number of CPUs using this policy */
  68. /*
  69. * dbs_mutex protects dbs_enable in governor start/stop.
  70. */
  71. static DEFINE_MUTEX(dbs_mutex);
  72. static struct workqueue_struct *dbs_wq;
  73. static struct dbs_tuners {
  74. unsigned int sampling_rate;
  75. unsigned int sampling_down_factor;
  76. unsigned int up_threshold;
  77. unsigned int down_threshold;
  78. unsigned int ignore_nice;
  79. unsigned int freq_step;
  80. } dbs_tuners_ins = {
  81. .up_threshold = DEF_FREQUENCY_UP_THRESHOLD,
  82. .down_threshold = DEF_FREQUENCY_DOWN_THRESHOLD,
  83. .sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR,
  84. .ignore_nice = 0,
  85. .freq_step = 5,
  86. };
  87. static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)
  88. {
  89. u64 idle_time;
  90. u64 cur_wall_time;
  91. u64 busy_time;
  92. cur_wall_time = jiffies64_to_cputime64(get_jiffies_64());
  93. busy_time = kcpustat_cpu(cpu).cpustat[CPUTIME_USER];
  94. busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_SYSTEM];
  95. busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_IRQ];
  96. busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_SOFTIRQ];
  97. busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_STEAL];
  98. busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_NICE];
  99. idle_time = cur_wall_time - busy_time;
  100. if (wall)
  101. *wall = jiffies_to_usecs(cur_wall_time);
  102. return jiffies_to_usecs(idle_time);
  103. }
  104. static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall)
  105. {
  106. u64 idle_time = get_cpu_idle_time_us(cpu, NULL);
  107. if (idle_time == -1ULL)
  108. return get_cpu_idle_time_jiffy(cpu, wall);
  109. else
  110. idle_time += get_cpu_iowait_time_us(cpu, wall);
  111. return idle_time;
  112. }
  113. /* keep track of frequency transitions */
  114. static int
  115. dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
  116. void *data)
  117. {
  118. struct cpufreq_freqs *freq = data;
  119. struct cpu_dbs_info_s *this_dbs_info = &per_cpu(cs_cpu_dbs_info,
  120. freq->cpu);
  121. struct cpufreq_policy *policy;
  122. if (!this_dbs_info->enable)
  123. return 0;
  124. policy = this_dbs_info->cur_policy;
  125. /*
  126. * we only care if our internally tracked freq moves outside
  127. * the 'valid' ranges of freqency available to us otherwise
  128. * we do not change it
  129. */
  130. if (this_dbs_info->requested_freq > policy->max
  131. || this_dbs_info->requested_freq < policy->min)
  132. this_dbs_info->requested_freq = freq->new;
  133. return 0;
  134. }
  135. static struct notifier_block dbs_cpufreq_notifier_block = {
  136. .notifier_call = dbs_cpufreq_notifier
  137. };
  138. /************************** sysfs interface ************************/
  139. static ssize_t show_sampling_rate_min(struct kobject *kobj,
  140. struct attribute *attr, char *buf)
  141. {
  142. return sprintf(buf, "%u\n", min_sampling_rate);
  143. }
  144. define_one_global_ro(sampling_rate_min);
  145. /* cpufreq_conservative Governor Tunables */
  146. #define show_one(file_name, object) \
  147. static ssize_t show_##file_name \
  148. (struct kobject *kobj, struct attribute *attr, char *buf) \
  149. { \
  150. return sprintf(buf, "%u\n", dbs_tuners_ins.object); \
  151. }
  152. show_one(sampling_rate, sampling_rate);
  153. show_one(sampling_down_factor, sampling_down_factor);
  154. show_one(up_threshold, up_threshold);
  155. show_one(down_threshold, down_threshold);
  156. show_one(ignore_nice_load, ignore_nice);
  157. show_one(freq_step, freq_step);
  158. static ssize_t store_sampling_down_factor(struct kobject *a,
  159. struct attribute *b,
  160. const char *buf, size_t count)
  161. {
  162. unsigned int input;
  163. int ret;
  164. ret = sscanf(buf, "%u", &input);
  165. if (ret != 1 || input > MAX_SAMPLING_DOWN_FACTOR || input < 1)
  166. return -EINVAL;
  167. dbs_tuners_ins.sampling_down_factor = input;
  168. return count;
  169. }
  170. static ssize_t store_sampling_rate(struct kobject *a, struct attribute *b,
  171. const char *buf, size_t count)
  172. {
  173. unsigned int input;
  174. int ret;
  175. ret = sscanf(buf, "%u", &input);
  176. if (ret != 1)
  177. return -EINVAL;
  178. dbs_tuners_ins.sampling_rate = max(input, min_sampling_rate);
  179. return count;
  180. }
  181. static ssize_t store_up_threshold(struct kobject *a, struct attribute *b,
  182. const char *buf, size_t count)
  183. {
  184. unsigned int input;
  185. int ret;
  186. ret = sscanf(buf, "%u", &input);
  187. if (ret != 1 || input > 100 ||
  188. input <= dbs_tuners_ins.down_threshold)
  189. return -EINVAL;
  190. dbs_tuners_ins.up_threshold = input;
  191. return count;
  192. }
  193. static ssize_t store_down_threshold(struct kobject *a, struct attribute *b,
  194. const char *buf, size_t count)
  195. {
  196. unsigned int input;
  197. int ret;
  198. ret = sscanf(buf, "%u", &input);
  199. /* cannot be lower than 11 otherwise freq will not fall */
  200. if (ret != 1 || input < 11 || input > 100 ||
  201. input >= dbs_tuners_ins.up_threshold)
  202. return -EINVAL;
  203. dbs_tuners_ins.down_threshold = input;
  204. return count;
  205. }
  206. static ssize_t store_ignore_nice_load(struct kobject *a, struct attribute *b,
  207. const char *buf, size_t count)
  208. {
  209. unsigned int input;
  210. int ret;
  211. unsigned int j;
  212. ret = sscanf(buf, "%u", &input);
  213. if (ret != 1)
  214. return -EINVAL;
  215. if (input > 1)
  216. input = 1;
  217. if (input == dbs_tuners_ins.ignore_nice) /* nothing to do */
  218. return count;
  219. dbs_tuners_ins.ignore_nice = input;
  220. /* we need to re-evaluate prev_cpu_idle */
  221. for_each_online_cpu(j) {
  222. struct cpu_dbs_info_s *dbs_info;
  223. dbs_info = &per_cpu(cs_cpu_dbs_info, j);
  224. dbs_info->prev_cpu_idle = get_cpu_idle_time(j,
  225. &dbs_info->prev_cpu_wall);
  226. if (dbs_tuners_ins.ignore_nice)
  227. dbs_info->prev_cpu_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE];
  228. }
  229. return count;
  230. }
  231. static ssize_t store_freq_step(struct kobject *a, struct attribute *b,
  232. const char *buf, size_t count)
  233. {
  234. unsigned int input;
  235. int ret;
  236. ret = sscanf(buf, "%u", &input);
  237. if (ret != 1)
  238. return -EINVAL;
  239. if (input > 100)
  240. input = 100;
  241. /* no need to test here if freq_step is zero as the user might actually
  242. * want this, they would be crazy though :) */
  243. dbs_tuners_ins.freq_step = input;
  244. return count;
  245. }
  246. define_one_global_rw(sampling_rate);
  247. define_one_global_rw(sampling_down_factor);
  248. define_one_global_rw(up_threshold);
  249. define_one_global_rw(down_threshold);
  250. define_one_global_rw(ignore_nice_load);
  251. define_one_global_rw(freq_step);
  252. static struct attribute *dbs_attributes[] = {
  253. &sampling_rate_min.attr,
  254. &sampling_rate.attr,
  255. &sampling_down_factor.attr,
  256. &up_threshold.attr,
  257. &down_threshold.attr,
  258. &ignore_nice_load.attr,
  259. &freq_step.attr,
  260. NULL
  261. };
  262. static struct attribute_group dbs_attr_group = {
  263. .attrs = dbs_attributes,
  264. .name = "conservative",
  265. };
  266. /************************** sysfs end ************************/
  267. static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info)
  268. {
  269. unsigned int load = 0;
  270. unsigned int max_load = 0;
  271. unsigned int freq_target;
  272. struct cpufreq_policy *policy;
  273. unsigned int j;
  274. policy = this_dbs_info->cur_policy;
  275. /*
  276. * Every sampling_rate, we check, if current idle time is less
  277. * than 20% (default), then we try to increase frequency
  278. * Every sampling_rate*sampling_down_factor, we check, if current
  279. * idle time is more than 80%, then we try to decrease frequency
  280. *
  281. * Any frequency increase takes it to the maximum frequency.
  282. * Frequency reduction happens at minimum steps of
  283. * 5% (default) of maximum frequency
  284. */
  285. /* Get Absolute Load */
  286. for_each_cpu(j, policy->cpus) {
  287. struct cpu_dbs_info_s *j_dbs_info;
  288. cputime64_t cur_wall_time, cur_idle_time;
  289. unsigned int idle_time, wall_time;
  290. j_dbs_info = &per_cpu(cs_cpu_dbs_info, j);
  291. cur_idle_time = get_cpu_idle_time(j, &cur_wall_time);
  292. wall_time = (unsigned int)
  293. (cur_wall_time - j_dbs_info->prev_cpu_wall);
  294. j_dbs_info->prev_cpu_wall = cur_wall_time;
  295. idle_time = (unsigned int)
  296. (cur_idle_time - j_dbs_info->prev_cpu_idle);
  297. j_dbs_info->prev_cpu_idle = cur_idle_time;
  298. if (dbs_tuners_ins.ignore_nice) {
  299. u64 cur_nice;
  300. unsigned long cur_nice_jiffies;
  301. cur_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE] -
  302. j_dbs_info->prev_cpu_nice;
  303. /*
  304. * Assumption: nice time between sampling periods will
  305. * be less than 2^32 jiffies for 32 bit sys
  306. */
  307. cur_nice_jiffies = (unsigned long)
  308. cputime64_to_jiffies64(cur_nice);
  309. j_dbs_info->prev_cpu_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE];
  310. idle_time += jiffies_to_usecs(cur_nice_jiffies);
  311. }
  312. if (unlikely(!wall_time || wall_time < idle_time))
  313. continue;
  314. load = 100 * (wall_time - idle_time) / wall_time;
  315. if (load > max_load)
  316. max_load = load;
  317. }
  318. /*
  319. * break out if we 'cannot' reduce the speed as the user might
  320. * want freq_step to be zero
  321. */
  322. if (dbs_tuners_ins.freq_step == 0)
  323. return;
  324. /* Check for frequency increase */
  325. if (max_load > dbs_tuners_ins.up_threshold) {
  326. this_dbs_info->down_skip = 0;
  327. /* if we are already at full speed then break out early */
  328. if (this_dbs_info->requested_freq == policy->max)
  329. return;
  330. freq_target = (dbs_tuners_ins.freq_step * policy->max) / 100;
  331. /* max freq cannot be less than 100. But who knows.... */
  332. if (unlikely(freq_target == 0))
  333. freq_target = 5;
  334. this_dbs_info->requested_freq += freq_target;
  335. if (this_dbs_info->requested_freq > policy->max)
  336. this_dbs_info->requested_freq = policy->max;
  337. __cpufreq_driver_target(policy, this_dbs_info->requested_freq,
  338. CPUFREQ_RELATION_H);
  339. return;
  340. }
  341. /*
  342. * The optimal frequency is the frequency that is the lowest that
  343. * can support the current CPU usage without triggering the up
  344. * policy. To be safe, we focus 10 points under the threshold.
  345. */
  346. if (max_load < (dbs_tuners_ins.down_threshold - 10)) {
  347. freq_target = (dbs_tuners_ins.freq_step * policy->max) / 100;
  348. this_dbs_info->requested_freq -= freq_target;
  349. if (this_dbs_info->requested_freq < policy->min)
  350. this_dbs_info->requested_freq = policy->min;
  351. /*
  352. * if we cannot reduce the frequency anymore, break out early
  353. */
  354. if (policy->cur == policy->min)
  355. return;
  356. __cpufreq_driver_target(policy, this_dbs_info->requested_freq,
  357. CPUFREQ_RELATION_H);
  358. return;
  359. }
  360. }
  361. static void do_dbs_timer(struct work_struct *work)
  362. {
  363. struct cpu_dbs_info_s *dbs_info =
  364. container_of(work, struct cpu_dbs_info_s, work.work);
  365. unsigned int cpu = dbs_info->cpu;
  366. /* We want all CPUs to do sampling nearly on same jiffy */
  367. int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
  368. delay -= jiffies % delay;
  369. mutex_lock(&dbs_info->timer_mutex);
  370. dbs_check_cpu(dbs_info);
  371. queue_delayed_work_on(cpu, dbs_wq, &dbs_info->work, delay);
  372. mutex_unlock(&dbs_info->timer_mutex);
  373. }
  374. static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info)
  375. {
  376. /* We want all CPUs to do sampling nearly on same jiffy */
  377. int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate);
  378. delay -= jiffies % delay;
  379. dbs_info->enable = 1;
  380. INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer);
  381. queue_delayed_work_on(dbs_info->cpu, dbs_wq, &dbs_info->work, delay);
  382. }
  383. static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info)
  384. {
  385. dbs_info->enable = 0;
  386. cancel_delayed_work_sync(&dbs_info->work);
  387. }
  388. static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
  389. unsigned int event)
  390. {
  391. unsigned int cpu = policy->cpu;
  392. struct cpu_dbs_info_s *this_dbs_info;
  393. unsigned int j;
  394. int rc;
  395. this_dbs_info = &per_cpu(cs_cpu_dbs_info, cpu);
  396. switch (event) {
  397. case CPUFREQ_GOV_START:
  398. if ((!cpu_online(cpu)) || (!policy->cur))
  399. return -EINVAL;
  400. mutex_lock(&dbs_mutex);
  401. for_each_cpu(j, policy->cpus) {
  402. struct cpu_dbs_info_s *j_dbs_info;
  403. j_dbs_info = &per_cpu(cs_cpu_dbs_info, j);
  404. j_dbs_info->cur_policy = policy;
  405. j_dbs_info->prev_cpu_idle = get_cpu_idle_time(j,
  406. &j_dbs_info->prev_cpu_wall);
  407. if (dbs_tuners_ins.ignore_nice)
  408. j_dbs_info->prev_cpu_nice =
  409. kcpustat_cpu(j).cpustat[CPUTIME_NICE];
  410. }
  411. this_dbs_info->down_skip = 0;
  412. this_dbs_info->requested_freq = policy->cur;
  413. mutex_init(&this_dbs_info->timer_mutex);
  414. dbs_enable++;
  415. /*
  416. * Start the timerschedule work, when this governor
  417. * is used for first time
  418. */
  419. if (dbs_enable == 1) {
  420. unsigned int latency;
  421. /* policy latency is in nS. Convert it to uS first */
  422. latency = policy->cpuinfo.transition_latency / 1000;
  423. if (latency == 0)
  424. latency = 1;
  425. rc = sysfs_create_group(cpufreq_global_kobject,
  426. &dbs_attr_group);
  427. if (rc) {
  428. mutex_unlock(&dbs_mutex);
  429. return rc;
  430. }
  431. /*
  432. * conservative does not implement micro like ondemand
  433. * governor, thus we are bound to jiffes/HZ
  434. */
  435. min_sampling_rate =
  436. MIN_SAMPLING_RATE_RATIO * jiffies_to_usecs(10);
  437. /* Bring kernel and HW constraints together */
  438. min_sampling_rate = max(min_sampling_rate,
  439. MIN_LATENCY_MULTIPLIER * latency);
  440. dbs_tuners_ins.sampling_rate =
  441. max(min_sampling_rate,
  442. latency * LATENCY_MULTIPLIER);
  443. cpufreq_register_notifier(
  444. &dbs_cpufreq_notifier_block,
  445. CPUFREQ_TRANSITION_NOTIFIER);
  446. }
  447. mutex_unlock(&dbs_mutex);
  448. dbs_timer_init(this_dbs_info);
  449. break;
  450. case CPUFREQ_GOV_STOP:
  451. dbs_timer_exit(this_dbs_info);
  452. mutex_lock(&dbs_mutex);
  453. dbs_enable--;
  454. mutex_destroy(&this_dbs_info->timer_mutex);
  455. /*
  456. * Stop the timerschedule work, when this governor
  457. * is used for first time
  458. */
  459. if (dbs_enable == 0)
  460. cpufreq_unregister_notifier(
  461. &dbs_cpufreq_notifier_block,
  462. CPUFREQ_TRANSITION_NOTIFIER);
  463. mutex_unlock(&dbs_mutex);
  464. if (!dbs_enable)
  465. sysfs_remove_group(cpufreq_global_kobject,
  466. &dbs_attr_group);
  467. break;
  468. case CPUFREQ_GOV_LIMITS:
  469. mutex_lock(&this_dbs_info->timer_mutex);
  470. if (policy->max < this_dbs_info->cur_policy->cur)
  471. __cpufreq_driver_target(
  472. this_dbs_info->cur_policy,
  473. policy->max, CPUFREQ_RELATION_H);
  474. else if (policy->min > this_dbs_info->cur_policy->cur)
  475. __cpufreq_driver_target(
  476. this_dbs_info->cur_policy,
  477. policy->min, CPUFREQ_RELATION_L);
  478. mutex_unlock(&this_dbs_info->timer_mutex);
  479. break;
  480. }
  481. return 0;
  482. }
  483. #ifndef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
  484. static
  485. #endif
  486. struct cpufreq_governor cpufreq_gov_conservative = {
  487. .name = "conservative",
  488. .governor = cpufreq_governor_dbs,
  489. .max_transition_latency = TRANSITION_LATENCY_LIMIT,
  490. .owner = THIS_MODULE,
  491. };
  492. static int __init cpufreq_gov_dbs_init(void)
  493. {
  494. dbs_wq = alloc_workqueue("conservative_dbs_wq", WQ_HIGHPRI, 0);
  495. if (!dbs_wq) {
  496. printk(KERN_ERR "Failed to create conservative_dbs_wq workqueue\n");
  497. return -EFAULT;
  498. }
  499. return cpufreq_register_governor(&cpufreq_gov_conservative);
  500. }
  501. static void __exit cpufreq_gov_dbs_exit(void)
  502. {
  503. cpufreq_unregister_governor(&cpufreq_gov_conservative);
  504. destroy_workqueue(dbs_wq);
  505. }
  506. MODULE_AUTHOR("Alexander Clouter <alex@digriz.org.uk>");
  507. MODULE_DESCRIPTION("'cpufreq_conservative' - A dynamic cpufreq governor for "
  508. "Low Latency Frequency Transition capable processors "
  509. "optimised for use in a battery environment");
  510. MODULE_LICENSE("GPL");
  511. #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
  512. fs_initcall(cpufreq_gov_dbs_init);
  513. #else
  514. module_init(cpufreq_gov_dbs_init);
  515. #endif
  516. module_exit(cpufreq_gov_dbs_exit);