3 ms·
Linux gives you sync_file_range(2), which solves the granularity problem of fsync(2). (Not that it's a particularly big problem anyway if you store your data a
by colanderman 9y ago
Linux gives you sync_file_range(2), which solves the granularity problem of fsync(2). (Not that it's a particularly big problem anyway if you store your data and log in two separate files. Your data need only be synced during checkpointing, and you always want to sync everything recently written to your log.) fsync(2) semantic issues aside.
While SCSI does support explicit write ordering, many SANs do not. They define write ordering (and therefore crash consistency) using only request-after-reply semantics. So the fact that memory-barrier-style primitives aren't exposed for file or block isn't a big loss for portable applications either.