mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-10 13:47:27 +00:00
The current implementation of the allocator was built for for a world where blocks were much, much, larger. It could get away with keeping the entire bitmap resident and having to read it its entirety before being able to use it for the first time. That will not work in the current architecture that's built around a smaller metadata block size. The raw size of the allocator gets large enough that all of those behaviours become problematic at scale. This shifts the buddy allocator to be stored in a radix of blocks instead of in a ring log. This brings it more in line with the structure of the btree item indexes. It can be initially read, cached, and invalidated at block granularity. In addition, it cleverly uses the cow block structures to solve the unreferenced space allocation constraint that the previous allocator hadn't. It can compare the dirty and stable blocks to discover free blocks that aren't referenced by the old stable state. The old allocator would have grown a bunch of extra special complexity to address this. There's still work to be done but this is a solid start. Signed-off-by: Zach Brown <zab@versity.com>