Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Feb 2022 11:05:17 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Warner Losh <imp@bsdimp.com>, Peter Jeremy <peterj@freebsd.org>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, FreeBSD FS <freebsd-fs@freebsd.org>, "freebsd-geom@FreeBSD.org" <freebsd-geom@freebsd.org>
Subject:   Re: bio re-ordering
Message-ID:  <b75872f4-521b-5eab-68d0-4b1c04a10add@FreeBSD.org>
In-Reply-To: <CANCZdfqBQOvzMCrJxWq9GzqCKyK_AubBE1CxAW5FULnE7D_jrg@mail.gmail.com>
References:  <YfTCs7j3TPZFcFCD@server.rulingia.com> <YfTEj1KLhQhoR3xP@kib.kiev.ua> <CANCZdfoqQ3Ze%2BcMTsk_ho9x8hsSM9=fTavSao%2BUtwc2nSAEJpQ@mail.gmail.com> <Yfo3i9Yy/uCUpss1@server.rulingia.com> <CANCZdfqBQOvzMCrJxWq9GzqCKyK_AubBE1CxAW5FULnE7D_jrg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 02/02/2022 09:58, Warner Losh wrote:
> 
> 
> On Wed, Feb 2, 2022, 12:49 AM Peter Jeremy <peterj@freebsd.org 
> <mailto:peterj@freebsd.org>> wrote:
> 
>     Thanks all for the very prompt responses.
> 
>     On 2022-Jan-28 22:32:02 -0700, Warner Losh <imp@bsdimp.com
>     <mailto:imp@bsdimp.com>> wrote:
>      >I think that ufs relies on two ordering primitives, both marked with
>      >BIO_ORDERED today.
>      >That's what most of the drivers key off of. We always set BIO_ORDERED on
>      >all the BIO_FLUSH
>      >events as far as I Can tell.
> 
>     Thanks for that warning.  I don't think geom_gate understands either
>     B_BARRIER or BIO_ORDERED.  I shall have a closer look.
> 
> 
> It needs to understand BIO_ORDERED.
> 
> 
>      >to it. b*barrierwrite() sets this, and that's used in the ffs_alloc code.
> 
>     In my case, I'm interested in ZFS, rather than UFS and it doesn't seem
>     to set B_BARRIER or BIO_ORDERED or indirectly.
> 
> 
> I went hunting ZFS for this year's ago and in the pre OpenZFS code they were 
> used, but there were three layers of indirection that obscured it. ZFS doesn't 
> use the buffer cache, so B_BARRIER isn't relevant. I'll see if I can find it 
> with the new code.
> 
> But if it never sets BIO_ORDERED, drivers are already reordering things. That's 
> all any other driver in the tree worries about...

Hmm... it looks like both the old and new (Open)ZFS use BIO_FLUSH command 
without BIO_ORDERED flag.  Not sure if it happens to do the right thing anyway 
or not.


-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b75872f4-521b-5eab-68d0-4b1c04a10add>