The fragmentation score is evaluated as a proportion between
score of ideal (all free in one fragment) and terrible (as fragmented as possible).
The mistake is to behave as if free blocks of size 1 are possible,
while in reality smallest block possible is min_alloc_size.
Analysis of maximum fragmentation bias:
https://docs.google.com/spreadsheets/d/16pfs-xoV6rhR3nHXmja-5iQ3pZW6AlSz_aZqi7_ZOFI/edit#gid=0
Partially fixes: https://tracker.ceph.com/issues/58022
Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
};
foreach(iterated_allocation);
-
double ideal = get_score(sum);
- double terrible = sum * get_score(1);
+ double terrible = (sum / block_size) * get_score(block_size);
return (ideal - score_sum) / (ideal - terrible);
}