From: Viresh Kumar <[email protected]> Now that a generic version of get_cpu_idle_time() is available, use that for the interactive governor.
[[email protected]: commit text changes] Change-Id: Ia38b57085aac99ec3d415fe44471d5dfde519c2c Signed-off-by: Viresh Kumar <[email protected]> Signed-off-by: Jon Medhurst <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Bálint Czobor <[email protected]> --- drivers/cpufreq/cpufreq_interactive.c | 40 --------------------------------- 1 file changed, 40 deletions(-) diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c index 8297ac6..ff77b30 100644 --- a/drivers/cpufreq/cpufreq_interactive.c +++ b/drivers/cpufreq/cpufreq_interactive.c @@ -30,8 +30,6 @@ #include <linux/workqueue.h> #include <linux/kthread.h> #include <linux/slab.h> -#include <linux/kernel_stat.h> -#include <asm/cputime.h> #define CREATE_TRACE_POINTS #include <trace/events/cpufreq_interactive.h> @@ -119,44 +117,6 @@ struct cpufreq_interactive_tunables *common_tunables; static struct attribute_group *get_sysfs_attr(void); -static inline cputime64_t get_cpu_idle_time_jiffy(unsigned int cpu, - cputime64_t *wall) -{ - u64 idle_time; - u64 cur_wall_time; - u64 busy_time; - - cur_wall_time = jiffies64_to_cputime64(get_jiffies_64()); - - busy_time = kcpustat_cpu(cpu).cpustat[CPUTIME_USER]; - busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_SYSTEM]; - busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_IRQ]; - busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_SOFTIRQ]; - busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_STEAL]; - busy_time += kcpustat_cpu(cpu).cpustat[CPUTIME_NICE]; - - idle_time = cur_wall_time - busy_time; - if (wall) - *wall = jiffies_to_usecs(cur_wall_time); - - return jiffies_to_usecs(idle_time); -} - -static inline cputime64_t get_cpu_idle_time( - unsigned int cpu, - cputime64_t *wall, - bool io_is_busy) -{ - u64 idle_time = get_cpu_idle_time_us(cpu, wall); - - if (idle_time == -1ULL) - idle_time = get_cpu_idle_time_jiffy(cpu, wall); - else if (!io_is_busy) - idle_time += get_cpu_iowait_time_us(cpu, wall); - - return idle_time; -} - static void cpufreq_interactive_timer_resched( struct cpufreq_interactive_cpuinfo *pcpu) { -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

