Re: vfs: Add MS_FLUSHONFSYNC mount flag
From: Jeff Garzik
Date: Sun Feb 22 2009 - 18:42:46 EST
Theodore Tso wrote:
On Sun, Feb 22, 2009 at 03:15:33PM +0100, Pavel Machek wrote:
Sounds like posix violation to
me... '/sys/fsync_does_not_really_sync'?
It's as much a Posix violation as noatime. :-)
Perhaps it is better done at glibc level? Environment variables
already mostly have semantics you want.....
Environment variables own't allow us to switch fsync's on and off
while the process is running, so that the system can run "safe" while
it is on AC mains, but "low power" when on battery.
Overall, for each filesystem, we really should _default_ to a safe mode
where fsync(2), fdatasync(2), sync_file_range(2) and transaction commits
are guaranteed to be committed to stable storage -- i.e. SYNC CACHE /
FLUSH CACHE, a forced unit access (FUA) bit, or guarantee that the
underlying storage has disabled write-back caching.
Correctness should come before performance. Linux has not had
credibility here, in the ATA+ext[23] space at least, and it is embarrassing.
Modern SATA and SCSI disks can do tagged command queueing with the FUA
bit, which does a lot to mitigate the performance loss seen with a less
capable "FLUSH CACHE + barrier" setup.
Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/