Date: Wed, 1 Sep 2010 09:48:05 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Martin Cracauer <cracauer@cons.org> Cc: freebsd-fs@freebsd.org Subject: Re: fsync(2) and on-disk write-back cache Message-ID: <20100901064805.GF2396@deviant.kiev.zoral.com.ua> In-Reply-To: <20100831230728.GA36384@cons.org> References: <20100830225841.GA9363@cons.org> <20100831160840.GA74125@icarus.home.lan> <alpine.GSO.1.10.1008311210091.9337@multics.mit.edu> <20100831230728.GA36384@cons.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--Zv6RaYeLzrVfNTUZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 31, 2010 at 07:07:28PM -0400, Martin Cracauer wrote: > Benjamin Kaduk wrote on Tue, Aug 31, 2010 at 12:12:04PM -0400:=20 > > On Tue, 31 Aug 2010, Jeremy Chadwick wrote: > >=20 > > >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. >=20 > I just went the for-dummies way and annotated all relevant BIO_FLUSH > places with debug print statements. They don't seem to be called when > doing an fsync on a file in a local filesystem. ufs (no softupdates) > -> old-style SCSI disk. >=20 > I'll snoop around some more, try it on ZFS/SATA and do some timing > tests. Be assured that all variants of UFS (sync, async, SU, SU+J) do not call BIO_FLUSH. --Zv6RaYeLzrVfNTUZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkx99yQACgkQC3+MBN1Mb4jcqQCgyqLtkAiTxZoEw9bmpPfUteaC UiIAoO4PRdQ7q/P3EAjErhh7h2G/m7IZ =lyKn -----END PGP SIGNATURE----- --Zv6RaYeLzrVfNTUZ--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100901064805.GF2396>