htb_next_rb_node(9)
๐ซ htb_next_rb_node โ a Kernel API Manual moment (section 9, bestie) ๐ซ
okay so picture this: you're deep in the kernel, you're in a red-black tree, and you just need to know what's next. That's literally this function's whole personality. Welcome to htb_next_rb_node(9), babe ๐
โจ NAME โจ
htb_next_rb_node โ finds next node in binary tree ๐ณ
๐ธ SYNOPSIS ๐ธ
void htb_next_rb_node (struct rb_node **n );
no cap, that's the whole signature. she's compact. she's iconic. ๐
๐ฆ ARGUMENTS ๐ฆ
nโ the current node in binary tree. like, the node you're standing on right now. your main character node, if you will ๐
๐ DESCRIPTION ๐
So here's the tea โ: when we are past last key we return NULL. That's it, that's the boundary condition โ you've gone too far, there's nothing left, the tree said "girl, no" and hands you NULL ๐
And the performance? Average complexity is 2 steps per call. TWO. STEPS. lowkey obsessed, that's so efficient of her ๐ฅ
๐ฎ SEE ALSO ๐ฎ
- Kernel file
./net/sched/sch_htb.cโ go read the source bestie, it's all there ๐ซถ htb_classify(9)htb_add_to_id_tree(9)htb_add_to_wait_tree(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_do_events(9)htb_lookup_leaf(9)
that's the whole friend group right there, fr fr ๐
ngl if you're reading this page you're probably already in the scheduler code. hydrate. take a break. the tree will still be there ๐
and that's a wrap, babe โจ sourced straight from ./net/sched, dated October 2026, section 9 of the Kernel API Manual โ slay, bye! ๐
๐
๐ฆ 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