aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq_ondemand.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/cpufreq_ondemand.c')
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 396322f2a83f..d7f774bb49dd 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -119,40 +119,6 @@ static struct dbs_tuners {
119 .powersave_bias = 0, 119 .powersave_bias = 0,
120}; 120};
121 121
122static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)
123{
124 u64 idle_time;
125 u64 cur_wall_time;
126 u64 busy_time;
127
128 cur_wall_time = jiffies64_to_cputime64(get_jiffies_64());
129
130 busy_time = kcpustat_cpu(cpu).cpustat[CPUTIME_USER];
131 busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_SYSTEM];
132 busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_IRQ];
133 busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_SOFTIRQ];
134 busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_STEAL];
135 busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_NICE];
136
137 idle_time = cur_wall_time - busy_time;
138 if (wall)
139 *wall = jiffies_to_usecs(cur_wall_time);
140
141 return jiffies_to_usecs(idle_time);
142}
143
144static inline cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall)
145{
146 u64 idle_time = get_cpu_idle_time_us(cpu, NULL);
147
148 if (idle_time == -1ULL)
149 return get_cpu_idle_time_jiffy(cpu, wall);
150 else
151 idle_time += get_cpu_iowait_time_us(cpu, wall);
152
153 return idle_time;
154}
155
156static inline cputime64_t get_cpu_iowait_time(unsigned int cpu, cputime64_t *wall) 122static inline cputime64_t get_cpu_iowait_time(unsigned int cpu, cputime64_t *wall)
157{ 123{
158 u64 iowait_time = get_cpu_iowait_time_us(cpu, wall); 124 u64 iowait_time = get_cpu_iowait_time_us(cpu, wall);