Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Aug 2010 09:08:40 -0700
From:      Jeremy Chadwick <freebsd@jdc.parodius.com>
To:        Martin Cracauer <cracauer@cons.org>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: fsync(2) and on-disk write-back cache
Message-ID:  <20100831160840.GA74125@icarus.home.lan>
In-Reply-To: <20100830225841.GA9363@cons.org>
References:  <20100830225841.GA9363@cons.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Aug 30, 2010 at 06:58:42PM -0400, Martin Cracauer wrote:
> I always assumed the answer to this question is "of course":
> 
> When doing an fsync (waiting for the commit), do we actually tell the
> disk to flush the on-disk write-back cache (if that is in use) to the
> platters?
> 
> I just went down some code paths in both FreeBSD and Linux and in both
> cases the paths for fsync quickly disappear in the generic
> block-by-block flushing code that is also used for regular (non-fsync)
> flushing.  I didn't see anything aware of the on-disk cache.

I don't have an authoritative answer to your question, but this thread
seems to imply there's a relation between fsync() and an intentional
disk flush (BIO_FLUSH).  I'm sure when BIO_FLUSH is called depends on
the filesystem as well.

Funny timing this topic, given a post over in -stable:

http://lists.freebsd.org/pipermail/freebsd-stable/2010-August/058525.html

-- 
| Jeremy Chadwick                                   jdc@parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.              PGP: 4BD6C0CB |




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