hrtimer_start_range_ns_user(9)
π hrtimer_start_range_ns_user(9) π
okay so bestie, welcome to the Kernel API Manual β¨ this one's all about hrtimer_start_range_ns_user β the (re)start of a user-controlled hrtimer, and honestly it's giving main character energy in ./kernel/time/hrtimer.c π
πΈ NAME πΈ
hrtimer_start_range_ns_user β (re)start an user controlled hrtimer π lowkey iconic, no cap
β¨ SYNOPSIS β¨
bool hrtimer_start_range_ns_user (struct hrtimer *timer , ktime_t tim ,
u64 delta_ns , const enum hrtimer_mode mode );
fr fr that's the whole vibe β a bool coming back at you π
π¦ ARGUMENTS π¦
timerβ the timer to be added π°οΈ like, the actual thing you're queueing uptimβ expiry time β° when it goes off, bestiedelta_nsβ the "slack" range for the timer π«Ά yes queen, a little wiggle room, quoted in the original and everythingmodeβ timer mode, and listen closely because there's lore here π:- absolute (
HRTIMER_MODE_ABS) or relative (HRTIMER_MODE_REL) - and pinned (
HRTIMER_MODE_PINNED) - softirq based mode is considered for debug purpose only! π not me warning you, it literally says that
- absolute (
π RETURN π
- True when the timer was queued β slay
- false if it was already expired π awkward but okay
π DESCRIPTION π
okay so this is the important part, don't skip it π This function cannot invoke the timer callback for expired timers, because it might be called under a lock which the timer callback needs to acquire. so likeβ¦ deadlock vibes, we don't do that here π
So the caller has to handle that case. yes, you. you handle it. periodt π
π§ SEE ALSO π§
Kernel file ./kernel/time/hrtimer.c β go read it, it ate π₯
hrtimer_update_function(9)hrtimer_forward(9)hrtimer_start_range_ns(9)hrtimer_try_to_cancel(9)hrtimer_cancel(9)__hrtimer_get_remaining(9)hrtimer_get_next_event(9)hrtimer_next_event_without(9)hrtimer_setup(9)hrtimer_setup_on_stack(9)hrtimer_sleeper_start_expires(9)hrtimer_setup_sleeper_on_stack(9)
π«Ά quick vibe check bestie:HRTIMER_MODE_ABS/HRTIMER_MODE_REL/HRTIMER_MODE_PINNEDare the modes, softirq based mode is debug purpose only, and the callback situation for expired timers is your problem, not the function's β¨
and that's the whole page, iykyk π this gem lives in ./kernel/time, dated October 2026, and it's hrtimer_start_range_ns_user(9) β go forth and schedule responsibly ππ¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms