diff options
| -rw-r--r-- | include/linux/tick.h | 1 | ||||
| -rw-r--r-- | kernel/sched/cpufreq_schedutil.c | 2 | ||||
| -rw-r--r-- | kernel/time/tick-sched.c | 13 |
3 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/tick.h b/include/linux/tick.h index f442d1a42025..7cc35921218e 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
| @@ -119,6 +119,7 @@ extern void tick_nohz_idle_exit(void); | |||
| 119 | extern void tick_nohz_irq_exit(void); | 119 | extern void tick_nohz_irq_exit(void); |
| 120 | extern ktime_t tick_nohz_get_sleep_length(void); | 120 | extern ktime_t tick_nohz_get_sleep_length(void); |
| 121 | extern unsigned long tick_nohz_get_idle_calls(void); | 121 | extern unsigned long tick_nohz_get_idle_calls(void); |
| 122 | extern unsigned long tick_nohz_get_idle_calls_cpu(int cpu); | ||
| 122 | extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); | 123 | extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); |
| 123 | extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time); | 124 | extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time); |
| 124 | #else /* !CONFIG_NO_HZ_COMMON */ | 125 | #else /* !CONFIG_NO_HZ_COMMON */ |
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 2f52ec0f1539..d6717a3331a1 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c | |||
| @@ -244,7 +244,7 @@ static void sugov_iowait_boost(struct sugov_cpu *sg_cpu, unsigned long *util, | |||
| 244 | #ifdef CONFIG_NO_HZ_COMMON | 244 | #ifdef CONFIG_NO_HZ_COMMON |
| 245 | static bool sugov_cpu_is_busy(struct sugov_cpu *sg_cpu) | 245 | static bool sugov_cpu_is_busy(struct sugov_cpu *sg_cpu) |
| 246 | { | 246 | { |
| 247 | unsigned long idle_calls = tick_nohz_get_idle_calls(); | 247 | unsigned long idle_calls = tick_nohz_get_idle_calls_cpu(sg_cpu->cpu); |
| 248 | bool ret = idle_calls == sg_cpu->saved_idle_calls; | 248 | bool ret = idle_calls == sg_cpu->saved_idle_calls; |
| 249 | 249 | ||
| 250 | sg_cpu->saved_idle_calls = idle_calls; | 250 | sg_cpu->saved_idle_calls = idle_calls; |
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 99578f06c8d4..77555faf6fbc 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
| @@ -986,6 +986,19 @@ ktime_t tick_nohz_get_sleep_length(void) | |||
| 986 | } | 986 | } |
| 987 | 987 | ||
| 988 | /** | 988 | /** |
| 989 | * tick_nohz_get_idle_calls_cpu - return the current idle calls counter value | ||
| 990 | * for a particular CPU. | ||
| 991 | * | ||
| 992 | * Called from the schedutil frequency scaling governor in scheduler context. | ||
| 993 | */ | ||
| 994 | unsigned long tick_nohz_get_idle_calls_cpu(int cpu) | ||
| 995 | { | ||
| 996 | struct tick_sched *ts = tick_get_tick_sched(cpu); | ||
| 997 | |||
| 998 | return ts->idle_calls; | ||
| 999 | } | ||
| 1000 | |||
| 1001 | /** | ||
| 989 | * tick_nohz_get_idle_calls - return the current idle calls counter value | 1002 | * tick_nohz_get_idle_calls - return the current idle calls counter value |
| 990 | * | 1003 | * |
| 991 | * Called from the schedutil frequency scaling governor in scheduler context. | 1004 | * Called from the schedutil frequency scaling governor in scheduler context. |
