net/sched/sch_htb.c
Source file repositories/reference/linux-study-clean/net/sched/sch_htb.c
File Facts
- System
- Linux kernel
- Corpus path
net/sched/sch_htb.c- Extension
.c- Size
- 57828 bytes
- Lines
- 2172
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/moduleparam.hlinux/types.hlinux/kernel.hlinux/string.hlinux/errno.hlinux/skbuff.hlinux/list.hlinux/compiler.hlinux/rbtree.hlinux/workqueue.hlinux/slab.hnet/netlink.hnet/sch_generic.hnet/pkt_sched.hnet/pkt_cls.h
Detected Declarations
struct htb_priostruct htb_classstruct htb_class_leafstruct htb_class_innerstruct htb_levelstruct htb_schedenum htb_cmodefunction htb_searchfunction nodesfunction listfunction htb_add_to_wait_treefunction htb_next_rb_nodefunction htb_add_class_to_rowfunction htb_safe_rb_erasefunction htb_remove_class_from_rowfunction htb_activate_priosfunction htb_deactivate_priosfunction htb_lowaterfunction htb_hiwaterfunction htb_class_modefunction HTB_CAN_SENDfunction learnsfunction htb_deactivatefunction htb_enqueuefunction htb_accnt_tokensfunction htb_accnt_ctokensfunction htb_charge_classfunction eventfunction htb_resetfunction hlist_for_each_entryfunction htb_work_funcfunction htb_offloadfunction htb_initfunction htb_attach_offloadfunction htb_attach_softwarefunction htb_attachfunction htb_dumpfunction htb_dump_classfunction htb_offload_aggregate_statsfunction hlist_for_each_entryfunction htb_dump_class_statsfunction htb_select_queuefunction htb_graft_helperfunction htb_offload_move_qdiscfunction htb_graftfunction htb_qlen_notifyfunction htb_parent_last_childfunction htb_parent_to_leaf
Annotated Snippet
module_init(htb_module_init)
module_exit(htb_module_exit)
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Hierarchical Token Bucket scheduler");
Annotation
- Immediate include surface: `linux/module.h`, `linux/moduleparam.h`, `linux/types.h`, `linux/kernel.h`, `linux/string.h`, `linux/errno.h`, `linux/skbuff.h`, `linux/list.h`.
- Detected declarations: `struct htb_prio`, `struct htb_class`, `struct htb_class_leaf`, `struct htb_class_inner`, `struct htb_level`, `struct htb_sched`, `enum htb_cmode`, `function htb_search`, `function nodes`, `function list`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.