Am 04.04.2014 23:28, schrieb Claudio Freire:
Why not preallocate the space?
Because the genius did not think of this?
That would get rid of fragmentation, and it should be a mostly-oneliner patch (call to posix_fallocate).
For reading, posix_fadvise (or madvise) could read it whole (to avoid reading it in random fashion).
Has this been tried?
a676e66535e12458ea6d366a653f8dd60f982504 seems to do this: + /* Increase the file size a bit further than this, so that we + * we can create larger memory maps to cache */ + file_size = ((new_size+FILE_SIZE_INCREASE-1) / FILE_SIZE_INCREASE) * FILE_SIZE_INCREASE; + if (file_size > (uint64_t) f->last_stat.st_size) { + if (file_size > new_size) + ftruncate(f->fd, file_size); + + if (fstat(f->fd, &f->last_stat) < 0) + return -errno; + } FILE_SIZE_INCREASE is 8MB. And since this patch is ported back to opensuse, fragmentation is much better: Files with mtime 2014-02-13: ... 1420 extents found ... 786 extents found later files: ... 12 extents found system.journal: 20 extents found So it should be better nowadays. -- Stefan Seyfried "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." -- Richard Feynman -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org