Lines Matching full:policy
17 struct cpufreq_policy *policy; member
81 if (!cpufreq_this_cpu_can_update(sg_policy->policy)) in sugov_should_update_freq()
119 * correlate frequency and compute capacity for a given cpufreq policy. We use
121 * @policy: the cpufreq policy of the CPU in question.
126 unsigned long get_capacity_ref_freq(struct cpufreq_policy *policy) in get_capacity_ref_freq() argument
128 unsigned int freq = arch_scale_freq_ref(policy->cpu); in get_capacity_ref_freq()
134 return policy->cpuinfo.max_freq; in get_capacity_ref_freq()
140 return policy->cur + (policy->cur >> 2); in get_capacity_ref_freq()
144 * get_next_freq - Compute a new frequency for a given cpufreq policy.
145 * @sg_policy: schedutil policy object to compute the new frequency for.
162 * next_freq (as calculated above) is returned, subject to policy min/max and
168 struct cpufreq_policy *policy = sg_policy->policy; in get_next_freq() local
171 freq = get_capacity_ref_freq(policy); in get_next_freq()
178 return cpufreq_driver_resolve_freq(policy, freq); in get_next_freq()
408 if (sg_policy->policy->fast_switch_enabled) { in sugov_update_single_freq()
409 cpufreq_driver_fast_switch(sg_policy->policy, next_f); in sugov_update_single_freq()
458 struct cpufreq_policy *policy = sg_policy->policy; in sugov_next_freq_shared() local
464 for_each_cpu(j, policy->cpus) { in sugov_next_freq_shared()
497 if (sg_policy->policy->fast_switch_enabled) in sugov_update_shared()
498 cpufreq_driver_fast_switch(sg_policy->policy, next_f); in sugov_update_shared()
528 __cpufreq_driver_target(sg_policy->policy, freq, CPUFREQ_RELATION_L); in sugov_work()
626 static struct sugov_policy *sugov_policy_alloc(struct cpufreq_policy *policy) in sugov_policy_alloc() argument
634 sg_policy->policy = policy; in sugov_policy_alloc()
661 struct cpufreq_policy *policy = sg_policy->policy; in sugov_kthread_create() local
665 if (policy->fast_switch_enabled) in sugov_kthread_create()
672 cpumask_first(policy->related_cpus)); in sugov_kthread_create()
686 kthread_bind_mask(thread, policy->related_cpus); in sugov_kthread_create()
698 if (sg_policy->policy->fast_switch_enabled) in sugov_kthread_stop()
725 static int sugov_init(struct cpufreq_policy *policy) in sugov_init() argument
732 if (policy->governor_data) in sugov_init()
735 cpufreq_enable_fast_switch(policy); in sugov_init()
737 sg_policy = sugov_policy_alloc(policy); in sugov_init()
754 policy->governor_data = sg_policy; in sugov_init()
767 tunables->rate_limit_us = cpufreq_policy_transition_delay_us(policy); in sugov_init()
769 policy->governor_data = sg_policy; in sugov_init()
773 get_governor_parent_kobj(policy), "%s", in sugov_init()
786 policy->governor_data = NULL; in sugov_init()
797 cpufreq_disable_fast_switch(policy); in sugov_init()
803 static void sugov_exit(struct cpufreq_policy *policy) in sugov_exit() argument
805 struct sugov_policy *sg_policy = policy->governor_data; in sugov_exit()
812 policy->governor_data = NULL; in sugov_exit()
820 cpufreq_disable_fast_switch(policy); in sugov_exit()
825 static int sugov_start(struct cpufreq_policy *policy) in sugov_start() argument
827 struct sugov_policy *sg_policy = policy->governor_data; in sugov_start()
840 if (policy_is_shared(policy)) in sugov_start()
842 else if (policy->fast_switch_enabled && cpufreq_driver_has_adjust_perf()) in sugov_start()
847 for_each_cpu(cpu, policy->cpus) { in sugov_start()
858 static void sugov_stop(struct cpufreq_policy *policy) in sugov_stop() argument
860 struct sugov_policy *sg_policy = policy->governor_data; in sugov_stop()
863 for_each_cpu(cpu, policy->cpus) in sugov_stop()
868 if (!policy->fast_switch_enabled) { in sugov_stop()
874 static void sugov_limits(struct cpufreq_policy *policy) in sugov_limits() argument
876 struct sugov_policy *sg_policy = policy->governor_data; in sugov_limits()
878 if (!policy->fast_switch_enabled) { in sugov_limits()
880 cpufreq_policy_apply_limits(policy); in sugov_limits()