HomeFreeBSD

sockstat(1): use tree(3) rbtree instead of hash

Description

sockstat(1): use tree(3) rbtree instead of hash

o Use tree to lookup by socket kvaddr. The size of hash is too big for a

small virtual machine and at the same time too little for a large
production server.  A tree would better fit here.

o For those pcbs, that don't have a socket associated, use a list.
o Provide a second tree to lookup by pcb kvaddr. These removes full hash

traversal when printing every unix(4) socket.

Reviewed by: tuexen
Differential revision: https://reviews.freebsd.org/D35724

Details

Provenance
glebiusAuthored on Jul 7 2022, 5:19 AM
Reviewer
tuexen
Differential Revision
D35724: sockstat(1): use tree(3) rbtree instead of hash
Parents
rG7d016011f485: sockstat(1): we don't need kernel struct unpcb
Branches
Unknown
Tags
Unknown