cpufreq_ondemand.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. /*
  2. * drivers/cpufreq/cpufreq_ondemand.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. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  13. #include <linux/cpufreq.h>
  14. #include <linux/init.h>
  15. #include <linux/kernel.h>
  16. #include <linux/kernel_stat.h>
  17. #include <linux/kobject.h>
  18. #include <linux/module.h>
  19. #include <linux/mutex.h>
  20. #include <linux/percpu-defs.h>
  21. #include <linux/sysfs.h>
  22. #include <linux/tick.h>
  23. #include <linux/types.h>
  24. #include "cpufreq_governor.h"
  25. /* On-demand governor macors */
  26. #define DEF_FREQUENCY_DOWN_DIFFERENTIAL (10)
  27. #define DEF_FREQUENCY_UP_THRESHOLD (80)
  28. #define DEF_SAMPLING_DOWN_FACTOR (1)
  29. #define MAX_SAMPLING_DOWN_FACTOR (100000)
  30. #define MICRO_FREQUENCY_DOWN_DIFFERENTIAL (3)
  31. #define MICRO_FREQUENCY_UP_THRESHOLD (95)
  32. #define MICRO_FREQUENCY_MIN_SAMPLE_RATE (10000)
  33. #define MIN_FREQUENCY_UP_THRESHOLD (11)
  34. #define MAX_FREQUENCY_UP_THRESHOLD (100)
  35. static struct dbs_data od_dbs_data;
  36. static DEFINE_PER_CPU(struct od_cpu_dbs_info_s, od_cpu_dbs_info);
  37. #ifndef CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
  38. static struct cpufreq_governor cpufreq_gov_ondemand;
  39. #endif
  40. static struct od_dbs_tuners od_tuners = {
  41. .up_threshold = DEF_FREQUENCY_UP_THRESHOLD,
  42. .sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR,
  43. .down_differential = DEF_FREQUENCY_DOWN_DIFFERENTIAL,
  44. .ignore_nice = 0,
  45. .powersave_bias = 0,
  46. };
  47. static void ondemand_powersave_bias_init_cpu(int cpu)
  48. {
  49. struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
  50. dbs_info->freq_table = cpufreq_frequency_get_table(cpu);
  51. dbs_info->freq_lo = 0;
  52. }
  53. /*
  54. * Not all CPUs want IO time to be accounted as busy; this depends on how
  55. * efficient idling at a higher frequency/voltage is.
  56. * Pavel Machek says this is not so for various generations of AMD and old
  57. * Intel systems.
  58. * Mike Chan (androidlcom) calis this is also not true for ARM.
  59. * Because of this, whitelist specific known (series) of CPUs by default, and
  60. * leave all others up to the user.
  61. */
  62. static int should_io_be_busy(void)
  63. {
  64. #if defined(CONFIG_X86)
  65. /*
  66. * For Intel, Core 2 (model 15) andl later have an efficient idle.
  67. */
  68. if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
  69. boot_cpu_data.x86 == 6 &&
  70. boot_cpu_data.x86_model >= 15)
  71. return 1;
  72. #endif
  73. return 0;
  74. }
  75. /*
  76. * Find right freq to be set now with powersave_bias on.
  77. * Returns the freq_hi to be used right now and will set freq_hi_jiffies,
  78. * freq_lo, and freq_lo_jiffies in percpu area for averaging freqs.
  79. */
  80. static unsigned int powersave_bias_target(struct cpufreq_policy *policy,
  81. unsigned int freq_next, unsigned int relation)
  82. {
  83. unsigned int freq_req, freq_reduc, freq_avg;
  84. unsigned int freq_hi, freq_lo;
  85. unsigned int index = 0;
  86. unsigned int jiffies_total, jiffies_hi, jiffies_lo;
  87. struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info,
  88. policy->cpu);
  89. if (!dbs_info->freq_table) {
  90. dbs_info->freq_lo = 0;
  91. dbs_info->freq_lo_jiffies = 0;
  92. return freq_next;
  93. }
  94. cpufreq_frequency_table_target(policy, dbs_info->freq_table, freq_next,
  95. relation, &index);
  96. freq_req = dbs_info->freq_table[index].frequency;
  97. freq_reduc = freq_req * od_tuners.powersave_bias / 1000;
  98. freq_avg = freq_req - freq_reduc;
  99. /* Find freq bounds for freq_avg in freq_table */
  100. index = 0;
  101. cpufreq_frequency_table_target(policy, dbs_info->freq_table, freq_avg,
  102. CPUFREQ_RELATION_H, &index);
  103. freq_lo = dbs_info->freq_table[index].frequency;
  104. index = 0;
  105. cpufreq_frequency_table_target(policy, dbs_info->freq_table, freq_avg,
  106. CPUFREQ_RELATION_L, &index);
  107. freq_hi = dbs_info->freq_table[index].frequency;
  108. /* Find out how long we have to be in hi and lo freqs */
  109. if (freq_hi == freq_lo) {
  110. dbs_info->freq_lo = 0;
  111. dbs_info->freq_lo_jiffies = 0;
  112. return freq_lo;
  113. }
  114. jiffies_total = usecs_to_jiffies(od_tuners.sampling_rate);
  115. jiffies_hi = (freq_avg - freq_lo) * jiffies_total;
  116. jiffies_hi += ((freq_hi - freq_lo) / 2);
  117. jiffies_hi /= (freq_hi - freq_lo);
  118. jiffies_lo = jiffies_total - jiffies_hi;
  119. dbs_info->freq_lo = freq_lo;
  120. dbs_info->freq_lo_jiffies = jiffies_lo;
  121. dbs_info->freq_hi_jiffies = jiffies_hi;
  122. return freq_hi;
  123. }
  124. static void ondemand_powersave_bias_init(void)
  125. {
  126. int i;
  127. for_each_online_cpu(i) {
  128. ondemand_powersave_bias_init_cpu(i);
  129. }
  130. }
  131. static void dbs_freq_increase(struct cpufreq_policy *p, unsigned int freq)
  132. {
  133. if (od_tuners.powersave_bias)
  134. freq = powersave_bias_target(p, freq, CPUFREQ_RELATION_H);
  135. else if (p->cur == p->max)
  136. return;
  137. __cpufreq_driver_target(p, freq, od_tuners.powersave_bias ?
  138. CPUFREQ_RELATION_L : CPUFREQ_RELATION_H);
  139. }
  140. /*
  141. * Every sampling_rate, we check, if current idle time is less than 20%
  142. * (default), then we try to increase frequency Every sampling_rate, we look for
  143. * a the lowest frequency which can sustain the load while keeping idle time
  144. * over 30%. If such a frequency exist, we try to decrease to this frequency.
  145. *
  146. * Any frequency increase takes it to the maximum frequency. Frequency reduction
  147. * happens at minimum steps of 5% (default) of current frequency
  148. */
  149. static void od_check_cpu(int cpu, unsigned int load_freq)
  150. {
  151. struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
  152. struct cpufreq_policy *policy = dbs_info->cdbs.cur_policy;
  153. dbs_info->freq_lo = 0;
  154. /* Check for frequency increase */
  155. if (load_freq > od_tuners.up_threshold * policy->cur) {
  156. /* If switching to max speed, apply sampling_down_factor */
  157. if (policy->cur < policy->max)
  158. dbs_info->rate_mult =
  159. od_tuners.sampling_down_factor;
  160. dbs_freq_increase(policy, policy->max);
  161. return;
  162. }
  163. /* Check for frequency decrease */
  164. /* if we cannot reduce the frequency anymore, break out early */
  165. if (policy->cur == policy->min)
  166. return;
  167. /*
  168. * The optimal frequency is the frequency that is the lowest that can
  169. * support the current CPU usage without triggering the up policy. To be
  170. * safe, we focus 10 points under the threshold.
  171. */
  172. if (load_freq < (od_tuners.up_threshold - od_tuners.down_differential) *
  173. policy->cur) {
  174. unsigned int freq_next;
  175. freq_next = load_freq / (od_tuners.up_threshold -
  176. od_tuners.down_differential);
  177. /* No longer fully busy, reset rate_mult */
  178. dbs_info->rate_mult = 1;
  179. if (freq_next < policy->min)
  180. freq_next = policy->min;
  181. if (!od_tuners.powersave_bias) {
  182. __cpufreq_driver_target(policy, freq_next,
  183. CPUFREQ_RELATION_L);
  184. } else {
  185. int freq = powersave_bias_target(policy, freq_next,
  186. CPUFREQ_RELATION_L);
  187. __cpufreq_driver_target(policy, freq,
  188. CPUFREQ_RELATION_L);
  189. }
  190. }
  191. }
  192. static void od_timer_update(struct od_cpu_dbs_info_s *dbs_info, bool sample,
  193. struct delayed_work *dw)
  194. {
  195. unsigned int cpu = dbs_info->cdbs.cpu;
  196. int delay, sample_type = dbs_info->sample_type;
  197. /* Common NORMAL_SAMPLE setup */
  198. dbs_info->sample_type = OD_NORMAL_SAMPLE;
  199. if (sample_type == OD_SUB_SAMPLE) {
  200. delay = dbs_info->freq_lo_jiffies;
  201. if (sample)
  202. __cpufreq_driver_target(dbs_info->cdbs.cur_policy,
  203. dbs_info->freq_lo,
  204. CPUFREQ_RELATION_H);
  205. } else {
  206. if (sample)
  207. dbs_check_cpu(&od_dbs_data, cpu);
  208. if (dbs_info->freq_lo) {
  209. /* Setup timer for SUB_SAMPLE */
  210. dbs_info->sample_type = OD_SUB_SAMPLE;
  211. delay = dbs_info->freq_hi_jiffies;
  212. } else {
  213. delay = delay_for_sampling_rate(od_tuners.sampling_rate
  214. * dbs_info->rate_mult);
  215. }
  216. }
  217. schedule_delayed_work_on(smp_processor_id(), dw, delay);
  218. }
  219. static void od_timer_coordinated(struct od_cpu_dbs_info_s *dbs_info_local,
  220. struct delayed_work *dw)
  221. {
  222. struct od_cpu_dbs_info_s *dbs_info;
  223. ktime_t time_now;
  224. s64 delta_us;
  225. bool sample = true;
  226. /* use leader CPU's dbs_info */
  227. dbs_info = &per_cpu(od_cpu_dbs_info, dbs_info_local->cdbs.cpu);
  228. mutex_lock(&dbs_info->cdbs.timer_mutex);
  229. time_now = ktime_get();
  230. delta_us = ktime_us_delta(time_now, dbs_info->cdbs.time_stamp);
  231. /* Do nothing if we recently have sampled */
  232. if (delta_us < (s64)(od_tuners.sampling_rate / 2))
  233. sample = false;
  234. else
  235. dbs_info->cdbs.time_stamp = time_now;
  236. od_timer_update(dbs_info, sample, dw);
  237. mutex_unlock(&dbs_info->cdbs.timer_mutex);
  238. }
  239. static void od_dbs_timer(struct work_struct *work)
  240. {
  241. struct delayed_work *dw = to_delayed_work(work);
  242. struct od_cpu_dbs_info_s *dbs_info =
  243. container_of(work, struct od_cpu_dbs_info_s, cdbs.work.work);
  244. if (dbs_sw_coordinated_cpus(&dbs_info->cdbs)) {
  245. od_timer_coordinated(dbs_info, dw);
  246. } else {
  247. mutex_lock(&dbs_info->cdbs.timer_mutex);
  248. od_timer_update(dbs_info, true, dw);
  249. mutex_unlock(&dbs_info->cdbs.timer_mutex);
  250. }
  251. }
  252. /************************** sysfs interface ************************/
  253. static ssize_t show_sampling_rate_min(struct kobject *kobj,
  254. struct attribute *attr, char *buf)
  255. {
  256. return sprintf(buf, "%u\n", od_dbs_data.min_sampling_rate);
  257. }
  258. /**
  259. * update_sampling_rate - update sampling rate effective immediately if needed.
  260. * @new_rate: new sampling rate
  261. *
  262. * If new rate is smaller than the old, simply updaing
  263. * dbs_tuners_int.sampling_rate might not be appropriate. For example, if the
  264. * original sampling_rate was 1 second and the requested new sampling rate is 10
  265. * ms because the user needs immediate reaction from ondemand governor, but not
  266. * sure if higher frequency will be required or not, then, the governor may
  267. * change the sampling rate too late; up to 1 second later. Thus, if we are
  268. * reducing the sampling rate, we need to make the new value effective
  269. * immediately.
  270. */
  271. static void update_sampling_rate(unsigned int new_rate)
  272. {
  273. int cpu;
  274. od_tuners.sampling_rate = new_rate = max(new_rate,
  275. od_dbs_data.min_sampling_rate);
  276. for_each_online_cpu(cpu) {
  277. struct cpufreq_policy *policy;
  278. struct od_cpu_dbs_info_s *dbs_info;
  279. unsigned long next_sampling, appointed_at;
  280. policy = cpufreq_cpu_get(cpu);
  281. if (!policy)
  282. continue;
  283. if (policy->governor != &cpufreq_gov_ondemand) {
  284. cpufreq_cpu_put(policy);
  285. continue;
  286. }
  287. dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
  288. cpufreq_cpu_put(policy);
  289. mutex_lock(&dbs_info->cdbs.timer_mutex);
  290. if (!delayed_work_pending(&dbs_info->cdbs.work)) {
  291. mutex_unlock(&dbs_info->cdbs.timer_mutex);
  292. continue;
  293. }
  294. next_sampling = jiffies + usecs_to_jiffies(new_rate);
  295. appointed_at = dbs_info->cdbs.work.timer.expires;
  296. if (time_before(next_sampling, appointed_at)) {
  297. mutex_unlock(&dbs_info->cdbs.timer_mutex);
  298. cancel_delayed_work_sync(&dbs_info->cdbs.work);
  299. mutex_lock(&dbs_info->cdbs.timer_mutex);
  300. schedule_delayed_work_on(cpu, &dbs_info->cdbs.work,
  301. usecs_to_jiffies(new_rate));
  302. }
  303. mutex_unlock(&dbs_info->cdbs.timer_mutex);
  304. }
  305. }
  306. static ssize_t store_sampling_rate(struct kobject *a, struct attribute *b,
  307. const char *buf, size_t count)
  308. {
  309. unsigned int input;
  310. int ret;
  311. ret = sscanf(buf, "%u", &input);
  312. if (ret != 1)
  313. return -EINVAL;
  314. update_sampling_rate(input);
  315. return count;
  316. }
  317. static ssize_t store_io_is_busy(struct kobject *a, struct attribute *b,
  318. const char *buf, size_t count)
  319. {
  320. unsigned int input;
  321. int ret;
  322. ret = sscanf(buf, "%u", &input);
  323. if (ret != 1)
  324. return -EINVAL;
  325. od_tuners.io_is_busy = !!input;
  326. return count;
  327. }
  328. static ssize_t store_up_threshold(struct kobject *a, struct attribute *b,
  329. const char *buf, size_t count)
  330. {
  331. unsigned int input;
  332. int ret;
  333. ret = sscanf(buf, "%u", &input);
  334. if (ret != 1 || input > MAX_FREQUENCY_UP_THRESHOLD ||
  335. input < MIN_FREQUENCY_UP_THRESHOLD) {
  336. return -EINVAL;
  337. }
  338. od_tuners.up_threshold = input;
  339. return count;
  340. }
  341. static ssize_t store_sampling_down_factor(struct kobject *a,
  342. struct attribute *b, const char *buf, size_t count)
  343. {
  344. unsigned int input, j;
  345. int ret;
  346. ret = sscanf(buf, "%u", &input);
  347. if (ret != 1 || input > MAX_SAMPLING_DOWN_FACTOR || input < 1)
  348. return -EINVAL;
  349. od_tuners.sampling_down_factor = input;
  350. /* Reset down sampling multiplier in case it was active */
  351. for_each_online_cpu(j) {
  352. struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info,
  353. j);
  354. dbs_info->rate_mult = 1;
  355. }
  356. return count;
  357. }
  358. static ssize_t store_ignore_nice_load(struct kobject *a, struct attribute *b,
  359. const char *buf, size_t count)
  360. {
  361. unsigned int input;
  362. int ret;
  363. unsigned int j;
  364. ret = sscanf(buf, "%u", &input);
  365. if (ret != 1)
  366. return -EINVAL;
  367. if (input > 1)
  368. input = 1;
  369. if (input == od_tuners.ignore_nice) { /* nothing to do */
  370. return count;
  371. }
  372. od_tuners.ignore_nice = input;
  373. /* we need to re-evaluate prev_cpu_idle */
  374. for_each_online_cpu(j) {
  375. struct od_cpu_dbs_info_s *dbs_info;
  376. dbs_info = &per_cpu(od_cpu_dbs_info, j);
  377. dbs_info->cdbs.prev_cpu_idle = get_cpu_idle_time(j,
  378. &dbs_info->cdbs.prev_cpu_wall);
  379. if (od_tuners.ignore_nice)
  380. dbs_info->cdbs.prev_cpu_nice =
  381. kcpustat_cpu(j).cpustat[CPUTIME_NICE];
  382. }
  383. return count;
  384. }
  385. static ssize_t store_powersave_bias(struct kobject *a, struct attribute *b,
  386. const char *buf, size_t count)
  387. {
  388. unsigned int input;
  389. int ret;
  390. ret = sscanf(buf, "%u", &input);
  391. if (ret != 1)
  392. return -EINVAL;
  393. if (input > 1000)
  394. input = 1000;
  395. od_tuners.powersave_bias = input;
  396. ondemand_powersave_bias_init();
  397. return count;
  398. }
  399. show_one(od, sampling_rate, sampling_rate);
  400. show_one(od, io_is_busy, io_is_busy);
  401. show_one(od, up_threshold, up_threshold);
  402. show_one(od, sampling_down_factor, sampling_down_factor);
  403. show_one(od, ignore_nice_load, ignore_nice);
  404. show_one(od, powersave_bias, powersave_bias);
  405. define_one_global_rw(sampling_rate);
  406. define_one_global_rw(io_is_busy);
  407. define_one_global_rw(up_threshold);
  408. define_one_global_rw(sampling_down_factor);
  409. define_one_global_rw(ignore_nice_load);
  410. define_one_global_rw(powersave_bias);
  411. define_one_global_ro(sampling_rate_min);
  412. static struct attribute *dbs_attributes[] = {
  413. &sampling_rate_min.attr,
  414. &sampling_rate.attr,
  415. &up_threshold.attr,
  416. &sampling_down_factor.attr,
  417. &ignore_nice_load.attr,
  418. &powersave_bias.attr,
  419. &io_is_busy.attr,
  420. NULL
  421. };
  422. static struct attribute_group od_attr_group = {
  423. .attrs = dbs_attributes,
  424. .name = "ondemand",
  425. };
  426. /************************** sysfs end ************************/
  427. define_get_cpu_dbs_routines(od_cpu_dbs_info);
  428. static struct od_ops od_ops = {
  429. .io_busy = should_io_be_busy,
  430. .powersave_bias_init_cpu = ondemand_powersave_bias_init_cpu,
  431. .powersave_bias_target = powersave_bias_target,
  432. .freq_increase = dbs_freq_increase,
  433. };
  434. static struct dbs_data od_dbs_data = {
  435. .governor = GOV_ONDEMAND,
  436. .attr_group = &od_attr_group,
  437. .tuners = &od_tuners,
  438. .get_cpu_cdbs = get_cpu_cdbs,
  439. .get_cpu_dbs_info_s = get_cpu_dbs_info_s,
  440. .gov_dbs_timer = od_dbs_timer,
  441. .gov_check_cpu = od_check_cpu,
  442. .gov_ops = &od_ops,
  443. };
  444. static int od_cpufreq_governor_dbs(struct cpufreq_policy *policy,
  445. unsigned int event)
  446. {
  447. return cpufreq_governor_dbs(&od_dbs_data, policy, event);
  448. }
  449. #ifndef CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
  450. static
  451. #endif
  452. struct cpufreq_governor cpufreq_gov_ondemand = {
  453. .name = "ondemand",
  454. .governor = od_cpufreq_governor_dbs,
  455. .max_transition_latency = TRANSITION_LATENCY_LIMIT,
  456. .owner = THIS_MODULE,
  457. };
  458. static int __init cpufreq_gov_dbs_init(void)
  459. {
  460. u64 idle_time;
  461. int cpu = get_cpu();
  462. mutex_init(&od_dbs_data.mutex);
  463. idle_time = get_cpu_idle_time_us(cpu, NULL);
  464. put_cpu();
  465. if (idle_time != -1ULL) {
  466. /* Idle micro accounting is supported. Use finer thresholds */
  467. od_tuners.up_threshold = MICRO_FREQUENCY_UP_THRESHOLD;
  468. od_tuners.down_differential = MICRO_FREQUENCY_DOWN_DIFFERENTIAL;
  469. /*
  470. * In nohz/micro accounting case we set the minimum frequency
  471. * not depending on HZ, but fixed (very low). The deferred
  472. * timer might skip some samples if idle/sleeping as needed.
  473. */
  474. od_dbs_data.min_sampling_rate = MICRO_FREQUENCY_MIN_SAMPLE_RATE;
  475. } else {
  476. /* For correct statistics, we need 10 ticks for each measure */
  477. od_dbs_data.min_sampling_rate = MIN_SAMPLING_RATE_RATIO *
  478. jiffies_to_usecs(10);
  479. }
  480. return cpufreq_register_governor(&cpufreq_gov_ondemand);
  481. }
  482. static void __exit cpufreq_gov_dbs_exit(void)
  483. {
  484. cpufreq_unregister_governor(&cpufreq_gov_ondemand);
  485. }
  486. MODULE_AUTHOR("Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>");
  487. MODULE_AUTHOR("Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>");
  488. MODULE_DESCRIPTION("'cpufreq_ondemand' - A dynamic cpufreq governor for "
  489. "Low Latency Frequency Transition capable processors");
  490. MODULE_LICENSE("GPL");
  491. #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
  492. fs_initcall(cpufreq_gov_dbs_init);
  493. #else
  494. module_init(cpufreq_gov_dbs_init);
  495. #endif
  496. module_exit(cpufreq_gov_dbs_exit);