New region alloc
upfront: This is not the segment allocation, which uses parts of the busy obj region allocation, and is mostly motivated by how much data we need to have in RAM at minimum. For the region allocation, we have conflicting goals: - To keep the log short, we want to use the least number of regions - To reduce fragmentation, we want to use the largest possible allocations - To use space efficiently, we want to split regions into power of two allocations. Also, for chunked encoding, we do not have an upper limit of how much space we are going to need, so we have to use the estimate provided by fellow_busy_obj_getspace(). It can not guess more than objsize_max. The new region alloc algorithm takes this compromise: - For the base case that we ran out of available regions (220), we allocate all we need without cramming. - Otherwise if we need less than a chunk, we request it - Otherwise if we know the size, we round down to a power of two - Otherwise we round up We then allow any cramming down to the chunk size, because that is what our LRU reservation uses.
Showing
Please register or sign in to comment