From: Park Bumgyu Date: Fri, 26 Jan 2018 10:25:10 +0000 (+0900) Subject: nohz: export symbol tick_nohz_get_sleep_length_cpu X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=48e89ffebb8be965068bbf09c74ab2c51e6d0037;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git nohz: export symbol tick_nohz_get_sleep_length_cpu tick_nohz_get_sleep_length_cpu returns the length of the current sleep for a particular CPU. Change-Id: I8fbc8af8914f0d2ddc47847bb55320925c59aaf9 Signed-off-by: Park Bumgyu --- diff --git a/include/linux/tick.h b/include/linux/tick.h index 5cdac11dd317..21a760475dc1 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h @@ -118,6 +118,7 @@ extern void tick_nohz_idle_enter(void); extern void tick_nohz_idle_exit(void); extern void tick_nohz_irq_exit(void); extern ktime_t tick_nohz_get_sleep_length(void); +extern ktime_t tick_nohz_get_sleep_length_cpu(int cpu); extern unsigned long tick_nohz_get_idle_calls(void); extern unsigned long tick_nohz_get_idle_calls_cpu(int cpu); extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); @@ -132,6 +133,10 @@ static inline ktime_t tick_nohz_get_sleep_length(void) { return NSEC_PER_SEC / HZ; } +static inline ktime_t tick_nohz_get_sleep_length_cpu(int cpu) +{ + return NSEC_PER_SEC / HZ; +} static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; } static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; } #endif /* !CONFIG_NO_HZ_COMMON */ diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index dfa4a117fee3..556ab17a0a16 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -1024,6 +1024,19 @@ ktime_t tick_nohz_get_sleep_length(void) return ts->sleep_length; } +/** + * tick_nohz_get_sleep_length_cpu - return the length of the current sleep + * for a particular CPU. + * + * Called from power state control code with interrupts disabled + */ +ktime_t tick_nohz_get_sleep_length_cpu(int cpu) +{ + struct tick_sched *ts = tick_get_tick_sched(cpu); + + return ts->sleep_length; +} + /** * tick_nohz_get_idle_calls_cpu - return the current idle calls counter value * for a particular CPU.