Two cases in the insert routine are written differently, when they're really doing the same thing. Writing that case only once saves 208 bytes in the compiled vm_radix_insert code.
Details
Details
- Reviewers
alc markj kib - Commits
- rG16e01c05c09e: radix_trie: avoid code duplication in insert
I have successfully booted a kernel with it.
A pair of 'make buildworld' tests counted function calls and cycles spent on vm_radix_insert.
old
vm.radix.ins_cycles: 80079998931
vm.radix.ins_calls: 344880306
cycles/call: 232.19649698118744
new
vm.radix.ins_cycles: 78438877181
vm.radix.ins_calls: 344817853
cycles/call: 227.47916472004715
Peter, can you test this please?
Diff Detail
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
sys/kern/subr_pctrie.c | ||
---|---|---|
395 | After this change, both pctrie_keydiff and pctrie_node_get are invoked only once. |
Comment Actions
I ran test with D40807.id124308.diff for 15 hours without seeing any issues. This on:
FreeBSD mercat1.netperf.freebsd.org 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n264058-5fee12e18967d-dirty: Sat Jul 8 16:35:55 CEST 2023 pho@mercat1.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO amd64