]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
hrtimer: Keep track of first expiring timer per clock base
authorThomas Gleixner <tglx@kernel.org>
Tue, 24 Feb 2026 16:38:28 +0000 (17:38 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 27 Feb 2026 15:40:14 +0000 (16:40 +0100)
commiteddffab8282e388dddf032f3295fcec87eb08095
treee90eefaeb90373f178d265a2ce7b4d52734c3e2b
parentb95c4442b02162904e9012e670b602ebeb3c6c1b
hrtimer: Keep track of first expiring timer per clock base

Evaluating the next expiry time of all clock bases is cache line expensive
as the expiry time of the first expiring timer is not cached in the base
and requires to access the timer itself, which is definitely in a different
cache line.

It's way more efficient to keep track of the expiry time on enqueue and
dequeue operations as the relevant data is already in the cache at that
point.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260224163431.404839710@kernel.org
include/linux/hrtimer_defs.h
kernel/time/hrtimer.c