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)
Tue, Nov 26, 9:40 AM
Unknown Object (File)
Tue, Nov 26, 8:49 AM
Unknown Object (File)
Tue, Nov 26, 8:45 AM
Unknown Object (File)
Wed, Nov 20, 12:29 AM
Unknown Object (File)
Tue, Nov 19, 11:04 PM
Unknown Object (File)
Tue, Nov 19, 9:12 PM
Unknown Object (File)
Sep 18 2024, 2:15 PM
Unknown Object (File)
Sep 1 2024, 5:42 AM
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.