Hi,

On Fri, Jun 09, 2000 at 02:53:19PM -0700, Ulrich Drepper wrote:
> 
> > If I don't preallocate the file, then even fdatasync is slow, [...]
> 
> This might be a good argument to implement posix_fallocate() in the
> kernel.

No.  If we do posix_fallocate(), then there are only two choices:
we either pre-zero the file contents (in which case we are as well
doing it from user space), or we record in the inode that the file
isn't pre-zeroed and so optimise things.

If we do that optimisation, then doing an O_DSYNC write to the 
already-allocated file will have to record in the inode that we are
pushing forward the non-prezeroed fencepost in the file, so we end
up having to seek back to the inode for each write anyway, so we
lose any possible benefit during the writes.

Once you have a database file written and preallocated, this is all
academic since all further writes will be in place and so will be 
fast the th O_DSYNC/fdatasync support.

Cheers,
 Stephen

Reply via email to