Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 1 | /* |
| 2 | * drivers/cpufreq/cpufreq_interactive.c |
| 3 | * |
| 4 | * Copyright (C) 2010 Google, Inc. |
| 5 | * |
| 6 | * This software is licensed under the terms of the GNU General Public |
| 7 | * License version 2, as published by the Free Software Foundation, and |
| 8 | * may be copied, distributed, and modified under those terms. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * Author: Mike Chan (mike@android.com) |
| 16 | * |
| 17 | */ |
| 18 | |
| 19 | #include <linux/cpu.h> |
| 20 | #include <linux/cpumask.h> |
| 21 | #include <linux/cpufreq.h> |
| 22 | #include <linux/module.h> |
| 23 | #include <linux/mutex.h> |
| 24 | #include <linux/sched.h> |
| 25 | #include <linux/tick.h> |
| 26 | #include <linux/time.h> |
| 27 | #include <linux/timer.h> |
| 28 | #include <linux/workqueue.h> |
| 29 | #include <linux/kthread.h> |
| 30 | #include <linux/mutex.h> |
Todd Poynor | 7820a65 | 2012-04-02 17:17:14 -0700 | [diff] [blame] | 31 | #include <linux/slab.h> |
Todd Poynor | 9fb1531 | 2012-04-23 20:42:41 -0700 | [diff] [blame] | 32 | #include <asm/cputime.h> |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 33 | |
Todd Poynor | a1e1951 | 2012-02-16 16:27:59 -0800 | [diff] [blame] | 34 | #define CREATE_TRACE_POINTS |
| 35 | #include <trace/events/cpufreq_interactive.h> |
| 36 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 37 | static atomic_t active_count = ATOMIC_INIT(0); |
| 38 | |
| 39 | struct cpufreq_interactive_cpuinfo { |
| 40 | struct timer_list cpu_timer; |
| 41 | int timer_idlecancel; |
| 42 | u64 time_in_idle; |
| 43 | u64 idle_exit_time; |
Todd Poynor | 0a92d48 | 2012-04-06 19:59:36 -0700 | [diff] [blame] | 44 | u64 target_set_time; |
| 45 | u64 target_set_time_in_idle; |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 46 | struct cpufreq_policy *policy; |
| 47 | struct cpufreq_frequency_table *freq_table; |
| 48 | unsigned int target_freq; |
Todd Poynor | aad2732 | 2012-04-26 21:41:40 -0700 | [diff] [blame] | 49 | unsigned int floor_freq; |
| 50 | u64 floor_validate_time; |
Todd Poynor | 5a5aa70 | 2012-05-10 23:28:06 -0700 | [diff] [blame] | 51 | u64 hispeed_validate_time; |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 52 | int governor_enabled; |
| 53 | }; |
| 54 | |
| 55 | static DEFINE_PER_CPU(struct cpufreq_interactive_cpuinfo, cpuinfo); |
| 56 | |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 57 | /* realtime thread handles frequency scaling */ |
| 58 | static struct task_struct *speedchange_task; |
| 59 | static cpumask_t speedchange_cpumask; |
| 60 | static spinlock_t speedchange_cpumask_lock; |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 61 | |
| 62 | /* Hi speed to bump to from lo speed when load burst (default max) */ |
Todd Poynor | f090ef0 | 2012-10-03 00:39:56 -0700 | [diff] [blame] | 63 | static unsigned int hispeed_freq; |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 64 | |
| 65 | /* Go to hi speed when CPU load at or above this value. */ |
Todd Poynor | a0ec436 | 2012-04-17 17:39:34 -0700 | [diff] [blame] | 66 | #define DEFAULT_GO_HISPEED_LOAD 85 |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 67 | static unsigned long go_hispeed_load; |
| 68 | |
| 69 | /* |
| 70 | * The minimum amount of time to spend at a frequency before we can ramp down. |
| 71 | */ |
Todd Poynor | a0ec436 | 2012-04-17 17:39:34 -0700 | [diff] [blame] | 72 | #define DEFAULT_MIN_SAMPLE_TIME (80 * USEC_PER_MSEC) |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 73 | static unsigned long min_sample_time; |
| 74 | |
| 75 | /* |
| 76 | * The sample rate of the timer used to increase frequency |
| 77 | */ |
Todd Poynor | a0ec436 | 2012-04-17 17:39:34 -0700 | [diff] [blame] | 78 | #define DEFAULT_TIMER_RATE (20 * USEC_PER_MSEC) |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 79 | static unsigned long timer_rate; |
| 80 | |
Todd Poynor | 596cf1f | 2012-04-13 20:18:02 -0700 | [diff] [blame] | 81 | /* |
| 82 | * Wait this long before raising speed above hispeed, by default a single |
| 83 | * timer interval. |
| 84 | */ |
| 85 | #define DEFAULT_ABOVE_HISPEED_DELAY DEFAULT_TIMER_RATE |
| 86 | static unsigned long above_hispeed_delay_val; |
| 87 | |
Todd Poynor | 7820a65 | 2012-04-02 17:17:14 -0700 | [diff] [blame] | 88 | /* |
Todd Poynor | 9fb1531 | 2012-04-23 20:42:41 -0700 | [diff] [blame] | 89 | * Non-zero means longer-term speed boost active. |
| 90 | */ |
| 91 | |
| 92 | static int boost_val; |
| 93 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 94 | static int cpufreq_governor_interactive(struct cpufreq_policy *policy, |
| 95 | unsigned int event); |
| 96 | |
| 97 | #ifndef CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE |
| 98 | static |
| 99 | #endif |
| 100 | struct cpufreq_governor cpufreq_gov_interactive = { |
| 101 | .name = "interactive", |
| 102 | .governor = cpufreq_governor_interactive, |
| 103 | .max_transition_latency = 10000000, |
| 104 | .owner = THIS_MODULE, |
| 105 | }; |
| 106 | |
| 107 | static void cpufreq_interactive_timer(unsigned long data) |
| 108 | { |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 109 | u64 now; |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 110 | unsigned int delta_idle; |
| 111 | unsigned int delta_time; |
| 112 | int cpu_load; |
| 113 | int load_since_change; |
| 114 | u64 time_in_idle; |
| 115 | u64 idle_exit_time; |
| 116 | struct cpufreq_interactive_cpuinfo *pcpu = |
| 117 | &per_cpu(cpuinfo, data); |
| 118 | u64 now_idle; |
| 119 | unsigned int new_freq; |
| 120 | unsigned int index; |
| 121 | unsigned long flags; |
| 122 | |
| 123 | smp_rmb(); |
| 124 | |
| 125 | if (!pcpu->governor_enabled) |
| 126 | goto exit; |
| 127 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 128 | time_in_idle = pcpu->time_in_idle; |
| 129 | idle_exit_time = pcpu->idle_exit_time; |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 130 | now_idle = get_cpu_idle_time_us(data, &now); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 131 | delta_idle = (unsigned int)(now_idle - time_in_idle); |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 132 | delta_time = (unsigned int)(now - idle_exit_time); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 133 | |
| 134 | /* |
| 135 | * If timer ran less than 1ms after short-term sample started, retry. |
| 136 | */ |
| 137 | if (delta_time < 1000) |
| 138 | goto rearm; |
| 139 | |
| 140 | if (delta_idle > delta_time) |
| 141 | cpu_load = 0; |
| 142 | else |
| 143 | cpu_load = 100 * (delta_time - delta_idle) / delta_time; |
| 144 | |
Todd Poynor | 0a92d48 | 2012-04-06 19:59:36 -0700 | [diff] [blame] | 145 | delta_idle = (unsigned int)(now_idle - pcpu->target_set_time_in_idle); |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 146 | delta_time = (unsigned int)(now - pcpu->target_set_time); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 147 | |
| 148 | if ((delta_time == 0) || (delta_idle > delta_time)) |
| 149 | load_since_change = 0; |
| 150 | else |
| 151 | load_since_change = |
| 152 | 100 * (delta_time - delta_idle) / delta_time; |
| 153 | |
| 154 | /* |
| 155 | * Choose greater of short-term load (since last idle timer |
| 156 | * started or timer function re-armed itself) or long-term load |
| 157 | * (since last frequency change). |
| 158 | */ |
| 159 | if (load_since_change > cpu_load) |
| 160 | cpu_load = load_since_change; |
| 161 | |
Todd Poynor | 9fb1531 | 2012-04-23 20:42:41 -0700 | [diff] [blame] | 162 | if (cpu_load >= go_hispeed_load || boost_val) { |
Todd Poynor | 5367631 | 2012-09-24 18:03:58 -0700 | [diff] [blame] | 163 | if (pcpu->target_freq < hispeed_freq && |
| 164 | hispeed_freq < pcpu->policy->max) { |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 165 | new_freq = hispeed_freq; |
Todd Poynor | 8dc352c | 2012-04-06 19:50:12 -0700 | [diff] [blame] | 166 | } else { |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 167 | new_freq = pcpu->policy->max * cpu_load / 100; |
Todd Poynor | 8dc352c | 2012-04-06 19:50:12 -0700 | [diff] [blame] | 168 | |
| 169 | if (new_freq < hispeed_freq) |
| 170 | new_freq = hispeed_freq; |
Todd Poynor | 596cf1f | 2012-04-13 20:18:02 -0700 | [diff] [blame] | 171 | |
| 172 | if (pcpu->target_freq == hispeed_freq && |
| 173 | new_freq > hispeed_freq && |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 174 | now - pcpu->hispeed_validate_time |
Todd Poynor | 596cf1f | 2012-04-13 20:18:02 -0700 | [diff] [blame] | 175 | < above_hispeed_delay_val) { |
| 176 | trace_cpufreq_interactive_notyet(data, cpu_load, |
| 177 | pcpu->target_freq, |
| 178 | new_freq); |
| 179 | goto rearm; |
| 180 | } |
Todd Poynor | 8dc352c | 2012-04-06 19:50:12 -0700 | [diff] [blame] | 181 | } |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 182 | } else { |
Todd Poynor | f090ef0 | 2012-10-03 00:39:56 -0700 | [diff] [blame] | 183 | new_freq = hispeed_freq * cpu_load / 100; |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 184 | } |
| 185 | |
Todd Poynor | 5a5aa70 | 2012-05-10 23:28:06 -0700 | [diff] [blame] | 186 | if (new_freq <= hispeed_freq) |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 187 | pcpu->hispeed_validate_time = now; |
Todd Poynor | 5a5aa70 | 2012-05-10 23:28:06 -0700 | [diff] [blame] | 188 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 189 | if (cpufreq_frequency_table_target(pcpu->policy, pcpu->freq_table, |
| 190 | new_freq, CPUFREQ_RELATION_H, |
| 191 | &index)) { |
| 192 | pr_warn_once("timer %d: cpufreq_frequency_table_target error\n", |
| 193 | (int) data); |
| 194 | goto rearm; |
| 195 | } |
| 196 | |
| 197 | new_freq = pcpu->freq_table[index].frequency; |
| 198 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 199 | /* |
Todd Poynor | aad2732 | 2012-04-26 21:41:40 -0700 | [diff] [blame] | 200 | * Do not scale below floor_freq unless we have been at or above the |
| 201 | * floor frequency for the minimum sample time since last validated. |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 202 | */ |
Todd Poynor | aad2732 | 2012-04-26 21:41:40 -0700 | [diff] [blame] | 203 | if (new_freq < pcpu->floor_freq) { |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 204 | if (now - pcpu->floor_validate_time < min_sample_time) { |
Todd Poynor | a1e1951 | 2012-02-16 16:27:59 -0800 | [diff] [blame] | 205 | trace_cpufreq_interactive_notyet(data, cpu_load, |
| 206 | pcpu->target_freq, new_freq); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 207 | goto rearm; |
Todd Poynor | a1e1951 | 2012-02-16 16:27:59 -0800 | [diff] [blame] | 208 | } |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 209 | } |
| 210 | |
Todd Poynor | aad2732 | 2012-04-26 21:41:40 -0700 | [diff] [blame] | 211 | pcpu->floor_freq = new_freq; |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 212 | pcpu->floor_validate_time = now; |
Todd Poynor | 0a92d48 | 2012-04-06 19:59:36 -0700 | [diff] [blame] | 213 | |
| 214 | if (pcpu->target_freq == new_freq) { |
| 215 | trace_cpufreq_interactive_already(data, cpu_load, |
| 216 | pcpu->target_freq, new_freq); |
| 217 | goto rearm_if_notmax; |
| 218 | } |
| 219 | |
Todd Poynor | a1e1951 | 2012-02-16 16:27:59 -0800 | [diff] [blame] | 220 | trace_cpufreq_interactive_target(data, cpu_load, pcpu->target_freq, |
| 221 | new_freq); |
Todd Poynor | bc699d8 | 2012-04-20 13:18:32 -0700 | [diff] [blame] | 222 | pcpu->target_set_time_in_idle = now_idle; |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 223 | pcpu->target_set_time = now; |
Todd Poynor | a1e1951 | 2012-02-16 16:27:59 -0800 | [diff] [blame] | 224 | |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 225 | pcpu->target_freq = new_freq; |
| 226 | spin_lock_irqsave(&speedchange_cpumask_lock, flags); |
| 227 | cpumask_set_cpu(data, &speedchange_cpumask); |
| 228 | spin_unlock_irqrestore(&speedchange_cpumask_lock, flags); |
| 229 | wake_up_process(speedchange_task); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 230 | |
| 231 | rearm_if_notmax: |
| 232 | /* |
| 233 | * Already set max speed and don't see a need to change that, |
| 234 | * wait until next idle to re-evaluate, don't need timer. |
| 235 | */ |
| 236 | if (pcpu->target_freq == pcpu->policy->max) |
| 237 | goto exit; |
| 238 | |
| 239 | rearm: |
| 240 | if (!timer_pending(&pcpu->cpu_timer)) { |
| 241 | /* |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 242 | * If already at min, cancel the timer if that CPU goes idle. |
| 243 | * We don't need to re-evaluate speed until the next idle exit. |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 244 | */ |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 245 | if (pcpu->target_freq == pcpu->policy->min) |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 246 | pcpu->timer_idlecancel = 1; |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 247 | |
| 248 | pcpu->time_in_idle = get_cpu_idle_time_us( |
| 249 | data, &pcpu->idle_exit_time); |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 250 | mod_timer_pinned(&pcpu->cpu_timer, |
| 251 | jiffies + usecs_to_jiffies(timer_rate)); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 252 | } |
| 253 | |
| 254 | exit: |
| 255 | return; |
| 256 | } |
| 257 | |
| 258 | static void cpufreq_interactive_idle_start(void) |
| 259 | { |
| 260 | struct cpufreq_interactive_cpuinfo *pcpu = |
| 261 | &per_cpu(cpuinfo, smp_processor_id()); |
| 262 | int pending; |
| 263 | |
| 264 | if (!pcpu->governor_enabled) |
| 265 | return; |
| 266 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 267 | pending = timer_pending(&pcpu->cpu_timer); |
| 268 | |
| 269 | if (pcpu->target_freq != pcpu->policy->min) { |
| 270 | #ifdef CONFIG_SMP |
| 271 | /* |
| 272 | * Entering idle while not at lowest speed. On some |
| 273 | * platforms this can hold the other CPU(s) at that speed |
| 274 | * even though the CPU is idle. Set a timer to re-evaluate |
| 275 | * speed so this idle CPU doesn't hold the other CPUs above |
| 276 | * min indefinitely. This should probably be a quirk of |
| 277 | * the CPUFreq driver. |
| 278 | */ |
| 279 | if (!pending) { |
| 280 | pcpu->time_in_idle = get_cpu_idle_time_us( |
| 281 | smp_processor_id(), &pcpu->idle_exit_time); |
| 282 | pcpu->timer_idlecancel = 0; |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 283 | mod_timer_pinned( |
| 284 | &pcpu->cpu_timer, |
| 285 | jiffies + usecs_to_jiffies(timer_rate)); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 286 | } |
| 287 | #endif |
| 288 | } else { |
| 289 | /* |
| 290 | * If at min speed and entering idle after load has |
| 291 | * already been evaluated, and a timer has been set just in |
| 292 | * case the CPU suddenly goes busy, cancel that timer. The |
| 293 | * CPU didn't go busy; we'll recheck things upon idle exit. |
| 294 | */ |
| 295 | if (pending && pcpu->timer_idlecancel) { |
| 296 | del_timer(&pcpu->cpu_timer); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 297 | pcpu->timer_idlecancel = 0; |
| 298 | } |
| 299 | } |
| 300 | |
| 301 | } |
| 302 | |
| 303 | static void cpufreq_interactive_idle_end(void) |
| 304 | { |
| 305 | struct cpufreq_interactive_cpuinfo *pcpu = |
| 306 | &per_cpu(cpuinfo, smp_processor_id()); |
| 307 | |
Sam Leffler | a04e441 | 2012-06-27 10:12:04 -0700 | [diff] [blame] | 308 | if (!pcpu->governor_enabled) |
| 309 | return; |
| 310 | |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 311 | /* Arm the timer for 1-2 ticks later if not already. */ |
| 312 | if (!timer_pending(&pcpu->cpu_timer)) { |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 313 | pcpu->time_in_idle = |
| 314 | get_cpu_idle_time_us(smp_processor_id(), |
| 315 | &pcpu->idle_exit_time); |
| 316 | pcpu->timer_idlecancel = 0; |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 317 | mod_timer_pinned( |
| 318 | &pcpu->cpu_timer, |
| 319 | jiffies + usecs_to_jiffies(timer_rate)); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 320 | } |
| 321 | |
| 322 | } |
| 323 | |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 324 | static int cpufreq_interactive_speedchange_task(void *data) |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 325 | { |
| 326 | unsigned int cpu; |
| 327 | cpumask_t tmp_mask; |
| 328 | unsigned long flags; |
| 329 | struct cpufreq_interactive_cpuinfo *pcpu; |
| 330 | |
| 331 | while (1) { |
| 332 | set_current_state(TASK_INTERRUPTIBLE); |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 333 | spin_lock_irqsave(&speedchange_cpumask_lock, flags); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 334 | |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 335 | if (cpumask_empty(&speedchange_cpumask)) { |
| 336 | spin_unlock_irqrestore(&speedchange_cpumask_lock, |
| 337 | flags); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 338 | schedule(); |
| 339 | |
| 340 | if (kthread_should_stop()) |
| 341 | break; |
| 342 | |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 343 | spin_lock_irqsave(&speedchange_cpumask_lock, flags); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 344 | } |
| 345 | |
| 346 | set_current_state(TASK_RUNNING); |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 347 | tmp_mask = speedchange_cpumask; |
| 348 | cpumask_clear(&speedchange_cpumask); |
| 349 | spin_unlock_irqrestore(&speedchange_cpumask_lock, flags); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 350 | |
| 351 | for_each_cpu(cpu, &tmp_mask) { |
| 352 | unsigned int j; |
| 353 | unsigned int max_freq = 0; |
| 354 | |
| 355 | pcpu = &per_cpu(cpuinfo, cpu); |
| 356 | smp_rmb(); |
| 357 | |
| 358 | if (!pcpu->governor_enabled) |
| 359 | continue; |
| 360 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 361 | for_each_cpu(j, pcpu->policy->cpus) { |
| 362 | struct cpufreq_interactive_cpuinfo *pjcpu = |
| 363 | &per_cpu(cpuinfo, j); |
| 364 | |
| 365 | if (pjcpu->target_freq > max_freq) |
| 366 | max_freq = pjcpu->target_freq; |
| 367 | } |
| 368 | |
| 369 | if (max_freq != pcpu->policy->cur) |
| 370 | __cpufreq_driver_target(pcpu->policy, |
| 371 | max_freq, |
| 372 | CPUFREQ_RELATION_H); |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 373 | trace_cpufreq_interactive_setspeed(cpu, |
| 374 | pcpu->target_freq, |
Todd Poynor | a1e1951 | 2012-02-16 16:27:59 -0800 | [diff] [blame] | 375 | pcpu->policy->cur); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 376 | } |
| 377 | } |
| 378 | |
| 379 | return 0; |
| 380 | } |
| 381 | |
Todd Poynor | 7820a65 | 2012-04-02 17:17:14 -0700 | [diff] [blame] | 382 | static void cpufreq_interactive_boost(void) |
| 383 | { |
| 384 | int i; |
| 385 | int anyboost = 0; |
| 386 | unsigned long flags; |
| 387 | struct cpufreq_interactive_cpuinfo *pcpu; |
| 388 | |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 389 | spin_lock_irqsave(&speedchange_cpumask_lock, flags); |
Todd Poynor | 7820a65 | 2012-04-02 17:17:14 -0700 | [diff] [blame] | 390 | |
| 391 | for_each_online_cpu(i) { |
| 392 | pcpu = &per_cpu(cpuinfo, i); |
| 393 | |
| 394 | if (pcpu->target_freq < hispeed_freq) { |
| 395 | pcpu->target_freq = hispeed_freq; |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 396 | cpumask_set_cpu(i, &speedchange_cpumask); |
Todd Poynor | 7820a65 | 2012-04-02 17:17:14 -0700 | [diff] [blame] | 397 | pcpu->target_set_time_in_idle = |
| 398 | get_cpu_idle_time_us(i, &pcpu->target_set_time); |
Todd Poynor | 5a5aa70 | 2012-05-10 23:28:06 -0700 | [diff] [blame] | 399 | pcpu->hispeed_validate_time = pcpu->target_set_time; |
Todd Poynor | 7820a65 | 2012-04-02 17:17:14 -0700 | [diff] [blame] | 400 | anyboost = 1; |
| 401 | } |
| 402 | |
| 403 | /* |
Todd Poynor | aad2732 | 2012-04-26 21:41:40 -0700 | [diff] [blame] | 404 | * Set floor freq and (re)start timer for when last |
| 405 | * validated. |
Todd Poynor | 7820a65 | 2012-04-02 17:17:14 -0700 | [diff] [blame] | 406 | */ |
| 407 | |
Todd Poynor | aad2732 | 2012-04-26 21:41:40 -0700 | [diff] [blame] | 408 | pcpu->floor_freq = hispeed_freq; |
| 409 | pcpu->floor_validate_time = ktime_to_us(ktime_get()); |
Todd Poynor | 7820a65 | 2012-04-02 17:17:14 -0700 | [diff] [blame] | 410 | } |
| 411 | |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 412 | spin_unlock_irqrestore(&speedchange_cpumask_lock, flags); |
Todd Poynor | 7820a65 | 2012-04-02 17:17:14 -0700 | [diff] [blame] | 413 | |
| 414 | if (anyboost) |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 415 | wake_up_process(speedchange_task); |
Todd Poynor | 7820a65 | 2012-04-02 17:17:14 -0700 | [diff] [blame] | 416 | } |
| 417 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 418 | static ssize_t show_hispeed_freq(struct kobject *kobj, |
| 419 | struct attribute *attr, char *buf) |
| 420 | { |
Todd Poynor | f090ef0 | 2012-10-03 00:39:56 -0700 | [diff] [blame] | 421 | return sprintf(buf, "%u\n", hispeed_freq); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 422 | } |
| 423 | |
| 424 | static ssize_t store_hispeed_freq(struct kobject *kobj, |
| 425 | struct attribute *attr, const char *buf, |
| 426 | size_t count) |
| 427 | { |
| 428 | int ret; |
Todd Poynor | f090ef0 | 2012-10-03 00:39:56 -0700 | [diff] [blame] | 429 | long unsigned int val; |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 430 | |
Todd Poynor | f090ef0 | 2012-10-03 00:39:56 -0700 | [diff] [blame] | 431 | ret = strict_strtoul(buf, 0, &val); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 432 | if (ret < 0) |
| 433 | return ret; |
| 434 | hispeed_freq = val; |
| 435 | return count; |
| 436 | } |
| 437 | |
| 438 | static struct global_attr hispeed_freq_attr = __ATTR(hispeed_freq, 0644, |
| 439 | show_hispeed_freq, store_hispeed_freq); |
| 440 | |
| 441 | |
| 442 | static ssize_t show_go_hispeed_load(struct kobject *kobj, |
| 443 | struct attribute *attr, char *buf) |
| 444 | { |
| 445 | return sprintf(buf, "%lu\n", go_hispeed_load); |
| 446 | } |
| 447 | |
| 448 | static ssize_t store_go_hispeed_load(struct kobject *kobj, |
| 449 | struct attribute *attr, const char *buf, size_t count) |
| 450 | { |
| 451 | int ret; |
| 452 | unsigned long val; |
| 453 | |
| 454 | ret = strict_strtoul(buf, 0, &val); |
| 455 | if (ret < 0) |
| 456 | return ret; |
| 457 | go_hispeed_load = val; |
| 458 | return count; |
| 459 | } |
| 460 | |
| 461 | static struct global_attr go_hispeed_load_attr = __ATTR(go_hispeed_load, 0644, |
| 462 | show_go_hispeed_load, store_go_hispeed_load); |
| 463 | |
| 464 | static ssize_t show_min_sample_time(struct kobject *kobj, |
| 465 | struct attribute *attr, char *buf) |
| 466 | { |
| 467 | return sprintf(buf, "%lu\n", min_sample_time); |
| 468 | } |
| 469 | |
| 470 | static ssize_t store_min_sample_time(struct kobject *kobj, |
| 471 | struct attribute *attr, const char *buf, size_t count) |
| 472 | { |
| 473 | int ret; |
| 474 | unsigned long val; |
| 475 | |
| 476 | ret = strict_strtoul(buf, 0, &val); |
| 477 | if (ret < 0) |
| 478 | return ret; |
| 479 | min_sample_time = val; |
| 480 | return count; |
| 481 | } |
| 482 | |
| 483 | static struct global_attr min_sample_time_attr = __ATTR(min_sample_time, 0644, |
| 484 | show_min_sample_time, store_min_sample_time); |
| 485 | |
Todd Poynor | 596cf1f | 2012-04-13 20:18:02 -0700 | [diff] [blame] | 486 | static ssize_t show_above_hispeed_delay(struct kobject *kobj, |
| 487 | struct attribute *attr, char *buf) |
| 488 | { |
| 489 | return sprintf(buf, "%lu\n", above_hispeed_delay_val); |
| 490 | } |
| 491 | |
| 492 | static ssize_t store_above_hispeed_delay(struct kobject *kobj, |
| 493 | struct attribute *attr, |
| 494 | const char *buf, size_t count) |
| 495 | { |
| 496 | int ret; |
| 497 | unsigned long val; |
| 498 | |
| 499 | ret = strict_strtoul(buf, 0, &val); |
| 500 | if (ret < 0) |
| 501 | return ret; |
| 502 | above_hispeed_delay_val = val; |
| 503 | return count; |
| 504 | } |
| 505 | |
| 506 | define_one_global_rw(above_hispeed_delay); |
| 507 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 508 | static ssize_t show_timer_rate(struct kobject *kobj, |
| 509 | struct attribute *attr, char *buf) |
| 510 | { |
| 511 | return sprintf(buf, "%lu\n", timer_rate); |
| 512 | } |
| 513 | |
| 514 | static ssize_t store_timer_rate(struct kobject *kobj, |
| 515 | struct attribute *attr, const char *buf, size_t count) |
| 516 | { |
| 517 | int ret; |
| 518 | unsigned long val; |
| 519 | |
| 520 | ret = strict_strtoul(buf, 0, &val); |
| 521 | if (ret < 0) |
| 522 | return ret; |
| 523 | timer_rate = val; |
| 524 | return count; |
| 525 | } |
| 526 | |
| 527 | static struct global_attr timer_rate_attr = __ATTR(timer_rate, 0644, |
| 528 | show_timer_rate, store_timer_rate); |
| 529 | |
Todd Poynor | 9fb1531 | 2012-04-23 20:42:41 -0700 | [diff] [blame] | 530 | static ssize_t show_boost(struct kobject *kobj, struct attribute *attr, |
| 531 | char *buf) |
| 532 | { |
| 533 | return sprintf(buf, "%d\n", boost_val); |
| 534 | } |
| 535 | |
| 536 | static ssize_t store_boost(struct kobject *kobj, struct attribute *attr, |
| 537 | const char *buf, size_t count) |
| 538 | { |
| 539 | int ret; |
| 540 | unsigned long val; |
| 541 | |
| 542 | ret = kstrtoul(buf, 0, &val); |
| 543 | if (ret < 0) |
| 544 | return ret; |
| 545 | |
| 546 | boost_val = val; |
| 547 | |
Todd Poynor | 2e739a0 | 2012-05-03 00:16:55 -0700 | [diff] [blame] | 548 | if (boost_val) { |
| 549 | trace_cpufreq_interactive_boost("on"); |
Todd Poynor | 9fb1531 | 2012-04-23 20:42:41 -0700 | [diff] [blame] | 550 | cpufreq_interactive_boost(); |
Todd Poynor | 2e739a0 | 2012-05-03 00:16:55 -0700 | [diff] [blame] | 551 | } else { |
| 552 | trace_cpufreq_interactive_unboost("off"); |
| 553 | } |
Todd Poynor | 9fb1531 | 2012-04-23 20:42:41 -0700 | [diff] [blame] | 554 | |
| 555 | return count; |
| 556 | } |
| 557 | |
| 558 | define_one_global_rw(boost); |
| 559 | |
Todd Poynor | 2e739a0 | 2012-05-03 00:16:55 -0700 | [diff] [blame] | 560 | static ssize_t store_boostpulse(struct kobject *kobj, struct attribute *attr, |
| 561 | const char *buf, size_t count) |
| 562 | { |
| 563 | int ret; |
| 564 | unsigned long val; |
| 565 | |
| 566 | ret = kstrtoul(buf, 0, &val); |
| 567 | if (ret < 0) |
| 568 | return ret; |
| 569 | |
| 570 | trace_cpufreq_interactive_boost("pulse"); |
| 571 | cpufreq_interactive_boost(); |
| 572 | return count; |
| 573 | } |
| 574 | |
| 575 | static struct global_attr boostpulse = |
| 576 | __ATTR(boostpulse, 0200, NULL, store_boostpulse); |
| 577 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 578 | static struct attribute *interactive_attributes[] = { |
| 579 | &hispeed_freq_attr.attr, |
| 580 | &go_hispeed_load_attr.attr, |
Todd Poynor | 596cf1f | 2012-04-13 20:18:02 -0700 | [diff] [blame] | 581 | &above_hispeed_delay.attr, |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 582 | &min_sample_time_attr.attr, |
| 583 | &timer_rate_attr.attr, |
Todd Poynor | 9fb1531 | 2012-04-23 20:42:41 -0700 | [diff] [blame] | 584 | &boost.attr, |
Todd Poynor | 2e739a0 | 2012-05-03 00:16:55 -0700 | [diff] [blame] | 585 | &boostpulse.attr, |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 586 | NULL, |
| 587 | }; |
| 588 | |
| 589 | static struct attribute_group interactive_attr_group = { |
| 590 | .attrs = interactive_attributes, |
| 591 | .name = "interactive", |
| 592 | }; |
| 593 | |
Sam Leffler | a04e441 | 2012-06-27 10:12:04 -0700 | [diff] [blame] | 594 | static int cpufreq_interactive_idle_notifier(struct notifier_block *nb, |
| 595 | unsigned long val, |
| 596 | void *data) |
| 597 | { |
| 598 | switch (val) { |
| 599 | case IDLE_START: |
| 600 | cpufreq_interactive_idle_start(); |
| 601 | break; |
| 602 | case IDLE_END: |
| 603 | cpufreq_interactive_idle_end(); |
| 604 | break; |
| 605 | } |
| 606 | |
| 607 | return 0; |
| 608 | } |
| 609 | |
| 610 | static struct notifier_block cpufreq_interactive_idle_nb = { |
| 611 | .notifier_call = cpufreq_interactive_idle_notifier, |
| 612 | }; |
| 613 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 614 | static int cpufreq_governor_interactive(struct cpufreq_policy *policy, |
| 615 | unsigned int event) |
| 616 | { |
| 617 | int rc; |
| 618 | unsigned int j; |
| 619 | struct cpufreq_interactive_cpuinfo *pcpu; |
| 620 | struct cpufreq_frequency_table *freq_table; |
| 621 | |
| 622 | switch (event) { |
| 623 | case CPUFREQ_GOV_START: |
| 624 | if (!cpu_online(policy->cpu)) |
| 625 | return -EINVAL; |
| 626 | |
| 627 | freq_table = |
| 628 | cpufreq_frequency_get_table(policy->cpu); |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 629 | if (!hispeed_freq) |
| 630 | hispeed_freq = policy->max; |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 631 | |
| 632 | for_each_cpu(j, policy->cpus) { |
| 633 | pcpu = &per_cpu(cpuinfo, j); |
| 634 | pcpu->policy = policy; |
| 635 | pcpu->target_freq = policy->cur; |
| 636 | pcpu->freq_table = freq_table; |
Todd Poynor | 0a92d48 | 2012-04-06 19:59:36 -0700 | [diff] [blame] | 637 | pcpu->target_set_time_in_idle = |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 638 | get_cpu_idle_time_us(j, |
Todd Poynor | 0a92d48 | 2012-04-06 19:59:36 -0700 | [diff] [blame] | 639 | &pcpu->target_set_time); |
Todd Poynor | aad2732 | 2012-04-26 21:41:40 -0700 | [diff] [blame] | 640 | pcpu->floor_freq = pcpu->target_freq; |
| 641 | pcpu->floor_validate_time = |
Todd Poynor | bc699d8 | 2012-04-20 13:18:32 -0700 | [diff] [blame] | 642 | pcpu->target_set_time; |
Todd Poynor | 5a5aa70 | 2012-05-10 23:28:06 -0700 | [diff] [blame] | 643 | pcpu->hispeed_validate_time = |
| 644 | pcpu->target_set_time; |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 645 | pcpu->governor_enabled = 1; |
| 646 | smp_wmb(); |
Todd Poynor | 1913e0f | 2012-11-05 13:09:03 -0800 | [diff] [blame^] | 647 | pcpu->cpu_timer.expires = |
| 648 | jiffies + usecs_to_jiffies(timer_rate); |
| 649 | add_timer_on(&pcpu->cpu_timer, j); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 650 | } |
| 651 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 652 | /* |
| 653 | * Do not register the idle hook and create sysfs |
| 654 | * entries if we have already done so. |
| 655 | */ |
| 656 | if (atomic_inc_return(&active_count) > 1) |
| 657 | return 0; |
| 658 | |
| 659 | rc = sysfs_create_group(cpufreq_global_kobject, |
| 660 | &interactive_attr_group); |
| 661 | if (rc) |
| 662 | return rc; |
| 663 | |
Sam Leffler | a04e441 | 2012-06-27 10:12:04 -0700 | [diff] [blame] | 664 | idle_notifier_register(&cpufreq_interactive_idle_nb); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 665 | break; |
| 666 | |
| 667 | case CPUFREQ_GOV_STOP: |
| 668 | for_each_cpu(j, policy->cpus) { |
| 669 | pcpu = &per_cpu(cpuinfo, j); |
| 670 | pcpu->governor_enabled = 0; |
| 671 | smp_wmb(); |
| 672 | del_timer_sync(&pcpu->cpu_timer); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 673 | } |
| 674 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 675 | if (atomic_dec_return(&active_count) > 0) |
| 676 | return 0; |
| 677 | |
Sam Leffler | a04e441 | 2012-06-27 10:12:04 -0700 | [diff] [blame] | 678 | idle_notifier_unregister(&cpufreq_interactive_idle_nb); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 679 | sysfs_remove_group(cpufreq_global_kobject, |
| 680 | &interactive_attr_group); |
| 681 | |
| 682 | break; |
| 683 | |
| 684 | case CPUFREQ_GOV_LIMITS: |
| 685 | if (policy->max < policy->cur) |
| 686 | __cpufreq_driver_target(policy, |
| 687 | policy->max, CPUFREQ_RELATION_H); |
| 688 | else if (policy->min > policy->cur) |
| 689 | __cpufreq_driver_target(policy, |
| 690 | policy->min, CPUFREQ_RELATION_L); |
| 691 | break; |
| 692 | } |
| 693 | return 0; |
| 694 | } |
| 695 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 696 | static int __init cpufreq_interactive_init(void) |
| 697 | { |
| 698 | unsigned int i; |
| 699 | struct cpufreq_interactive_cpuinfo *pcpu; |
| 700 | struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 }; |
| 701 | |
| 702 | go_hispeed_load = DEFAULT_GO_HISPEED_LOAD; |
| 703 | min_sample_time = DEFAULT_MIN_SAMPLE_TIME; |
Todd Poynor | 596cf1f | 2012-04-13 20:18:02 -0700 | [diff] [blame] | 704 | above_hispeed_delay_val = DEFAULT_ABOVE_HISPEED_DELAY; |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 705 | timer_rate = DEFAULT_TIMER_RATE; |
| 706 | |
| 707 | /* Initalize per-cpu timers */ |
| 708 | for_each_possible_cpu(i) { |
| 709 | pcpu = &per_cpu(cpuinfo, i); |
| 710 | init_timer(&pcpu->cpu_timer); |
| 711 | pcpu->cpu_timer.function = cpufreq_interactive_timer; |
| 712 | pcpu->cpu_timer.data = i; |
| 713 | } |
| 714 | |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 715 | spin_lock_init(&speedchange_cpumask_lock); |
| 716 | speedchange_task = |
| 717 | kthread_create(cpufreq_interactive_speedchange_task, NULL, |
| 718 | "cfinteractive"); |
| 719 | if (IS_ERR(speedchange_task)) |
| 720 | return PTR_ERR(speedchange_task); |
Sam Leffler | a13f415 | 2012-06-27 12:55:56 -0700 | [diff] [blame] | 721 | |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 722 | sched_setscheduler_nocheck(speedchange_task, SCHED_FIFO, ¶m); |
| 723 | get_task_struct(speedchange_task); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 724 | |
Sam Leffler | a13f415 | 2012-06-27 12:55:56 -0700 | [diff] [blame] | 725 | /* NB: wake up so the thread does not look hung to the freezer */ |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 726 | wake_up_process(speedchange_task); |
Sam Leffler | a13f415 | 2012-06-27 12:55:56 -0700 | [diff] [blame] | 727 | |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 728 | return cpufreq_register_governor(&cpufreq_gov_interactive); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 729 | } |
| 730 | |
| 731 | #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE |
| 732 | fs_initcall(cpufreq_interactive_init); |
| 733 | #else |
| 734 | module_init(cpufreq_interactive_init); |
| 735 | #endif |
| 736 | |
| 737 | static void __exit cpufreq_interactive_exit(void) |
| 738 | { |
| 739 | cpufreq_unregister_governor(&cpufreq_gov_interactive); |
Todd Poynor | 02442cf | 2012-07-16 17:07:15 -0700 | [diff] [blame] | 740 | kthread_stop(speedchange_task); |
| 741 | put_task_struct(speedchange_task); |
Mike Chan | 9d49b70 | 2010-06-22 11:26:45 -0700 | [diff] [blame] | 742 | } |
| 743 | |
| 744 | module_exit(cpufreq_interactive_exit); |
| 745 | |
| 746 | MODULE_AUTHOR("Mike Chan <mike@android.com>"); |
| 747 | MODULE_DESCRIPTION("'cpufreq_interactive' - A cpufreq governor for " |
| 748 | "Latency sensitive workloads"); |
| 749 | MODULE_LICENSE("GPL"); |