timers: Move __run_timers() function
authorAnna-Maria Gleixner <anna-maria@linutronix.de>
Mon, 4 Jul 2016 09:50:33 +0000 (09:50 +0000)
committerIngo Molnar <mingo@kernel.org>
Thu, 7 Jul 2016 08:35:09 +0000 (10:35 +0200)
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@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Chris Mason <clm@fb.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: George Spelvin <linux@sciencehorizons.net>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160704094342.271872665@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/time/timer.c

index a83e23d0bc25cd72ea0713539da0d1ec58252ced..c16c48de01c5f90170b064b75f5fe422887a90a6 100644 (file)
@@ -1277,32 +1277,6 @@ static int collect_expired_timers(struct timer_base *base,
        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;
-
-       if (!time_after_eq(jiffies, base->clk))
-               return;
-
-       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
@@ -1472,6 +1446,32 @@ 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;
+
+       if (!time_after_eq(jiffies, base->clk))
+               return;
+
+       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.
  */