Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 Mar 2007 14:19:18 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        dima <_pppp@mail.ru>
Cc:        freebsd-performance@FreeBSD.org, "O. Hartmann" <ohartman@zedat.fu-berlin.de>
Subject:   Re: (S)ATA performance in FBSD 6.2/7.0 
Message-ID:  <20070305133954.D2598@besplex.bde.org>
In-Reply-To: <E1HNydx-000MLw-00._pppp-mail-ru@f31.mail.ru>
References:  <45E7F09B.7070005@zedat.fu-berlin.de> <E1HNydx-000MLw-00._pppp-mail-ru@f31.mail.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 5 Mar 2007, dima wrote:

> I think you're quite OK with dd. I do believe you'll get a comparable results for cp setting "noatime" option in mount(8)s. As you were told, the default mount mode is noasync which is "synchronous metadata + asynchronous data". But FreeBSD still updates metadata for atime on every file read.

No.  Atime updates are always async (strictly, delayed).  It is another
bug in mount.8 and in many mails in this thread to claim that !noasync
gives sync for all metadata or that sync gives sync for metadata.  The
async and sync flags have no effect on syncing atime updates.

Similarly for updates of all times set by utimes(2).  This might be a
bug in the sync mount and O_FSYNC cases.  fsync(2) on the file after
the utimes(2) will update the metadata (to the disk), but O_FSYNC
doesn't make this happen automatically.  4.4BSD-Lite1 gets this wrong
in the opposite way, by always doing a sync update for times set by
utimes(2).  This was changed in 4.4BSD-Lite2 and misimported into
FreeBSD in rev.1.79 of ufs_vnops.c by splatting Lite2 changes onto the
non-vendor branch and not documenting them.

Similarly except for history for the more critical updates of metadata
changed by chown(2), chmod(2), chflags(2) and perhaps others.  These
updates were always done only to the in-core inode and any syncing to
the disk was accidental.  The syncing for utimes(2) is just an accident
that always happened immediately.  It was silly to sync relatively
unimportant changes to times while not syncing changes to permissions.

> 2all: Are there any reasons not to make noasync the default mount option? It greatly improves FS performance and I don't think many modern administrators do care about access times of their files (assuming how many files a modern box has).

I think you mean noatime.  It is required by POSIX and POLA.

noatime has an especially tiny effect on large copies.  The atime updates
get written to disk every 30 seconds or so, one for every GB or so of data.
noatime makes a difference mainly for tree walks where looking in lots of
directories clobbers their atimes.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070305133954.D2598>