STRUCT HRTIMER(9)
β¨ struct hrtimer(9) β¨
okay so bestie, welcome to the Kernel API Manual β we're talking about struct hrtimer, and honestly? she's kind of a big deal π
πΈ NAME πΈ
struct hrtimer β the basic hrtimer structure. that's it, that's the vibe. the blueprint. the main character π
π¦ SYNOPSIS π¦
struct hrtimer {
struct timerqueue_linked_node node;
struct hrtimer_clock_base *base;
bool is_queued;
bool is_rel;
bool is_soft;
bool is_hard;
bool is_lazy;
ktime_t _softexpires;
enum hrtimer_restart (*function)(struct hrtimer *);
};
like look at her. gorgeous. no notes π
π§© Members π§©
let me introduce you to the whole squad, one field at a time π
nodeβ the linked timerqueue node, and she's a multitasker: she also managesnode.expires, which is the absolute expiry time in the hrtimer's internal representation. the time is related to the clock the timer is based on. it gets set up by adding slack to the_softexpiresvalue β and for non range timers it's identical to_softexpires. slay πbaseβ pointer to the timer base (per cpu and per clock). two whole dimensions of context, we love to see it β¨is_queuedβ indicates whether a timer is enqueued or not. the "are you in the group chat or not" flag fr fr πis_relβ set if the timer was armed relative πis_softβ set if the hrtimer will be expired in soft interrupt context πis_hardβ set if the hrtimer will be expired in hard interrupt context, even on RT. hard mode literally ππ₯is_lazyβ set if the timer is frequently rearmed to avoid updates of the clock event device. she's being lazy on purpose and honestly? valid π_softexpiresβ the absolute earliest expiry time of the hrtimer. it's the time that was given as the expiry time when the timer was armed. the og value, iykyk βfunctionβ the timer expiry callback function. when the timer goes off, this is the queen who gets called πenum hrtimer_restart (*function)(struct hrtimer *)β she takes astruct hrtimer *and tells you how to restart. iconic signature π
π Description π
the hrtimer structure must be initialized by hrtimer_setup β no cap, do not skip this step, do not just memset and hope for the best π«Ά
β οΈ bestie this is a requirement, not a suggestion: hrtimer_setup is the initialization path here. periodt.
π SEE ALSO π
- Kernel file
./include/linux/hrtimer_types.hβ go read her sister file, she's got lore π§
and that's the whole page, bestie!! π¦π
source location: ./include/linux πΈ dated: October 2026 π β mwah, catch you in the next manpage π
β¨
π¦ 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