Volatile ranges with fallocate()
Volatile ranges with fallocate()
Posted Jun 9, 2012 6:32 UTC (Sat) by ncm (guest, #165)In reply to: Volatile ranges with fallocate() by foom
Parent article: Volatile ranges with fallocate()
The sample code looks plausible, but you omitted code to check whether backing store for an address range has been reclaimed. Actually we don't need a new flag; MADV_MREMOVE suffices. The docs don't say what the process would find in an MREMOVEd page, were it to look, or what marking a previously MREMOVEd range MADV_NORMAL does. Mark it MADV_NORMAL to be see if everything written is still there. If that fails, check progressively smaller ranges. Or unmap the lot and forget all about it. Or mark it DONTNEED, equivalent to munmapping and re-mmapping the address range.
