--- y/kernel/time/hrtimer.c +++ h/kernel/time/hrtimer.c @@ -1647,6 +1647,8 @@ static void __run_hrtimer(struct hrtimer enum hrtimer_restart (*fn)(struct hrtimer *); bool expires_in_hardirq; int restart; + unsigned long ts; + ktime_t ts_thr, ts_ns; lockdep_assert_held(&cpu_base->lock); @@ -1681,13 +1683,19 @@ static void __run_hrtimer(struct hrtimer raw_spin_unlock_irqrestore(&cpu_base->lock, flags); trace_hrtimer_expire_entry(timer, now); expires_in_hardirq = lockdep_hrtimer_enter(timer); + ts = jiffies + 1; restart = fn(timer); + WARN_ONCE(time_after(jiffies, ts), "hrtimer hog %ps ran longer than 1 tick\n", fn); + lockdep_hrtimer_exit(expires_in_hardirq); trace_hrtimer_expire_exit(timer); raw_spin_lock_irq(&cpu_base->lock); + ts_ns = hrtimer_update_base(cpu_base); + ts_thr = ktime_add_ms(*now, 1); + WARN_ONCE(ktime_after(ts_ns, ts_thr), "hrtimer hog %ps ran longer than 1ms\n", fn); /* * Note: We clear the running state after enqueue_hrtimer and * we do not reprogram the event hardware. Happens either in