[patch 15/20] timer: Move __run_timers() function

From: Thomas Gleixner
Date: Mon Jun 13 2016 - 04:43:10 EST


From: Anna-Maria Gleixner <anna-maria@xxxxxxxxxxxxx>

Move __run_timers() below __next_timer_interrupt() and next_pending_bucket()
in preparation for __run_timers() NOHZ optimization.

No functional change.

Signed-off-by: Anna-Maria Gleixner <anna-maria@xxxxxxxxxxxxx>
Cc: rt@xxxxxxxxxxxxx
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
kernel/time/timer.c | 46 +++++++++++++++++++++++-----------------------
1 file changed, 23 insertions(+), 23 deletions(-)

--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1280,29 +1280,6 @@ static int collect_expired_timers(struct
return levels;
}

-/**
- * __run_timers - run all expired timers (if any) on this CPU.
- * @base: the timer vector to be processed.
- */
-static inline void __run_timers(struct timer_base *base)
-{
- struct hlist_head heads[LVL_DEPTH];
- int levels;
-
- spin_lock_irq(&base->lock);
-
- while (time_after_eq(jiffies, base->clk)) {
-
- levels = collect_expired_timers(base, heads);
- base->clk++;
-
- while (levels--)
- expire_timers(base, heads + levels);
- }
- base->running_timer = NULL;
- spin_unlock_irq(&base->lock);
-}
-
#ifdef CONFIG_NO_HZ_COMMON
/*
* Find the next pending bucket of a level. Search from @offset + @clk upwards
@@ -1478,6 +1455,29 @@ void update_process_times(int user_tick)
run_posix_cpu_timers(p);
}

+/**
+ * __run_timers - run all expired timers (if any) on this CPU.
+ * @base: the timer vector to be processed.
+ */
+static inline void __run_timers(struct timer_base *base)
+{
+ struct hlist_head heads[LVL_DEPTH];
+ int levels;
+
+ spin_lock_irq(&base->lock);
+
+ while (time_after_eq(jiffies, base->clk)) {
+
+ levels = collect_expired_timers(base, heads);
+ base->clk++;
+
+ while (levels--)
+ expire_timers(base, heads + levels);
+ }
+ base->running_timer = NULL;
+ spin_unlock_irq(&base->lock);
+}
+
/*
* This function runs timers and the timer-tq in bottom half context.
*/