--- m/kernel/time/hrtimer.c 2022-07-31 15:34:48.596885000 +0800 +++ n/kernel/time/hrtimer.c 2022-07-31 15:37:26.171641100 +0800 @@ -1646,6 +1646,7 @@ static void __run_hrtimer(struct hrtimer { enum hrtimer_restart (*fn)(struct hrtimer *); bool expires_in_hardirq; + unsigned long ts; int restart; lockdep_assert_held(&cpu_base->lock); @@ -1681,9 +1682,13 @@ 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 + 4; restart = fn(timer); + WARN_ONCE(time_after(jiffies, ts), + "On CPU%u hrtimer %ps took more than 4 ticks\n", cpu_base->cpu, fn); + lockdep_hrtimer_exit(expires_in_hardirq); trace_hrtimer_expire_exit(timer); raw_spin_lock_irq(&cpu_base->lock);