3

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.

1 Answer 1

1
  1. By on disk, did you mean physically laid densely? If this is what you meant, the answer is NO. The controller on-disk decides how your data placed physically (In most cases)

  2. If you mean logically densely (In terms of Ext4 address), then YES, ext4 will reserve enough logical address for you.

  3. Your writes to ext4 will not be flushed immediately (If you are not using Direct IO) till the page cache is flushed by the OS.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .