From owner-freebsd-questions@FreeBSD.ORG Sun Jun 15 11:39:37 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CC301065673 for ; Sun, 15 Jun 2008 11:39:37 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from weak.local (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 991568FC18; Sun, 15 Jun 2008 11:39:35 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <4854FF77.80901@FreeBSD.org> Date: Sun, 15 Jun 2008 13:39:35 +0200 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: RW References: <20080614224742.17316919@gumby.homeunix.com.> <48545212.4040006@FreeBSD.org> <20080615013158.7dd19cf0@gumby.homeunix.com.> <48546B92.5050906@FreeBSD.org> <20080615035555.0b5d4b1c@gumby.homeunix.com.> In-Reply-To: <20080615035555.0b5d4b1c@gumby.homeunix.com.> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: md devices mounted with async X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jun 2008 11:39:37 -0000 RW wrote: > On Sun, 15 Jun 2008 03:08:34 +0200 > Kris Kennaway wrote: > >> RW wrote: >>> I meant that a write to the filesystem doesn't require a >>> corresponding write to disk, and the change can stay in memory >>> indefinitely. Presumably, more or less, the same inactive pages get >>> written-out to swap, with or without async. >> Well, it doesn't necessarily cause a write to disk for each >> filesystem write, but the synchronization mode of the filesystem to >> the backing store is precisely what the async/noasync/sync mount >> options control! > > It's not obvious that that's true when the backing-store is swap, I > would have expected that changes would only be written-out when memory > is needed elsewhere rather than to keep the backing-store synchronized. Let's recap :-) You said: > > Is there any point in doing this with malloc and vnode > > devices? In neither case does a write to the file-system require a write > > to a physical disk. I said: > Well, for vnode devices it does write to the disk, but that isn't the > point; So I was referring to vnode devices. I guess there was some confusion because in your reply you mentioned swap, not vnode. Anyway, to be clear: when a filesystem mounted on md is written to it writes through to its' backing store according to the mount policy of the filesystem (e.g. with sync mounts all writes are written through synchronously, etc). That is why async mounts on top of the md are most efficient (as with mounts on top of any device). In the case of swap backing this means the vm page is marked dirty, and it will be written to swap in case of memory pressure. That is indeed why swap backing is more efficient. For vnode backing the file is written to, which will again be written to disk according to the sync mount mode of the underlying filesystem. Kris