Skip to content

Commit 73420fe

Browse files
anna-marialxingomolnar
authored andcommitted
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>
1 parent 53bf837 commit 73420fe

1 file changed

Lines changed: 26 additions & 26 deletions

File tree

‎kernel/time/timer.c‎

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,32 +1277,6 @@ static int collect_expired_timers(struct timer_base *base,
12771277
return levels;
12781278
}
12791279

1280-
/**
1281-
* __run_timers - run all expired timers (if any) on this CPU.
1282-
* @base: the timer vector to be processed.
1283-
*/
1284-
static 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-
13061280
#ifdef CONFIG_NO_HZ_COMMON
13071281
/*
13081282
* Find the next pending bucket of a level. Search from @offset + @clk upwards
@@ -1472,6 +1446,32 @@ void update_process_times(int user_tick)
14721446
run_posix_cpu_timers(p);
14731447
}
14741448

1449+
/**
1450+
* __run_timers - run all expired timers (if any) on this CPU.
1451+
* @base: the timer vector to be processed.
1452+
*/
1453+
static 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+
14751475
/*
14761476
* This function runs timers and the timer-tq in bottom half context.
14771477
*/

0 commit comments

Comments
 (0)