Page MenuHomeFreeBSD

Avoid unnecessary calculation in blst_next_leaf_alloc
ClosedPublic

Authored by dougm on May 10 2019, 4:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 27, 7:50 AM
Unknown Object (File)
Sat, Apr 27, 7:49 AM
Unknown Object (File)
Sat, Apr 27, 7:49 AM
Unknown Object (File)
Sat, Apr 27, 6:11 AM
Unknown Object (File)
Dec 13 2023, 11:23 PM
Unknown Object (File)
Aug 13 2023, 6:22 AM
Unknown Object (File)
Aug 2 2023, 6:14 PM
Unknown Object (File)
Jul 5 2023, 8:28 PM
Subscribers

Details

Summary

blist_next_leaf_alloc walks over all the meta-nodes between one leaf and the next one, and if blocks are allocated from the next leaf, it walks back toward where it started, as long as there are interleaving meta-nodes to be updated on account of the last free blocks under those meta-nodes being allocated. Only if the walk goes all the way back to the starting point must we calculate the position of the meta-node that is the least-comment parent of one leaf and the next, and update a bit in that meta-node to indicate the allocation of its last free block.

There's no need to start calculating the position of that least-common parent until the walk back reaches the original starting point, and there's no need for a calculation that updates 'radius' to tell us when we've walked back to the beginning, since comparing scan to next suffices for that.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

There is definitely more changes in the diff than just removal of skip calculation. For instance, the radix != BLIST_BMAP_RADIX is removed from the loop condition, while '-- next == scan' added. New ephemeral skip is calculated with the different value of radix.

Can you mention all of that in the commit message, and explain why it is correct ?

The ephemeral value of 'skip' is not computed with a different value of 'radius'.

This revision is now accepted and ready to land.May 10 2019, 5:53 PM
This revision was automatically updated to reflect the committed changes.