aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/timer.c
diff options
context:
space:
mode:
authorAnna-Maria Gleixner <anna-maria@linutronix.de>2016-07-04 05:50:33 -0400
committerIngo Molnar <mingo@kernel.org>2016-07-07 04:35:09 -0400
commit73420fea80c6c376d91a69defe64013baa0d7e95 (patch)
tree5170aa854c429cea8886b86bfeabe191352ea311 /kernel/time/timer.c
parent53bf837b78d155b8e1110b3c25b4d0d6391b8ff3 (diff)
timers: Move __run_timers() function
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>
Diffstat (limited to 'kernel/time/timer.c')
-rw-r--r--kernel/time/timer.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index a83e23d0bc25..c16c48de01c5 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -1277,32 +1277,6 @@ static int collect_expired_timers(struct timer_base *base,
1277 return levels; 1277 return levels;
1278} 1278}
1279 1279
1280/**
1281 * __run_timers - run all expired timers (if any) on this CPU.
1282 * @base: the timer vector to be processed.
1283 */
1284static inline void __run_timers(struct timer_base *base)
1285{
1286 struct hlist_head heads[LVL_DEPTH];
1287 int levels;
1288
1289 if (!time_after_eq(jiffies, base->clk))
1290 return;
1291
1292 spin_lock_irq(&base->lock);
1293
1294 while (time_after_eq(jiffies, base->clk)) {
1295
1296 levels = collect_expired_timers(base, heads);
1297 base->clk++;
1298
1299 while (levels--)
1300 expire_timers(base, heads + levels);
1301 }
1302 base->running_timer = NULL;
1303 spin_unlock_irq(&base->lock);
1304}
1305
1306#ifdef CONFIG_NO_HZ_COMMON 1280#ifdef CONFIG_NO_HZ_COMMON
1307/* 1281/*
1308 * Find the next pending bucket of a level. Search from @offset + @clk upwards 1282 * Find the next pending bucket of a level. Search from @offset + @clk upwards
@@ -1472,6 +1446,32 @@ void update_process_times(int user_tick)
1472 run_posix_cpu_timers(p); 1446 run_posix_cpu_timers(p);
1473} 1447}
1474 1448
1449/**
1450 * __run_timers - run all expired timers (if any) on this CPU.
1451 * @base: the timer vector to be processed.
1452 */
1453static inline void __run_timers(struct timer_base *base)
1454{
1455 struct hlist_head heads[LVL_DEPTH];
1456 int levels;
1457
1458 if (!time_after_eq(jiffies, base->clk))
1459 return;
1460
1461 spin_lock_irq(&base->lock);
1462
1463 while (time_after_eq(jiffies, base->clk)) {
1464
1465 levels = collect_expired_timers(base, heads);
1466 base->clk++;
1467
1468 while (levels--)
1469 expire_timers(base, heads + levels);
1470 }
1471 base->running_timer = NULL;
1472 spin_unlock_irq(&base->lock);
1473}
1474
1475/* 1475/*
1476 * This function runs timers and the timer-tq in bottom half context. 1476 * This function runs timers and the timer-tq in bottom half context.
1477 */ 1477 */