diff options
author | glebius <glebius@FreeBSD.org> | 2012-02-16 19:10:01 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2012-02-16 19:10:01 +0000 |
commit | da3ed1879e3bf840c5fc71961fcdbb7838363d7b (patch) | |
tree | 6c1e11c5ccca1d21f82292154d21527068c85f86 /sbin/rtsol | |
parent | b154e4b38e47c0d7c442dba56f95dead2a9fa7aa (diff) | |
download | FreeBSD-src-da3ed1879e3bf840c5fc71961fcdbb7838363d7b.zip FreeBSD-src-da3ed1879e3bf840c5fc71961fcdbb7838363d7b.tar.gz |
Refactor the name hash and the ID hash, that are used to address nodes:
- Make hash sizes growable, to satisfy users running large mpd
installations, having thousands of nodes.
- NG_NAMEHASH() proved to give a very bad distribution in real life
name sets, while generic hash32_str(name, HASHINIT) proved to give
an even one, so you the latter for name hash.
- Do not store unnamed nodes in slot 0 of name hash, no reason for that.
- Use the ID hash in cases when we need to run through all nodes: the
NGM_LISTNODES command and in the vnet_netgraph_uninit().
- Implement NGM_LISTNODES and NGM_LISTNAMES as separate code, the former
iterates through the ID hash, and the latter through the name hash.
- Keep count of all nodes and of named nodes, so that we don't need
to count nodes in NGM_LISTNODES and NGM_LISTNAMES. The counters are
also used to estimate whether we need to grow hashes.
- Close a race between two threads running ng_name_node() assigning same
name to different nodes.
Diffstat (limited to 'sbin/rtsol')
0 files changed, 0 insertions, 0 deletions