Skip to contentSkip to conversation

hrtimer: Account nr_retries on recovered interrupt retries

PATCH Applied Liang Hao 2 participants 2 messages Jul 31 – Aug 11 High-resolution timers, timer wheel, clockevents

lore
Share & tools
lore

Liang Hao

author
#0 lore raw

PATCH 1/1 hrtimer: Account nr_retries on recovered interrupt retries

Re-arranging hrtimer_interrupt() switched the retry path to a local counter and dropped the update of cpu_base->nr_retries, leaving the field exported via /proc/timer_list stuck at zero.

Increment nr_retries only when another pass through the expiry loop is started; the third attempt that falls through to hang handling is still accounted by nr_hangs alone.

Fixes 288924384856 ("hrtimer: Re-arrange hrtimer_interrupt()")
---
 kernel/time/hrtimer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/time/hrtimer.c +3 -1
index 313dcea127fe..96eef3026fba 100644
@@ -2228,8 +2228,10 @@ void hrtimer_interrupt(struct clock_event_device *dev)
 	expires_next = hrtimer_update_next_event(cpu_base);
 	cpu_base->hang_detected = false;
 	if (expires_next < now) {
-		if (++retries < 3)
+		if (++retries < 3) {
+			cpu_base->nr_retries++;
 			goto retry;
+		}
 
 		delta = ktime_sub(now, entry_time);
 		cpu_base->max_hang_time = max_t(unsigned int, cpu_base->max_hang_time, delta);
Signature · 1 line
2.50.1 (Apple Git-155)
merge bot Applied
#1 lore raw
The following commit has been merged into the timers/core branch of tip:

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     32a05ba399fc52661f59f38efd2e606f45eb2c8f
Gitweb:        https://git.kernel.org/tip/32a05ba399fc52661f59f38efd2e606f45eb2c8f
Author:        Liang Hao <[email protected]>
AuthorDate:    Fri, 31 Jul 2026 23:04:08 +08:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Tue, 11 Aug 2026 18:08:24 +02:00

hrtimer: Account nr_retries on recovered interrupt retries

Re-arranging hrtimer_interrupt() switched the retry path to a local counter and dropped the update of cpu_base->nr_retries, leaving the field exported via /proc/timer_list stuck at zero.

Increment nr_retries only when another pass through the expiry loop is started; the third attempt that falls through to hang handling is still accounted by nr_hangs alone.

Fixes 288924384856 ("hrtimer: Re-arrange hrtimer_interrupt()")
---
 kernel/time/hrtimer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/time/hrtimer.c +3 -1
index 01890b7..48ee17e 100644
@@ -2254,8 +2254,10 @@ retry:
 	expires_next = hrtimer_update_next_event(cpu_base);
 	cpu_base->hang_detected = false;
 	if (expires_next < now) {
-		if (++retries < 3)
+		if (++retries < 3) {
+			cpu_base->nr_retries++;
 			goto retry;
+		}
 
 		delta = ktime_sub(now, entry_time);
 		cpu_base->max_hang_time = max_t(unsigned int, cpu_base->max_hang_time, delta);