2 ms·
A more advanced (and somewhat easy to get wrong) option would be sync_file_range combined with fdatasync, which allows to roughly emulate O_DSYNC overall but wi
by blattimwind 9y ago
A more advanced (and somewhat easy to get wrong) option would be sync_file_range combined with fdatasync, which allows to roughly emulate O_DSYNC overall but without blocking synchronously for IO.
- jorangreef 9y agosync_file_range is different to fsync, fdatasync and O_DSYNC in that it does not flush the disk write cache (whereas the latter explicitly do on newer kernels): https://linux.die.net/man/2/sync_file_range https://linux.die.net/man/2/sync_file_range: This system call does not flush disk write caches and thus does not provide any data integrity on systems with volatile disk write caches.
- blattimwind 9y agoHence "sync_file_range combined with fdatasync". sfr is only useful to get the kernel to start the write-out now.