Skip to content

rts: Allocate non-moving segments with megablocks

Teo Camarasu requested to merge wip/T24150 into master

This implements what I mention in #24150.

In short, this patch makes non-moving segment allocation happen in bulk at the scale of a megablock. When we want some more segments, we allocate a megablock worth. When determining whether to free segments, we only do so if the entire megablock of segments can be freed.

Note that we get rid of the logic whereby NONMOVING_MAX_FREE segments are kept on the free list. I couldn't square this with the logic of either de-allocating the entire megablock or none of it. But I imagine the new logic will keep sufficiently many segments on the free list anyway.

Initial testing shows that this leads to quite significant savings. On one test case megablock usage dropped from 115GB to 85GB. That's a drop of 30GB, which amounts to a 26%(!) saving. (Note the scale differs on the images below)

image image

I'll do some more testing and report back.

Edited by Teo Camarasu

Merge request reports