4 ms·
You don't need even to bother with fsync unless you are developing a database or use the file system like a database. There's a reason Apple made fsync useless
by kccqzy 2y ago
You don't need even to bother with fsync unless you are developing a database or use the file system like a database.
There's a reason Apple made fsync useless and introduced F_FULLSYNC. They know developers have an incentive to overestimate the importance of their own files at the detriment to system responsiveness and power draw.
- account42 2y agoAgreed, things like Firefox constantly fsyncing its profile database is absurd.
- o11c 2y agoThe problem is, Apple's fsync doesn't even introduce any useful semantics. All it says is "write this eventually". What a lot of people really need is just a "provide ordering, don't leave me with inconsistent data" operation. If you lose power "after" a write but before the fsync, for any non-networked application that's no different than losing power before the write, as long as the filesystem doesn't introduce chaos.
- lxgr 2y agoThat seems significantly harder to implement, though, given that dirty page cache entries don't have an order entry as far as I know, and so retroactively figuring out which writes not to reorder with others is anything but trivial.