Skip to content

Commit ece8be2

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 16774f7 commit ece8be2

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
@@ -1287,6 +1287,14 @@ static int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
12871287
}
12881288

12891289
first = enqueue_hrtimer(timer, new_base, mode);
1290+
1291+
/*
1292+
* If the hrtimer interrupt is running, then it will reevaluate the
1293+
* clock bases and reprogram the clock event device.
1294+
*/
1295+
if (new_base->cpu_base->in_hrtirq)
1296+
return false;
1297+
12901298
if (!force_local) {
12911299
/*
12921300
* If the current CPU base is online, then the timer is

0 commit comments

Comments
 (0)