Skip to content

Commit fbb9c58

Browse files
committed
Merge tag 'timers-urgent-2022-04-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer fixes from Thomas Gleixner: "A small set of fixes for the timers core: - Fix the warning condition in __run_timers() which does not take into account that a CPU base (especially the deferrable base) never has a timer armed on it and therefore the next_expiry value can become stale. - Replace a WARN_ON() in the NOHZ code with a WARN_ON_ONCE() to prevent endless spam in dmesg. - Remove the double star from a comment which is not meant to be in kernel-doc format" * tag 'timers-urgent-2022-04-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: tick/sched: Fix non-kernel-doc comment tick/nohz: Use WARN_ON_ONCE() to prevent console saturation timers: Fix warning condition in __run_timers()
2 parents 0e59732 + 9c95bc2 commit fbb9c58

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

kernel/time/tick-sched.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static void tick_sched_do_timer(struct tick_sched *ts, ktime_t now)
188188
*/
189189
if (unlikely(tick_do_timer_cpu == TICK_DO_TIMER_NONE)) {
190190
#ifdef CONFIG_NO_HZ_FULL
191-
WARN_ON(tick_nohz_full_running);
191+
WARN_ON_ONCE(tick_nohz_full_running);
192192
#endif
193193
tick_do_timer_cpu = cpu;
194194
}
@@ -1538,7 +1538,7 @@ void tick_cancel_sched_timer(int cpu)
15381538
}
15391539
#endif
15401540

1541-
/**
1541+
/*
15421542
* Async notification about clocksource changes
15431543
*/
15441544
void tick_clock_notify(void)
@@ -1559,7 +1559,7 @@ void tick_oneshot_notify(void)
15591559
set_bit(0, &ts->check_clocks);
15601560
}
15611561

1562-
/**
1562+
/*
15631563
* Check, if a change happened, which makes oneshot possible.
15641564
*
15651565
* Called cyclic from the hrtimer softirq (driven by the timer

kernel/time/timer.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,11 +1722,14 @@ static inline void __run_timers(struct timer_base *base)
17221722
time_after_eq(jiffies, base->next_expiry)) {
17231723
levels = collect_expired_timers(base, heads);
17241724
/*
1725-
* The only possible reason for not finding any expired
1726-
* timer at this clk is that all matching timers have been
1727-
* dequeued.
1725+
* The two possible reasons for not finding any expired
1726+
* timer at this clk are that all matching timers have been
1727+
* dequeued or no timer has been queued since
1728+
* base::next_expiry was set to base::clk +
1729+
* NEXT_TIMER_MAX_DELTA.
17281730
*/
1729-
WARN_ON_ONCE(!levels && !base->next_expiry_recalc);
1731+
WARN_ON_ONCE(!levels && !base->next_expiry_recalc
1732+
&& base->timers_pending);
17301733
base->clk++;
17311734
base->next_expiry = __next_timer_interrupt(base);
17321735

0 commit comments

Comments
 (0)