htb_class_mode(9)
okay so bestie, welcome to htb_class_mode(9) from the Kernel API Manual β the little function that does a vibe check on an HTB class and reports its current mode. grab a strawberry π and letβs go.
π NAME π
htb_class_mode β literally computes and returns the current class mode. no cap, thatβs the whole assignment. periodt.
β¨ SYNOPSIS β¨
enum htb_cmode htb_class_mode (struct htb_class *cl , s64 *diff );
π ARGUMENTS π
clβ the target class. thatβs the main character here πdiffβ diff time in microseconds. yes, microseconds, write it down bestie β±οΈ
π DESCRIPTION π
so the function computes clβs mode at time cl->t_c+diff and returns it. easy.
if the mode is not HTB_CAN_SEND, then cl->pq_key gets updated to the time difference from now to the time when cl will change its state. iykyk.
also, important little caveat: the class mode does not simply change at cl->{c,}tokens == 0 β there can rather be hysteresis of 0 .. -cl->{c,}buffer range. thatβs on purpose: itβs meant to limit the number of mode transitions per time unit. the speed gain is about 1/6. slay for efficiency π₯
π¦ SEE ALSO π¦
- Kernel file
./net/sched/sch_htb.c 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_change_class_mode(9)htb_activate(9)htb_deactivate(9)htb_charge_class(9)htb_do_events(9)htb_lookup_leaf(9)
mwah π β with love from ./net/sched, dated October 2026. π«Ά
π¦ 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