Date: Sun, 25 Nov 2001 12:45:35 +0100 From: Tarjei Huse <[EMAIL PROTECTED]>
This is from lwn.net, latest. How large will the effect be for cyrus-imapd? I guess this is a good reason to advize people to use reiser or ext3 :) Tarjei Honestly, I thought the +S bit already did fully synchronous writes. ext2's performance with +S has always been fairly horrible compared to a standard FFS system, so now I'm even more puzzled. Anyway, this is a horrible idea. If they must do this, they should make a new mount option for the new semantics, not modifying an old one. Larry How synchronous should Linux be? One day, as Andrew Morton was wandering around the filesystem code, he noticed a seeming inconsistency. While Linux, like most operating systems that are concerned with performance, buffers filesystem writes in the kernels, it does provide a couple of ways for the user to request synchronous behavior: The "sync" option, used with the mount command, will request synchronous writes for every file in the filesystem. The chattr +S command can request synchronous updates for a single file or directory. What Andrew noticed is that, while most operations are indeed implemented synchronously, the data actually written to files is not. So he posted a patch making writes synchronous as well. It turns out, though, that there are two types of opinion regarding synchronous writes of file data. Linux has never, in the past, had that behavior. The claim in the mount man page ("All I/O to the file system should be done synchronously.") is simply incorrect. Fully synchronous behavior is very expensive, leading to horrible performance, and is, according to some, rarely needed. It is better, according to this camp, to expect applications to use the fsync() system call to explicitly force synchronous behavior when it's needed in a specific situation. Rather than implement synchronous file writes, these folks (as typified by Stephen Tweedie) propose instead to limit implicit synchronous behavior to directories. On the other side, Jeff Garzik argued that implementing synchronous file writes is the correct thing to do. Users sometimes need that behavior, and it is impractical to hack up applications and scripts to call fsync() explicitly. A separate dirsync mount option could provided to request synchronous semantics for directories only. Amusingly, Andrew appears to have been won over by the first point of view, but his patch (implementing the second) found its way into 2.4.15-pre5. Unless something changes, fully synchronous behavior will be the way of things in 2.4.15.