> $ gcc -Wall -O -DINIT_WRITE -DUSE_DSYNC -DBLOCKS=1 tfsync.c
^^^^^^^^^^^
You should use -DUSE_OSYNC to test O_SYNC.
So you've tested N * write() + fsync(), exactly what I've asked -:)
> So I also see that there is no benefit to writing more than
> one block at a time with ODSYNC. And even at half a meg per write,
> DSYNC is slower than ODSYNC with 8K per write! Note the fairly high
> system-time consumption for DSYNC, too. I think this is not so much
> a matter of a really good ODSYNC implementation, as a really bad DSYNC
> one ...
So seems we can use O_DSYNC without losing log write performance
comparing with write() + fsync. Though, we didn't tested write() +
fdatasync()
yet...
Vadim