Hi,

On Thu, Apr 20, 2000 at 10:57:15AM +0200, Benno Senoner wrote:
> 
> I tried all combinations using my hdtest.c which I posted yesterday.
> 
> I tried O_SYNC and even O_DSYNC on the SGI (Origin 2k),
> (D_SYNC syncs only data blocks but not metadata blocks)

Not quite.  O_DSYNC syncs metadata too.  The only thing it skips is
inode timestamps.  

There is an important difference between the two when you are overwriting
an existing allocated file.  In that case, there are no metadata changes
except for timestamp updates, so O_DSYNC is very much faster.  However,
if you are appending to a file, then some metadata updates (for file
mapping information and for the file size) are necessary for both 
O_SYNC and O_DSYNC.
 
> write() + fsync()/fdatasync() on linux doesn't work well too since the kernel
> isn't able to optimize disk writing by using the elevator algorithm.

There are other problems with fsync/fdatasync in 2.2.  In particular,
it is slow for larger files since it tries to scan all the mapping
information for the entire file.

I'll put together an old patch I did to make fsync/fdatasync and
O_DSYNC work much faster.  It will be interesting to see if it makes
much difference, and it may be the stick we need to beat Linus into
believing that this change is really quite important.

--Stephen

Reply via email to