htb_change_class_mode(9)
β¨ htb_change_class_mode(9) β¨
okay so bestie, this is a page from the Kernel API Manual β yes, the kernel, we're in the big leagues now π
β and it's all about htb_change_class_mode, a lil function whose whole entire job is changing a class's mode. that's it. that's the name. iconic behavior, honestly π
π¦ SYNOPSIS π¦
void htb_change_class_mode (struct htb_sched *q , struct htb_class *cl ,
s64 *diff );
like, no return value, no drama β it just does the thing and dips β¨
πΈ ARGUMENTS πΈ
qβ the priority event queue, i.e. where all the important scheduling stuff lives π«Άclβ the target class. the one we're mode-shifting. main character energy fr fr πdiffβ diff time, measured in microseconds β±οΈ (micro, not milli, don't get it twisted)
π DESCRIPTION π
so the way this works: under normal circumstances, this routine should be the only way you ever change a class's mode. like, the one true path. no cap π«π§’
when you call it, it:
- updates the feed lists linkage π
- changes the mode
- adds the class to the wait event queue if appropriate (only if, bestie β it's conditional, don't @ me)
a couple of things you gotta respect or it's giving chaos π:
the new mode should be different from the old one β genuinely, don't pass the same mode, that's not a vibe
cl->pq_keyhas to be valid if you're changing to a mode other thanHTB_CAN_SENDβ and like, go look athtb_add_to_wait_treeif you need the deets on that one π
β SEE ALSO β
kernel file ./net/sched/sch_htb.c β and the whole friend group of htb functions, all slaying in their own lanes π:
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_activate(9)htb_deactivate(9)htb_charge_class(9)htb_do_events(9)htb_lookup_leaf(9)
okay that's the whole page, you ate it up, you understood the assignment π this lil cutie lives in ./net/sched and the docs are dated October 2026 β so yeah, future-proof AND cunty π§π« mwah, go change some modes responsibly β¨
π¦ 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