Skip to content

Commit a8759ee

Browse files
Peter Zijlstragregkh
authored andcommitted
hrtimer: Avoid pointless reprogramming in __hrtimer_start_range_ns()
[ Upstream commit d19ff16 ] Much like hrtimer_reprogram(), skip programming if the cpu_base is running the hrtimer interrupt. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Juri Lelli <juri.lelli@redhat.com> Reviewed-by: Thomas Gleixner <tglx@kernel.org> Link: https://patch.msgid.link/20260224163429.069535561@kernel.org Stable-dep-of: f2e388a ("hrtimer: Reduce trace noise in hrtimer_start()") Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6b05c42 commit a8759ee

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

kernel/time/hrtimer.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,14 @@ static int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
12611261
}
12621262

12631263
first = enqueue_hrtimer(timer, new_base, mode);
1264+
1265+
/*
1266+
* If the hrtimer interrupt is running, then it will reevaluate the
1267+
* clock bases and reprogram the clock event device.
1268+
*/
1269+
if (new_base->cpu_base->in_hrtirq)
1270+
return false;
1271+
12641272
if (!force_local) {
12651273
/*
12661274
* If the current CPU base is online, then the timer is

0 commit comments

Comments
 (0)