Page MenuHomeFreeBSD

radix_trie: simplify trimkey functions
ClosedPublic

Authored by dougm on Jun 23 2023, 8:34 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 30, 11:00 PM
Unknown Object (File)
Apr 11 2024, 2:09 PM
Unknown Object (File)
Feb 13 2024, 8:38 PM
Unknown Object (File)
Dec 20 2023, 8:39 AM
Unknown Object (File)
Dec 19 2023, 4:57 PM
Unknown Object (File)
Nov 26 2023, 5:03 AM
Unknown Object (File)
Nov 22 2023, 11:19 AM
Unknown Object (File)
Nov 22 2023, 8:56 AM
Subscribers

Details

Summary

Replacing a branch and two shifts with a single masking operation saves 64 bytes the pair of functions lookup_le and lookup_ge.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dougm requested review of this revision.Jun 23 2023, 8:34 AM
dougm created this revision.
sys/vm/vm_radix.c
187–188

I don't see the point of retaining this variable.

188

Can you revise the comment at the top of the function to more clearly explain what is being done here? "Trims the key" is not very clear.

dougm marked 2 inline comments as done.
This revision is now accepted and ready to land.Jun 25 2023, 5:48 PM
This revision was automatically updated to reflect the committed changes.

I'm surprised this is needed, you'd hope the compiler could do this transformation. Maybe worth filling a LLVM bug report?