htb_do_events(9)
π htb_do_events(9) π
okay so bestie, welcome to the Kernel API Manual β today's main character is htb_do_events(9), and honestly? she's the one quietly keeping the whole HTB class-level situation from falling apart. let's get into it π
β¨ NAME β¨
htb_do_events β makes mode changes to classes at the level. yeah. that's the whole vibe. she shows up, she flips modes, she leaves. iconic behavior only π
πΈ SYNOPSIS πΈ
s64 htb_do_events (struct htb_sched *q , const int level , unsigned long
start );
like, look at that signature. s64 return, three args, zero drama (okay maybe a lil drama, see NOTE below π). periodt.
π¦ ARGUMENTS π¦
qβ the priority event queue π this is the whole reason we're here.levelβ tells you whichwait_pqlives insideq->hlevel. yes, the specific one. don't @ me.startβ the start jiffies β±οΈ the clock we're measuring from, bestie.
π DESCRIPTION π
so what does she actually do? she scans the event queue for pending events and applies them. that's it. that's the job. no cap π«Ά
and then β because she's thoughtful like that β she returns the time of the next pending event. but read the fine print bestie, because the return value is giving three different moods:
0when there's no event in the pqq->nowwhen there are too many events π (yes, too many. she said enough.)
lowkey the most emotionally complex return value in sch_htb.c. ngl.
β NOTE β
applied are the events whose cl->pq_key <= q->now. that's the vibe check they have to pass to get processed. if you're not at or before now, you're not getting applied. sorry babe π
π SEE ALSO π
the kernel file ./net/sched/sch_htb.c and her whole friend group, fr fr:
htb_classify(9)htb_add_to_id_tree(9)htb_add_to_wait_tree(9)htb_next_rb_node(9)htb_add_class_to_row(9)htb_remove_class_from_row(9)htb_activate_prios(9)htb_deactivate_prios(9)htb_class_mode(9)htb_change_class_mode(9)htb_activate(9)htb_deactivate(9)htb_charge_class(9)htb_lookup_leaf(9)
every single one of them. iykyk π
and that's the page!! sourced straight from ./net/sched, dated October 2026 β write it down bestie, that's the receipt π§β¨ bye ily π«Ά
π¦ 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