Commit 57e95a5c authored by Anna-Maria Behnsen's avatar Anna-Maria Behnsen Committed by Thomas Gleixner

timers: Introduce function to check timer base is_idle flag

To prepare for the conversion of the NOHZ timer placement to a pull at
expiry time model it's required to have a function that returns the value
of the is_idle flag of the timer base to keep the hierarchy states during
online in sync with timer base state.

No functional change.
Signed-off-by: default avatarAnna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20240221090548.36600-18-anna-maria@linutronix.de
parent 4c532939
...@@ -165,6 +165,7 @@ extern void fetch_next_timer_interrupt_remote(unsigned long basej, u64 basem, ...@@ -165,6 +165,7 @@ extern void fetch_next_timer_interrupt_remote(unsigned long basej, u64 basem,
unsigned int cpu); unsigned int cpu);
extern void timer_lock_remote_bases(unsigned int cpu); extern void timer_lock_remote_bases(unsigned int cpu);
extern void timer_unlock_remote_bases(unsigned int cpu); extern void timer_unlock_remote_bases(unsigned int cpu);
extern bool timer_base_is_idle(void);
# endif # endif
#else /* CONFIG_NO_HZ_COMMON */ #else /* CONFIG_NO_HZ_COMMON */
static inline void timers_update_nohz(void) { } static inline void timers_update_nohz(void) { }
......
...@@ -2159,6 +2159,16 @@ void timer_lock_remote_bases(unsigned int cpu) ...@@ -2159,6 +2159,16 @@ void timer_lock_remote_bases(unsigned int cpu)
raw_spin_lock(&base_local->lock); raw_spin_lock(&base_local->lock);
raw_spin_lock_nested(&base_global->lock, SINGLE_DEPTH_NESTING); raw_spin_lock_nested(&base_global->lock, SINGLE_DEPTH_NESTING);
} }
/**
* timer_base_is_idle() - Return whether timer base is set idle
*
* Returns value of local timer base is_idle value.
*/
bool timer_base_is_idle(void)
{
return __this_cpu_read(timer_bases[BASE_LOCAL].is_idle);
}
# endif /* CONFIG_SMP */ # endif /* CONFIG_SMP */
static inline u64 __get_next_timer_interrupt(unsigned long basej, u64 basem, static inline u64 __get_next_timer_interrupt(unsigned long basej, u64 basem,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment