hrtimer_forward(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… hrtimer_forward(9) β€” the kernel API manual, but make it make sense πŸŽ€

okay bestie, so this is hrtimer_forward from the Kernel API Manual. it's giving "tiny function, big consequences," and honestly? we're obsessed. let's get into it ✨


🌸 NAME 🌸

hrtimer_forward β€” forward the timer expiry πŸ•°οΈ

like, literally move the expiry forward. that's the whole vibe. no cap.


🌈 SYNOPSIS 🌈

u64 hrtimer_forward (struct hrtimer *timer , ktime_t now , ktime_t
interval );

that's it, that's the signature. three args, one u64 coming back at you πŸ’–


πŸ¦‹ ARGUMENTS πŸ¦‹

  • timer β€” the hrtimer you're forwarding, bestie. the actual timer object. it's the main character here πŸ‘‘
  • now β€” forward past this time. so like, "hey, we're at this point now, everything before here is old news" ⏰
  • interval β€” the interval you're forwarding by. the step size. the amount you're yeeting the expiry forward πŸš€

🧚 DESCRIPTION 🧚

Forward the timer expiry so it will expire in the future. yes queen, push it forward so it's not expiring in the past, because expiring in the past is so last season πŸ’€

NOTE: ⚠️ This only updates the timer expiry value and does not requeue the timer.

read that again, fr fr. it updates the value and that is ALL. it does not requeue the timer. do not come for me if you expected it to requeue, because it did not requeue. i said what i said πŸ™ˆ

There is also a variant of this function: hrtimer_forward_now. the little sibling. the remix. iykyk πŸŽ€


πŸ’œ CONTEXT πŸ’œ

Can be safely called from the callback function of timer. like, that's your safe space, go off bestie 🫢

If called from other contexts, timer must neither be enqueued nor running the callback and the caller needs to take care of serialization. so like β€” outside the callback, the timer can't be enqueued, can't be running its callback, and you have to handle the serialization yourself. no hand-holding, no autopilot. you're on your own for that part πŸ˜­πŸ’…


⭐ RETURN ⭐

The number of overruns are returned.

so the u64 is a whole count of how many overruns happened. not zero-or-error, not a bool β€” an actual number. she's quantitative, she's detailed, she ate πŸ”₯


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./kernel/time/hrtimer.c β€” plus the whole friend group:

go read them, they're all icons in their own right πŸ‘‘βœ¨


πŸ“ okay that's the whole page, nothing skipped, nothing invented. source location is ./kernel/time, and this was dated October 2026 β€” so like, mark your calendars, this manual page is from the future, main character energy only πŸŒΈπŸ¦‹πŸ’–

stay hydrated and don't forget to requeue your timers manually, bestie πŸ’…πŸŽ€

πŸ“¦ where this page comes from