--- x/kernel/time/hrtimer.c 2022-07-31 15:07:43.454730700 +0800 +++ y/kernel/time/hrtimer.c 2022-07-31 16:01:08.254012600 +0800 @@ -1480,6 +1480,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); @@ -1515,9 +1516,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); + if (time_after(jiffies, ts)) + pr_warn("On CPU%u hrtimer %ps took 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);