Date: Sun, 4 Mar 2007 22:54:56 +1100 (EST) From: Bruce Evans <bde@zeta.org.au> To: Alexander Leidinger <Alexander@Leidinger.net> Cc: freebsd-performance@FreeBSD.org, Alan Amesbury <amesbury@umn.edu> Subject: Re: (S)ATA performance in FBSD 6.2/7.0 Message-ID: <20070304225448.R7151@besplex.bde.org> In-Reply-To: <20070303110940.32893388@Magellan.Leidinger.net> References: <20070302120018.5830716A4A9@hub.freebsd.org> <45E8B994.2010100@umn.edu> <20070303110940.32893388@Magellan.Leidinger.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 3 Mar 2007, Alexander Leidinger wrote: > In FreeBSD we have 3 types, not 2. We have "sync", "noasync" (default) > and "async". Are you sure? 2 independent flags give 4 states. I think the flags are not completely independent, but sync doesn't cancel async in all cases (partly because of layering violations in ffs_update()) so sync together with async gives sync data with an undocumented combination of sync and async metadata. > For async the complete IO is done asynchronous (the meta-data too). Exccept possibly for (small) bugs. > And for sync the complete IO is synchronous. Except certainly for (larger) bugs. ffs_inode() normally refuses to do sync writes unless !DOINGASYNC(vp). When DOINGASYNC(vp), it mostly ignores its waitfor arg (this is its layering violation) and does a delayed write (not an async write, but an async write after a delay). This breaks cases where its caller wants to force a non-async write. Callers want to do this in the following cases: - sync together with async on the mount. sync should have precedence. I think the sync code knows to set waitfor = 1 for the call, but doesn't know that ffs_inode() will ignore the setting. - async on the mount with explicit fsync(2) or O_[F]SYNC. fsync(2) sets waitfor = 1, so the inode should get synced even if DOINGASYNC(vp), but it doesn't due to the layering violation. fsync(2) doesn't know how to sync all the directories above the file, and their metadata. O_[F]SYNC for the file together with async for the mount should work for the file like sync together with async for the mount work for all files, but has much the same bugs as fsync(2). > mount(8) tells this with some more words. It has related bugs. It literally says that sync and async have precedence over each other, but this is impossible. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070304225448.R7151>