hrtimer_start_range_ns_user(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 up
  • tim β€” expiry time ⏰ when it goes off, bestie
  • delta_ns β€” the "slack" range for the timer 🫢 yes queen, a little wiggle room, quoted in the original and everything
  • mode β€” 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

🌈 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 πŸ”₯


🫢 quick vibe check bestie: HRTIMER_MODE_ABS / HRTIMER_MODE_REL / HRTIMER_MODE_PINNED are 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