• Home
  • Raw
  • Download

Lines Matching refs:tunables

127 	struct cpufreq_interactive_tunables *tunables =  in cpufreq_interactive_timer_resched()  local
136 tunables->io_is_busy); in cpufreq_interactive_timer_resched()
139 expires = jiffies + usecs_to_jiffies(tunables->timer_rate); in cpufreq_interactive_timer_resched()
142 if (tunables->timer_slack_val >= 0 && in cpufreq_interactive_timer_resched()
144 expires += usecs_to_jiffies(tunables->timer_slack_val); in cpufreq_interactive_timer_resched()
156 struct cpufreq_interactive_tunables *tunables, int cpu) in cpufreq_interactive_timer_start() argument
160 usecs_to_jiffies(tunables->timer_rate); in cpufreq_interactive_timer_start()
165 if (tunables->timer_slack_val >= 0 && in cpufreq_interactive_timer_start()
167 expires += usecs_to_jiffies(tunables->timer_slack_val); in cpufreq_interactive_timer_start()
175 tunables->io_is_busy); in cpufreq_interactive_timer_start()
182 struct cpufreq_interactive_tunables *tunables, in freq_to_above_hispeed_delay() argument
189 spin_lock_irqsave(&tunables->above_hispeed_delay_lock, flags); in freq_to_above_hispeed_delay()
191 for (i = 0; i < tunables->nabove_hispeed_delay - 1 && in freq_to_above_hispeed_delay()
192 freq >= tunables->above_hispeed_delay[i+1]; i += 2) in freq_to_above_hispeed_delay()
195 ret = tunables->above_hispeed_delay[i]; in freq_to_above_hispeed_delay()
196 spin_unlock_irqrestore(&tunables->above_hispeed_delay_lock, flags); in freq_to_above_hispeed_delay()
201 struct cpufreq_interactive_tunables *tunables, unsigned int freq) in freq_to_targetload() argument
207 spin_lock_irqsave(&tunables->target_loads_lock, flags); in freq_to_targetload()
209 for (i = 0; i < tunables->ntarget_loads - 1 && in freq_to_targetload()
210 freq >= tunables->target_loads[i+1]; i += 2) in freq_to_targetload()
213 ret = tunables->target_loads[i]; in freq_to_targetload()
214 spin_unlock_irqrestore(&tunables->target_loads_lock, flags); in freq_to_targetload()
311 struct cpufreq_interactive_tunables *tunables = in update_load() local
319 now_idle = get_cpu_idle_time(cpu, &now, tunables->io_is_busy); in update_load()
343 struct cpufreq_interactive_tunables *tunables = in cpufreq_interactive_timer() local
369 tunables->boosted = tunables->boost_val || now < tunables->boostpulse_endtime; in cpufreq_interactive_timer()
371 if (cpu_load >= tunables->go_hispeed_load || tunables->boosted) { in cpufreq_interactive_timer()
372 if (pcpu->policy->cur < tunables->hispeed_freq) { in cpufreq_interactive_timer()
373 new_freq = tunables->hispeed_freq; in cpufreq_interactive_timer()
377 if (new_freq < tunables->hispeed_freq) in cpufreq_interactive_timer()
378 new_freq = tunables->hispeed_freq; in cpufreq_interactive_timer()
382 if (new_freq > tunables->hispeed_freq && in cpufreq_interactive_timer()
383 pcpu->policy->cur < tunables->hispeed_freq) in cpufreq_interactive_timer()
384 new_freq = tunables->hispeed_freq; in cpufreq_interactive_timer()
387 if (pcpu->policy->cur >= tunables->hispeed_freq && in cpufreq_interactive_timer()
390 freq_to_above_hispeed_delay(tunables, pcpu->policy->cur)) { in cpufreq_interactive_timer()
416 if (now - max_fvtime < tunables->min_sample_time) { in cpufreq_interactive_timer()
433 if (!tunables->boosted || new_freq > tunables->hispeed_freq) { in cpufreq_interactive_timer()
569 static void cpufreq_interactive_boost(struct cpufreq_interactive_tunables *tunables) in cpufreq_interactive_boost() argument
576 tunables->boosted = true; in cpufreq_interactive_boost()
582 if (tunables != pcpu->policy->governor_data) in cpufreq_interactive_boost()
586 if (pcpu->target_freq < tunables->hispeed_freq) { in cpufreq_interactive_boost()
587 pcpu->target_freq = tunables->hispeed_freq; in cpufreq_interactive_boost()
692 struct cpufreq_interactive_tunables *tunables, in show_target_loads() argument
699 spin_lock_irqsave(&tunables->target_loads_lock, flags); in show_target_loads()
701 for (i = 0; i < tunables->ntarget_loads; i++) in show_target_loads()
702 ret += sprintf(buf + ret, "%u%s", tunables->target_loads[i], in show_target_loads()
706 spin_unlock_irqrestore(&tunables->target_loads_lock, flags); in show_target_loads()
711 struct cpufreq_interactive_tunables *tunables, in store_target_loads() argument
722 spin_lock_irqsave(&tunables->target_loads_lock, flags); in store_target_loads()
723 if (tunables->target_loads != default_target_loads) in store_target_loads()
724 kfree(tunables->target_loads); in store_target_loads()
725 tunables->target_loads = new_target_loads; in store_target_loads()
726 tunables->ntarget_loads = ntokens; in store_target_loads()
727 spin_unlock_irqrestore(&tunables->target_loads_lock, flags); in store_target_loads()
732 struct cpufreq_interactive_tunables *tunables, char *buf) in show_above_hispeed_delay() argument
738 spin_lock_irqsave(&tunables->above_hispeed_delay_lock, flags); in show_above_hispeed_delay()
740 for (i = 0; i < tunables->nabove_hispeed_delay; i++) in show_above_hispeed_delay()
742 tunables->above_hispeed_delay[i], in show_above_hispeed_delay()
746 spin_unlock_irqrestore(&tunables->above_hispeed_delay_lock, flags); in show_above_hispeed_delay()
751 struct cpufreq_interactive_tunables *tunables, in store_above_hispeed_delay() argument
762 spin_lock_irqsave(&tunables->above_hispeed_delay_lock, flags); in store_above_hispeed_delay()
763 if (tunables->above_hispeed_delay != default_above_hispeed_delay) in store_above_hispeed_delay()
764 kfree(tunables->above_hispeed_delay); in store_above_hispeed_delay()
765 tunables->above_hispeed_delay = new_above_hispeed_delay; in store_above_hispeed_delay()
766 tunables->nabove_hispeed_delay = ntokens; in store_above_hispeed_delay()
767 spin_unlock_irqrestore(&tunables->above_hispeed_delay_lock, flags); in store_above_hispeed_delay()
772 static ssize_t show_hispeed_freq(struct cpufreq_interactive_tunables *tunables, in show_hispeed_freq() argument
775 return sprintf(buf, "%u\n", tunables->hispeed_freq); in show_hispeed_freq()
778 static ssize_t store_hispeed_freq(struct cpufreq_interactive_tunables *tunables, in store_hispeed_freq() argument
787 tunables->hispeed_freq = val; in store_hispeed_freq()
792 *tunables, char *buf) in show_go_hispeed_load()
794 return sprintf(buf, "%lu\n", tunables->go_hispeed_load); in show_go_hispeed_load()
798 *tunables, const char *buf, size_t count) in store_go_hispeed_load()
806 tunables->go_hispeed_load = val; in store_go_hispeed_load()
811 *tunables, char *buf) in show_min_sample_time()
813 return sprintf(buf, "%lu\n", tunables->min_sample_time); in show_min_sample_time()
817 *tunables, const char *buf, size_t count) in store_min_sample_time()
825 tunables->min_sample_time = val; in store_min_sample_time()
829 static ssize_t show_timer_rate(struct cpufreq_interactive_tunables *tunables, in show_timer_rate() argument
832 return sprintf(buf, "%lu\n", tunables->timer_rate); in show_timer_rate()
835 static ssize_t store_timer_rate(struct cpufreq_interactive_tunables *tunables, in store_timer_rate() argument
850 tunables->timer_rate = val_round; in store_timer_rate()
854 static ssize_t show_timer_slack(struct cpufreq_interactive_tunables *tunables, in show_timer_slack() argument
857 return sprintf(buf, "%d\n", tunables->timer_slack_val); in show_timer_slack()
860 static ssize_t store_timer_slack(struct cpufreq_interactive_tunables *tunables, in store_timer_slack() argument
870 tunables->timer_slack_val = val; in store_timer_slack()
874 static ssize_t show_boost(struct cpufreq_interactive_tunables *tunables, in show_boost() argument
877 return sprintf(buf, "%d\n", tunables->boost_val); in show_boost()
880 static ssize_t store_boost(struct cpufreq_interactive_tunables *tunables, in store_boost() argument
890 tunables->boost_val = val; in store_boost()
892 if (tunables->boost_val) { in store_boost()
894 if (!tunables->boosted) in store_boost()
895 cpufreq_interactive_boost(tunables); in store_boost()
897 tunables->boostpulse_endtime = ktime_to_us(ktime_get()); in store_boost()
904 static ssize_t store_boostpulse(struct cpufreq_interactive_tunables *tunables, in store_boostpulse() argument
914 tunables->boostpulse_endtime = ktime_to_us(ktime_get()) + in store_boostpulse()
915 tunables->boostpulse_duration_val; in store_boostpulse()
917 if (!tunables->boosted) in store_boostpulse()
918 cpufreq_interactive_boost(tunables); in store_boostpulse()
923 *tunables, char *buf) in show_boostpulse_duration()
925 return sprintf(buf, "%d\n", tunables->boostpulse_duration_val); in show_boostpulse_duration()
929 *tunables, const char *buf, size_t count) in store_boostpulse_duration()
938 tunables->boostpulse_duration_val = val; in store_boostpulse_duration()
942 static ssize_t show_io_is_busy(struct cpufreq_interactive_tunables *tunables, in show_io_is_busy() argument
945 return sprintf(buf, "%u\n", tunables->io_is_busy); in show_io_is_busy()
948 static ssize_t store_io_is_busy(struct cpufreq_interactive_tunables *tunables, in store_io_is_busy() argument
957 tunables->io_is_busy = val; in store_io_is_busy()
1109 struct cpufreq_interactive_tunables *tunables; in cpufreq_governor_interactive() local
1113 tunables = policy->governor_data; in cpufreq_governor_interactive()
1115 tunables = common_tunables; in cpufreq_governor_interactive()
1117 WARN_ON(!tunables && (event != CPUFREQ_GOV_POLICY_INIT)); in cpufreq_governor_interactive()
1122 WARN_ON(tunables); in cpufreq_governor_interactive()
1123 } else if (tunables) { in cpufreq_governor_interactive()
1124 tunables->usage_count++; in cpufreq_governor_interactive()
1125 policy->governor_data = tunables; in cpufreq_governor_interactive()
1129 tunables = kzalloc(sizeof(*tunables), GFP_KERNEL); in cpufreq_governor_interactive()
1130 if (!tunables) { in cpufreq_governor_interactive()
1135 tunables->usage_count = 1; in cpufreq_governor_interactive()
1136 tunables->above_hispeed_delay = default_above_hispeed_delay; in cpufreq_governor_interactive()
1137 tunables->nabove_hispeed_delay = in cpufreq_governor_interactive()
1139 tunables->go_hispeed_load = DEFAULT_GO_HISPEED_LOAD; in cpufreq_governor_interactive()
1140 tunables->target_loads = default_target_loads; in cpufreq_governor_interactive()
1141 tunables->ntarget_loads = ARRAY_SIZE(default_target_loads); in cpufreq_governor_interactive()
1142 tunables->min_sample_time = DEFAULT_MIN_SAMPLE_TIME; in cpufreq_governor_interactive()
1143 tunables->timer_rate = DEFAULT_TIMER_RATE; in cpufreq_governor_interactive()
1144 tunables->boostpulse_duration_val = DEFAULT_MIN_SAMPLE_TIME; in cpufreq_governor_interactive()
1145 tunables->timer_slack_val = DEFAULT_TIMER_SLACK; in cpufreq_governor_interactive()
1147 spin_lock_init(&tunables->target_loads_lock); in cpufreq_governor_interactive()
1148 spin_lock_init(&tunables->above_hispeed_delay_lock); in cpufreq_governor_interactive()
1150 policy->governor_data = tunables; in cpufreq_governor_interactive()
1152 common_tunables = tunables; in cpufreq_governor_interactive()
1159 kfree(tunables); in cpufreq_governor_interactive()
1177 if (!--tunables->usage_count) { in cpufreq_governor_interactive()
1190 kfree(tunables); in cpufreq_governor_interactive()
1201 if (!tunables->hispeed_freq) in cpufreq_governor_interactive()
1202 tunables->hispeed_freq = policy->max; in cpufreq_governor_interactive()
1218 cpufreq_interactive_timer_start(tunables, j); in cpufreq_governor_interactive()