htb_class_mode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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 πŸ¦‹

mwah πŸ’‹ β€” with love from ./net/sched, dated October 2026. 🫢

πŸ“¦ where this page comes from