cpufreq_schedutil.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. /*
  2. * CPUFreq governor based on scheduler-provided CPU utilization data.
  3. *
  4. * Copyright (C) 2016, Intel Corporation
  5. * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. */
  11. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  12. #include <linux/cpufreq.h>
  13. #include <linux/kthread.h>
  14. #include <uapi/linux/sched/types.h>
  15. #include <linux/slab.h>
  16. #include <trace/events/power.h>
  17. #include "sched.h"
  18. #define SUGOV_KTHREAD_PRIORITY 50
  19. struct sugov_tunables {
  20. struct gov_attr_set attr_set;
  21. unsigned int rate_limit_us;
  22. };
  23. struct sugov_policy {
  24. struct cpufreq_policy *policy;
  25. struct sugov_tunables *tunables;
  26. struct list_head tunables_hook;
  27. raw_spinlock_t update_lock; /* For shared policies */
  28. u64 last_freq_update_time;
  29. s64 freq_update_delay_ns;
  30. unsigned int next_freq;
  31. /* The next fields are only needed if fast switch cannot be used. */
  32. struct irq_work irq_work;
  33. struct kthread_work work;
  34. struct mutex work_lock;
  35. struct kthread_worker worker;
  36. struct task_struct *thread;
  37. bool work_in_progress;
  38. bool need_freq_update;
  39. };
  40. struct sugov_cpu {
  41. struct update_util_data update_util;
  42. struct sugov_policy *sg_policy;
  43. unsigned int cached_raw_freq;
  44. unsigned long iowait_boost;
  45. unsigned long iowait_boost_max;
  46. u64 last_update;
  47. /* The fields below are only needed when sharing a policy. */
  48. unsigned long util;
  49. unsigned long max;
  50. unsigned int flags;
  51. };
  52. static DEFINE_PER_CPU(struct sugov_cpu, sugov_cpu);
  53. /************************ Governor internals ***********************/
  54. static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)
  55. {
  56. s64 delta_ns;
  57. if (sg_policy->work_in_progress)
  58. return false;
  59. if (unlikely(sg_policy->need_freq_update)) {
  60. sg_policy->need_freq_update = false;
  61. /*
  62. * This happens when limits change, so forget the previous
  63. * next_freq value and force an update.
  64. */
  65. sg_policy->next_freq = UINT_MAX;
  66. return true;
  67. }
  68. delta_ns = time - sg_policy->last_freq_update_time;
  69. return delta_ns >= sg_policy->freq_update_delay_ns;
  70. }
  71. static void sugov_update_commit(struct sugov_policy *sg_policy, u64 time,
  72. unsigned int next_freq)
  73. {
  74. struct cpufreq_policy *policy = sg_policy->policy;
  75. sg_policy->last_freq_update_time = time;
  76. if (policy->fast_switch_enabled) {
  77. if (sg_policy->next_freq == next_freq) {
  78. trace_cpu_frequency(policy->cur, smp_processor_id());
  79. return;
  80. }
  81. sg_policy->next_freq = next_freq;
  82. next_freq = cpufreq_driver_fast_switch(policy, next_freq);
  83. if (next_freq == CPUFREQ_ENTRY_INVALID)
  84. return;
  85. policy->cur = next_freq;
  86. trace_cpu_frequency(next_freq, smp_processor_id());
  87. } else if (sg_policy->next_freq != next_freq) {
  88. sg_policy->next_freq = next_freq;
  89. sg_policy->work_in_progress = true;
  90. irq_work_queue(&sg_policy->irq_work);
  91. }
  92. }
  93. /**
  94. * get_next_freq - Compute a new frequency for a given cpufreq policy.
  95. * @sg_cpu: schedutil cpu object to compute the new frequency for.
  96. * @util: Current CPU utilization.
  97. * @max: CPU capacity.
  98. *
  99. * If the utilization is frequency-invariant, choose the new frequency to be
  100. * proportional to it, that is
  101. *
  102. * next_freq = C * max_freq * util / max
  103. *
  104. * Otherwise, approximate the would-be frequency-invariant utilization by
  105. * util_raw * (curr_freq / max_freq) which leads to
  106. *
  107. * next_freq = C * curr_freq * util_raw / max
  108. *
  109. * Take C = 1.25 for the frequency tipping point at (util / max) = 0.8.
  110. *
  111. * The lowest driver-supported frequency which is equal or greater than the raw
  112. * next_freq (as calculated above) is returned, subject to policy min/max and
  113. * cpufreq driver limitations.
  114. */
  115. static unsigned int get_next_freq(struct sugov_cpu *sg_cpu, unsigned long util,
  116. unsigned long max)
  117. {
  118. struct sugov_policy *sg_policy = sg_cpu->sg_policy;
  119. struct cpufreq_policy *policy = sg_policy->policy;
  120. unsigned int freq = arch_scale_freq_invariant() ?
  121. policy->cpuinfo.max_freq : policy->cur;
  122. freq = (freq + (freq >> 2)) * util / max;
  123. if (freq == sg_cpu->cached_raw_freq && sg_policy->next_freq != UINT_MAX)
  124. return sg_policy->next_freq;
  125. sg_cpu->cached_raw_freq = freq;
  126. return cpufreq_driver_resolve_freq(policy, freq);
  127. }
  128. static void sugov_get_util(unsigned long *util, unsigned long *max)
  129. {
  130. struct rq *rq = this_rq();
  131. unsigned long cfs_max;
  132. cfs_max = arch_scale_cpu_capacity(NULL, smp_processor_id());
  133. *util = min(rq->cfs.avg.util_avg, cfs_max);
  134. *max = cfs_max;
  135. }
  136. static void sugov_set_iowait_boost(struct sugov_cpu *sg_cpu, u64 time,
  137. unsigned int flags)
  138. {
  139. if (flags & SCHED_CPUFREQ_IOWAIT) {
  140. sg_cpu->iowait_boost = sg_cpu->iowait_boost_max;
  141. } else if (sg_cpu->iowait_boost) {
  142. s64 delta_ns = time - sg_cpu->last_update;
  143. /* Clear iowait_boost if the CPU apprears to have been idle. */
  144. if (delta_ns > TICK_NSEC)
  145. sg_cpu->iowait_boost = 0;
  146. }
  147. }
  148. static void sugov_iowait_boost(struct sugov_cpu *sg_cpu, unsigned long *util,
  149. unsigned long *max)
  150. {
  151. unsigned long boost_util = sg_cpu->iowait_boost;
  152. unsigned long boost_max = sg_cpu->iowait_boost_max;
  153. if (!boost_util)
  154. return;
  155. if (*util * boost_max < *max * boost_util) {
  156. *util = boost_util;
  157. *max = boost_max;
  158. }
  159. sg_cpu->iowait_boost >>= 1;
  160. }
  161. static void sugov_update_single(struct update_util_data *hook, u64 time,
  162. unsigned int flags)
  163. {
  164. struct sugov_cpu *sg_cpu = container_of(hook, struct sugov_cpu, update_util);
  165. struct sugov_policy *sg_policy = sg_cpu->sg_policy;
  166. struct cpufreq_policy *policy = sg_policy->policy;
  167. unsigned long util, max;
  168. unsigned int next_f;
  169. sugov_set_iowait_boost(sg_cpu, time, flags);
  170. sg_cpu->last_update = time;
  171. if (!sugov_should_update_freq(sg_policy, time))
  172. return;
  173. if (flags & SCHED_CPUFREQ_RT_DL) {
  174. next_f = policy->cpuinfo.max_freq;
  175. } else {
  176. sugov_get_util(&util, &max);
  177. sugov_iowait_boost(sg_cpu, &util, &max);
  178. next_f = get_next_freq(sg_cpu, util, max);
  179. }
  180. sugov_update_commit(sg_policy, time, next_f);
  181. }
  182. static unsigned int sugov_next_freq_shared(struct sugov_cpu *sg_cpu,
  183. unsigned long util, unsigned long max,
  184. unsigned int flags)
  185. {
  186. struct sugov_policy *sg_policy = sg_cpu->sg_policy;
  187. struct cpufreq_policy *policy = sg_policy->policy;
  188. unsigned int max_f = policy->cpuinfo.max_freq;
  189. u64 last_freq_update_time = sg_policy->last_freq_update_time;
  190. unsigned int j;
  191. if (flags & SCHED_CPUFREQ_RT_DL)
  192. return max_f;
  193. sugov_iowait_boost(sg_cpu, &util, &max);
  194. for_each_cpu(j, policy->cpus) {
  195. struct sugov_cpu *j_sg_cpu;
  196. unsigned long j_util, j_max;
  197. s64 delta_ns;
  198. if (j == smp_processor_id())
  199. continue;
  200. j_sg_cpu = &per_cpu(sugov_cpu, j);
  201. /*
  202. * If the CPU utilization was last updated before the previous
  203. * frequency update and the time elapsed between the last update
  204. * of the CPU utilization and the last frequency update is long
  205. * enough, don't take the CPU into account as it probably is
  206. * idle now (and clear iowait_boost for it).
  207. */
  208. delta_ns = last_freq_update_time - j_sg_cpu->last_update;
  209. if (delta_ns > TICK_NSEC) {
  210. j_sg_cpu->iowait_boost = 0;
  211. continue;
  212. }
  213. if (j_sg_cpu->flags & SCHED_CPUFREQ_RT_DL)
  214. return max_f;
  215. j_util = j_sg_cpu->util;
  216. j_max = j_sg_cpu->max;
  217. if (j_util * max > j_max * util) {
  218. util = j_util;
  219. max = j_max;
  220. }
  221. sugov_iowait_boost(j_sg_cpu, &util, &max);
  222. }
  223. return get_next_freq(sg_cpu, util, max);
  224. }
  225. static void sugov_update_shared(struct update_util_data *hook, u64 time,
  226. unsigned int flags)
  227. {
  228. struct sugov_cpu *sg_cpu = container_of(hook, struct sugov_cpu, update_util);
  229. struct sugov_policy *sg_policy = sg_cpu->sg_policy;
  230. unsigned long util, max;
  231. unsigned int next_f;
  232. sugov_get_util(&util, &max);
  233. raw_spin_lock(&sg_policy->update_lock);
  234. sg_cpu->util = util;
  235. sg_cpu->max = max;
  236. sg_cpu->flags = flags;
  237. sugov_set_iowait_boost(sg_cpu, time, flags);
  238. sg_cpu->last_update = time;
  239. if (sugov_should_update_freq(sg_policy, time)) {
  240. next_f = sugov_next_freq_shared(sg_cpu, util, max, flags);
  241. sugov_update_commit(sg_policy, time, next_f);
  242. }
  243. raw_spin_unlock(&sg_policy->update_lock);
  244. }
  245. static void sugov_work(struct kthread_work *work)
  246. {
  247. struct sugov_policy *sg_policy = container_of(work, struct sugov_policy, work);
  248. mutex_lock(&sg_policy->work_lock);
  249. __cpufreq_driver_target(sg_policy->policy, sg_policy->next_freq,
  250. CPUFREQ_RELATION_L);
  251. mutex_unlock(&sg_policy->work_lock);
  252. sg_policy->work_in_progress = false;
  253. }
  254. static void sugov_irq_work(struct irq_work *irq_work)
  255. {
  256. struct sugov_policy *sg_policy;
  257. sg_policy = container_of(irq_work, struct sugov_policy, irq_work);
  258. /*
  259. * For RT and deadline tasks, the schedutil governor shoots the
  260. * frequency to maximum. Special care must be taken to ensure that this
  261. * kthread doesn't result in the same behavior.
  262. *
  263. * This is (mostly) guaranteed by the work_in_progress flag. The flag is
  264. * updated only at the end of the sugov_work() function and before that
  265. * the schedutil governor rejects all other frequency scaling requests.
  266. *
  267. * There is a very rare case though, where the RT thread yields right
  268. * after the work_in_progress flag is cleared. The effects of that are
  269. * neglected for now.
  270. */
  271. kthread_queue_work(&sg_policy->worker, &sg_policy->work);
  272. }
  273. /************************** sysfs interface ************************/
  274. static struct sugov_tunables *global_tunables;
  275. static DEFINE_MUTEX(global_tunables_lock);
  276. static inline struct sugov_tunables *to_sugov_tunables(struct gov_attr_set *attr_set)
  277. {
  278. return container_of(attr_set, struct sugov_tunables, attr_set);
  279. }
  280. static ssize_t rate_limit_us_show(struct gov_attr_set *attr_set, char *buf)
  281. {
  282. struct sugov_tunables *tunables = to_sugov_tunables(attr_set);
  283. return sprintf(buf, "%u\n", tunables->rate_limit_us);
  284. }
  285. static ssize_t rate_limit_us_store(struct gov_attr_set *attr_set, const char *buf,
  286. size_t count)
  287. {
  288. struct sugov_tunables *tunables = to_sugov_tunables(attr_set);
  289. struct sugov_policy *sg_policy;
  290. unsigned int rate_limit_us;
  291. if (kstrtouint(buf, 10, &rate_limit_us))
  292. return -EINVAL;
  293. tunables->rate_limit_us = rate_limit_us;
  294. list_for_each_entry(sg_policy, &attr_set->policy_list, tunables_hook)
  295. sg_policy->freq_update_delay_ns = rate_limit_us * NSEC_PER_USEC;
  296. return count;
  297. }
  298. static struct governor_attr rate_limit_us = __ATTR_RW(rate_limit_us);
  299. static struct attribute *sugov_attributes[] = {
  300. &rate_limit_us.attr,
  301. NULL
  302. };
  303. static struct kobj_type sugov_tunables_ktype = {
  304. .default_attrs = sugov_attributes,
  305. .sysfs_ops = &governor_sysfs_ops,
  306. };
  307. /********************** cpufreq governor interface *********************/
  308. static struct cpufreq_governor schedutil_gov;
  309. static struct sugov_policy *sugov_policy_alloc(struct cpufreq_policy *policy)
  310. {
  311. struct sugov_policy *sg_policy;
  312. sg_policy = kzalloc(sizeof(*sg_policy), GFP_KERNEL);
  313. if (!sg_policy)
  314. return NULL;
  315. sg_policy->policy = policy;
  316. raw_spin_lock_init(&sg_policy->update_lock);
  317. return sg_policy;
  318. }
  319. static void sugov_policy_free(struct sugov_policy *sg_policy)
  320. {
  321. kfree(sg_policy);
  322. }
  323. static int sugov_kthread_create(struct sugov_policy *sg_policy)
  324. {
  325. struct task_struct *thread;
  326. struct sched_param param = { .sched_priority = MAX_USER_RT_PRIO / 2 };
  327. struct cpufreq_policy *policy = sg_policy->policy;
  328. int ret;
  329. /* kthread only required for slow path */
  330. if (policy->fast_switch_enabled)
  331. return 0;
  332. kthread_init_work(&sg_policy->work, sugov_work);
  333. kthread_init_worker(&sg_policy->worker);
  334. thread = kthread_create(kthread_worker_fn, &sg_policy->worker,
  335. "sugov:%d",
  336. cpumask_first(policy->related_cpus));
  337. if (IS_ERR(thread)) {
  338. pr_err("failed to create sugov thread: %ld\n", PTR_ERR(thread));
  339. return PTR_ERR(thread);
  340. }
  341. ret = sched_setscheduler_nocheck(thread, SCHED_FIFO, &param);
  342. if (ret) {
  343. kthread_stop(thread);
  344. pr_warn("%s: failed to set SCHED_FIFO\n", __func__);
  345. return ret;
  346. }
  347. sg_policy->thread = thread;
  348. kthread_bind_mask(thread, policy->related_cpus);
  349. init_irq_work(&sg_policy->irq_work, sugov_irq_work);
  350. mutex_init(&sg_policy->work_lock);
  351. wake_up_process(thread);
  352. return 0;
  353. }
  354. static void sugov_kthread_stop(struct sugov_policy *sg_policy)
  355. {
  356. /* kthread only required for slow path */
  357. if (sg_policy->policy->fast_switch_enabled)
  358. return;
  359. kthread_flush_worker(&sg_policy->worker);
  360. kthread_stop(sg_policy->thread);
  361. mutex_destroy(&sg_policy->work_lock);
  362. }
  363. static struct sugov_tunables *sugov_tunables_alloc(struct sugov_policy *sg_policy)
  364. {
  365. struct sugov_tunables *tunables;
  366. tunables = kzalloc(sizeof(*tunables), GFP_KERNEL);
  367. if (tunables) {
  368. gov_attr_set_init(&tunables->attr_set, &sg_policy->tunables_hook);
  369. if (!have_governor_per_policy())
  370. global_tunables = tunables;
  371. }
  372. return tunables;
  373. }
  374. static void sugov_tunables_free(struct sugov_tunables *tunables)
  375. {
  376. if (!have_governor_per_policy())
  377. global_tunables = NULL;
  378. kfree(tunables);
  379. }
  380. static int sugov_init(struct cpufreq_policy *policy)
  381. {
  382. struct sugov_policy *sg_policy;
  383. struct sugov_tunables *tunables;
  384. unsigned int lat;
  385. int ret = 0;
  386. /* State should be equivalent to EXIT */
  387. if (policy->governor_data)
  388. return -EBUSY;
  389. cpufreq_enable_fast_switch(policy);
  390. sg_policy = sugov_policy_alloc(policy);
  391. if (!sg_policy) {
  392. ret = -ENOMEM;
  393. goto disable_fast_switch;
  394. }
  395. ret = sugov_kthread_create(sg_policy);
  396. if (ret)
  397. goto free_sg_policy;
  398. mutex_lock(&global_tunables_lock);
  399. if (global_tunables) {
  400. if (WARN_ON(have_governor_per_policy())) {
  401. ret = -EINVAL;
  402. goto stop_kthread;
  403. }
  404. policy->governor_data = sg_policy;
  405. sg_policy->tunables = global_tunables;
  406. gov_attr_set_get(&global_tunables->attr_set, &sg_policy->tunables_hook);
  407. goto out;
  408. }
  409. tunables = sugov_tunables_alloc(sg_policy);
  410. if (!tunables) {
  411. ret = -ENOMEM;
  412. goto stop_kthread;
  413. }
  414. tunables->rate_limit_us = LATENCY_MULTIPLIER;
  415. lat = policy->cpuinfo.transition_latency / NSEC_PER_USEC;
  416. if (lat)
  417. tunables->rate_limit_us *= lat;
  418. policy->governor_data = sg_policy;
  419. sg_policy->tunables = tunables;
  420. ret = kobject_init_and_add(&tunables->attr_set.kobj, &sugov_tunables_ktype,
  421. get_governor_parent_kobj(policy), "%s",
  422. schedutil_gov.name);
  423. if (ret)
  424. goto fail;
  425. out:
  426. mutex_unlock(&global_tunables_lock);
  427. return 0;
  428. fail:
  429. policy->governor_data = NULL;
  430. sugov_tunables_free(tunables);
  431. stop_kthread:
  432. sugov_kthread_stop(sg_policy);
  433. free_sg_policy:
  434. mutex_unlock(&global_tunables_lock);
  435. sugov_policy_free(sg_policy);
  436. disable_fast_switch:
  437. cpufreq_disable_fast_switch(policy);
  438. pr_err("initialization failed (error %d)\n", ret);
  439. return ret;
  440. }
  441. static void sugov_exit(struct cpufreq_policy *policy)
  442. {
  443. struct sugov_policy *sg_policy = policy->governor_data;
  444. struct sugov_tunables *tunables = sg_policy->tunables;
  445. unsigned int count;
  446. mutex_lock(&global_tunables_lock);
  447. count = gov_attr_set_put(&tunables->attr_set, &sg_policy->tunables_hook);
  448. policy->governor_data = NULL;
  449. if (!count)
  450. sugov_tunables_free(tunables);
  451. mutex_unlock(&global_tunables_lock);
  452. sugov_kthread_stop(sg_policy);
  453. sugov_policy_free(sg_policy);
  454. cpufreq_disable_fast_switch(policy);
  455. }
  456. static int sugov_start(struct cpufreq_policy *policy)
  457. {
  458. struct sugov_policy *sg_policy = policy->governor_data;
  459. unsigned int cpu;
  460. sg_policy->freq_update_delay_ns = sg_policy->tunables->rate_limit_us * NSEC_PER_USEC;
  461. sg_policy->last_freq_update_time = 0;
  462. sg_policy->next_freq = UINT_MAX;
  463. sg_policy->work_in_progress = false;
  464. sg_policy->need_freq_update = false;
  465. for_each_cpu(cpu, policy->cpus) {
  466. struct sugov_cpu *sg_cpu = &per_cpu(sugov_cpu, cpu);
  467. sg_cpu->sg_policy = sg_policy;
  468. if (policy_is_shared(policy)) {
  469. sg_cpu->util = 0;
  470. sg_cpu->max = 0;
  471. sg_cpu->flags = SCHED_CPUFREQ_RT;
  472. sg_cpu->last_update = 0;
  473. sg_cpu->cached_raw_freq = 0;
  474. sg_cpu->iowait_boost = 0;
  475. sg_cpu->iowait_boost_max = policy->cpuinfo.max_freq;
  476. cpufreq_add_update_util_hook(cpu, &sg_cpu->update_util,
  477. sugov_update_shared);
  478. } else {
  479. cpufreq_add_update_util_hook(cpu, &sg_cpu->update_util,
  480. sugov_update_single);
  481. }
  482. }
  483. return 0;
  484. }
  485. static void sugov_stop(struct cpufreq_policy *policy)
  486. {
  487. struct sugov_policy *sg_policy = policy->governor_data;
  488. unsigned int cpu;
  489. for_each_cpu(cpu, policy->cpus)
  490. cpufreq_remove_update_util_hook(cpu);
  491. synchronize_sched();
  492. if (!policy->fast_switch_enabled) {
  493. irq_work_sync(&sg_policy->irq_work);
  494. kthread_cancel_work_sync(&sg_policy->work);
  495. }
  496. }
  497. static void sugov_limits(struct cpufreq_policy *policy)
  498. {
  499. struct sugov_policy *sg_policy = policy->governor_data;
  500. if (!policy->fast_switch_enabled) {
  501. mutex_lock(&sg_policy->work_lock);
  502. cpufreq_policy_apply_limits(policy);
  503. mutex_unlock(&sg_policy->work_lock);
  504. }
  505. sg_policy->need_freq_update = true;
  506. }
  507. static struct cpufreq_governor schedutil_gov = {
  508. .name = "schedutil",
  509. .owner = THIS_MODULE,
  510. .init = sugov_init,
  511. .exit = sugov_exit,
  512. .start = sugov_start,
  513. .stop = sugov_stop,
  514. .limits = sugov_limits,
  515. };
  516. #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL
  517. struct cpufreq_governor *cpufreq_default_governor(void)
  518. {
  519. return &schedutil_gov;
  520. }
  521. #endif
  522. static int __init sugov_register(void)
  523. {
  524. return cpufreq_register_governor(&schedutil_gov);
  525. }
  526. fs_initcall(sugov_register);