From owner-freebsd-geom@FreeBSD.ORG Sun Sep 23 06:42:50 2012 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9776B1065678 for ; Sun, 23 Sep 2012 06:42:50 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 5A6458FC08 for ; Sun, 23 Sep 2012 06:42:50 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id C1528EB1 for ; Sun, 23 Sep 2012 08:41:51 +0200 (CEST) Date: Sun, 23 Sep 2012 08:43:07 +0200 From: Pawel Jakub Dawidek To: freebsd-geom@freebsd.org Message-ID: <20120923064307.GK1454@garage.freebsd.pl> References: <20120919040430.GF19036@funkthat.com> <20120922162025.GE1454@garage.freebsd.pl> <20120923044828.GI19036@funkthat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="S6vg04ofUPzW4qJg" Content-Disposition: inline In-Reply-To: <20120923044828.GI19036@funkthat.com> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: geli and BIO_FLUSH and/or BIO_ORDERED issue? X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Sep 2012 06:42:50 -0000 --S6vg04ofUPzW4qJg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Sep 22, 2012 at 09:48:28PM -0700, John-Mark Gurney wrote: > Pawel Jakub Dawidek wrote this message on Sat, Sep 22, 2012 at 18:20 +020= 0: > > On Tue, Sep 18, 2012 at 09:04:30PM -0700, John-Mark Gurney wrote: > > > I was looking at geli and I'm not sure if it's implementing BIO_FLUSH > > > and/or BIO_ORDERED properly... > > >=20 > > > >From my understanding is the BIO_ORDERED is suppose to wait for the > > > previous _WRITES to complete before returning so that you can ensure > > > that data is on disk, i.e. _ORDERED is set on a BIO_FLUSH... > > >=20 > > > BIO_ORDERED is handled by diskq_* code such that when you add an _ORD= ERED > > > command, all commands are put after it, but there doesn't appear to > > > be any code to ensure that an _ORDERED command waits for prevoius > > > pending commands to complete.. > > >=20 > > > This is extra obvious in eli in that a _FLUSH is immediately dispatch= ed, > > > even when there may be _WRITEs that haven't been finished encrypting = and > > > sent down to the disk to get _FLUSHed... > > >=20 > > > Any comments about this? > >=20 > > Hmm, BIO_ORDERED was introduced pretty recently and GEOM classes were > > not updated to honour it, but it also seems to be to complex to handle > > in GEOM classes. I wonder if we could hold off new writes and wait for > > the in-progress writes in GEOM if we spot BIO_ORDERED request without > > the need to implement this logic in GEOM classes. >=20 > Yeh. When I was looking at it, it definately seems like it should be > something that we provide a generic method of handling (as part of > bioq_*), since all the geom classes need to handle it... No, in most cases this is not a problem, because most of GEOM classes just pass all I/O requests without any reordering, so it is enough if the very last layer (eg. disk driver) handles BIO_ORDERED properly. I thought what you meant with GELI was that it can reorder writes, for which it needs more time with BIO_FLUSH requests that it handles immediately. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --S6vg04ofUPzW4qJg Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlBer3oACgkQForvXbEpPzTCvgCgjF+b+eI1KhJpnn0SbHH1gcf9 x7gAn2kiLWpY09P1j+AwHleTxG5j2iy4 =74PA -----END PGP SIGNATURE----- --S6vg04ofUPzW4qJg--