XFS Preallocate using ALLOCSP

Felix Blyakher felixb at sgi.com
Tue Jun 16 12:41:45 CDT 2009

On Jun 16, 2009, at 12:28 PM, Smit Shah wrote:

> Yeah rite what i meant to say was that posix_fallocate uses ftruncate
> which in turn just updates the i_size and then posix_fallocate zeros
> out the whole thing

I didn't look at the libc implementation, but it seems
strange to use ftruncate here at all. Is it more efficient
to write zeros into a hole than appending to a file?


> Just to see if preallocation using fallocate helps reducing the
> fragmentation and increases the throughput.  I guess it wll help
> reduce the fragmentation

... and as result read performance on such files.

> but the write performance is going to suffer.

It's not clear why it should. Not doing preallocation doesn't
mean that there is no inode updates with every write. Why
would extent conversion be more expensive that creating the
space (extent) and updating the inode size for every write?
It'd interesting to reproduce your results. Any details on
your tests and the iometer usage?


More information about the xfs mailing list