Date: Fri, 25 Nov 2011 16:16:47 +0100 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Kostik Belousov <kostikbel@gmail.com> Cc: freebsd-fs@freebsd.org Subject: Re: Does UFS2 send BIO_FLUSH to GEOM when update metadata (with softupdates)? Message-ID: <20111125151646.GC1642@garage.freebsd.pl> In-Reply-To: <20111125113756.GZ50300@deviant.kiev.zoral.com.ua> References: <1957615267.20111123230026@serebryakov.spb.ru> <20111123194444.GE50300@deviant.kiev.zoral.com.ua> <20111125110235.GB1642@garage.freebsd.pl> <20111125113756.GZ50300@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--GPJrCs/72TxItFYR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 25, 2011 at 01:37:56PM +0200, Kostik Belousov wrote: > On Fri, Nov 25, 2011 at 12:02:35PM +0100, Pawel Jakub Dawidek wrote: > > On Wed, Nov 23, 2011 at 09:44:44PM +0200, Kostik Belousov wrote: > > > On Wed, Nov 23, 2011 at 11:00:26PM +0400, Lev Serebryakov wrote: > > > > Hello, Freebsd-fs. > > > >=20 > > > > Does UFS2 with softupdates (without journal) issues BIO_FLUSH to > > > > GEOM layer when it need to ensure consistency on on-disk metadata? > > > No. Softupdates do not need flushes. > >=20 > > Well, they do for two reasons: > > 1. To properly handle sync operations (fsync(2), O_SYNC). > > 2. To maintain consistent on-disk structures. > >=20 > > The second point is there, because BIO_FLUSH is the only way to avoid > > reordering (apart from turning off disk write cache). > >=20 > > SU assumes no I/O reordering will happen, which is very weak assumption. > You are not saying the whole truth there. >=20 > SU only depends on the device reporting the finished write to not lie. > The disk layer performing reordering of the writes, or device itself > reordering (but properly reported with some tagging, e.g. NCQ) are > very much fine with SU. Yes, the consolusion is that for SU to keep its state consistent on-disk you need either truly synchronous writes or no reordering. You don't need synchronous writes to maintain SU consistency, you only need to keep ordering right. Because synchronous writes are hard to count on these days, you need to ensure the ordering is right by either using BIO_FLUSH or some (nonexistent) BIO_BARRIER. Synchronous writes (or BIO_FLUSH) are needed to handle O_SYNC/fsync(2) properly, which UFS currently doesn't care about. > Harware that reports finished write and not making the data to stable > storage, or software driver that does such thing itself are just > utterly broken. Well, we ask hardware to do this by default - we turn on disk write cache by default. Solaris doesn't do that, for example. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --GPJrCs/72TxItFYR Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk7PsV4ACgkQForvXbEpPzSTOwCfdXCm92/beJgivKtHg97dDys6 OX0An0oI3p8xAcTCjASbl6x6Jh8/NEl3 =lvpy -----END PGP SIGNATURE----- --GPJrCs/72TxItFYR--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111125151646.GC1642>