Proposed purgeDirtyBlocks(uint blocks) purges currently-dirtiest region, wholesale, until at least blocks count of dirty blocks have been purged, or there are none remaining to purge. The actual count of purged dirty blocks (which may exceed the requested count) is returned.
Needs:
Test
Discussion of whether this is in fact a good idea (per my current reading of the pertinent kernel src, madvise on already-clean space appears to have negligible cost; hence this proposed optimization.)
Should probably MADV_FREE rather than MADV_DONTNEED if we go with this?
Start of yet another attempt at https://github.com/snazzy-d/sdc/issues/270 .
Proposed
purgeDirtyBlocks(uint blocks)
purges currently-dirtiest region, wholesale, until at leastblocks
count of dirty blocks have been purged, or there are none remaining to purge. The actual count of purged dirty blocks (which may exceed the requested count) is returned.Needs:
madvise
on already-clean space appears to have negligible cost; hence this proposed optimization.)MADV_DONTNEED
if we go with this?