• Oran Agra's avatar
    fix a rare active defrag edge case bug leading to stagnation · 88d71f47
    Oran Agra authored
    There's a rare case which leads to stagnation in the defragger, causing
    it to keep scanning the keyspace and do nothing (not moving any
    allocation), this happens when all the allocator slabs of a certain bin
    have the same % utilization, but the slab from which new allocations are
    made have a lower utilization.
    
    this commit fixes it by removing the current slab from the overall
    average utilization of the bin, and also eliminate any precision loss in
    the utilization calculation and move the decision about the defrag to
    reside inside jemalloc.
    
    and also add a test that consistently reproduce this issue.
    88d71f47
memefficiency.tcl 18.7 KB