Skip to content

Commit 73420fe

Browse files
anna-marialxIngo Molnar
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: Arjan van de Ven <[email protected]> Cc: Chris Mason <[email protected]> Cc: Eric Dumazet <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: George Spelvin <[email protected]> Cc: Josh Triplett <[email protected]> Cc: Len Brown <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rik van Riel <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 53bf837 commit 73420fe

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

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)