If I create a large (a few GB) sparse file in ext4, and then write randomly throughout the length until all 4k blocks have been "touched", in the absence of other heavy write load, can I expect that ext4's delayed write strategy will save me and result in a file that is densely laid out on disk?
My understanding based mainly off of this is that the allocator will attempt to reserve entire extents (128mb chunks), but will delay writing those chunks until memory pressure or time forces a flush-to-disk. However I'm not sure I have the whole story straight, especially given a file large enough compared to RAM that the filesystem is attempting to flush regularly during the writes before an entire extent worth of pages has been dirtied.