Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Feb 2022 00:58:19 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        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:  <CANCZdfqBQOvzMCrJxWq9GzqCKyK_AubBE1CxAW5FULnE7D_jrg@mail.gmail.com>
In-Reply-To: <Yfo3i9Yy/uCUpss1@server.rulingia.com>
References:  <YfTCs7j3TPZFcFCD@server.rulingia.com> <YfTEj1KLhQhoR3xP@kib.kiev.ua> <CANCZdfoqQ3Ze%2BcMTsk_ho9x8hsSM9=fTavSao%2BUtwc2nSAEJpQ@mail.gmail.com> <Yfo3i9Yy/uCUpss1@server.rulingia.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--00000000000027c10305d704624f
Content-Type: text/plain; charset="UTF-8"

On Wed, Feb 2, 2022, 12:49 AM Peter Jeremy <peterj@freebsd.org> wrote:

> Thanks all for the very prompt responses.
>
> On 2022-Jan-28 22:32:02 -0700, Warner Losh <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...

Warner

-- 
> Peter Jeremy
>

--00000000000027c10305d704624f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Wed, Feb 2, 2022, 12:49 AM Peter Jeremy &lt;<a href=
=3D"mailto:peterj@freebsd.org">peterj@freebsd.org</a>&gt; wrote:<br></div><=
blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px=
 #ccc solid;padding-left:1ex">Thanks all for the very prompt responses.<br>
<br>
On 2022-Jan-28 22:32:02 -0700, Warner Losh &lt;<a href=3D"mailto:imp@bsdimp=
.com" target=3D"_blank" rel=3D"noreferrer">imp@bsdimp.com</a>&gt; wrote:<br=
>
&gt;I think that ufs relies on two ordering primitives, both marked with<br=
>
&gt;BIO_ORDERED today.<br>
&gt;That&#39;s what most of the drivers key off of. We always set BIO_ORDER=
ED on<br>
&gt;all the BIO_FLUSH<br>
&gt;events as far as I Can tell.<br>
<br>
Thanks for that warning.=C2=A0 I don&#39;t think geom_gate understands eith=
er<br>
B_BARRIER or BIO_ORDERED.=C2=A0 I shall have a closer look.<br></blockquote=
></div></div><div dir=3D"auto"><br></div><div dir=3D"auto">It needs to unde=
rstand BIO_ORDERED.</div><div dir=3D"auto"><br></div><div dir=3D"auto"><br>=
</div><div dir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex">
&gt;to it. b*barrierwrite() sets this, and that&#39;s used in the ffs_alloc=
 code.<br>
<br>
In my case, I&#39;m interested in ZFS, rather than UFS and it doesn&#39;t s=
eem<br>
to set B_BARRIER or BIO_ORDERED or indirectly.<br></blockquote></div></div>=
<div dir=3D"auto"><br></div><div dir=3D"auto">I went hunting ZFS for this y=
ear&#39;s ago and in the pre OpenZFS code they were used, but there were th=
ree layers of indirection that obscured it. ZFS doesn&#39;t use the buffer =
cache, so B_BARRIER isn&#39;t relevant. I&#39;ll see if I can find it with =
the new code.</div><div dir=3D"auto"><br></div><div dir=3D"auto">But if it =
never sets BIO_ORDERED, drivers are already reordering things. That&#39;s a=
ll any other driver in the tree worries about...</div><div dir=3D"auto"><br=
></div><div dir=3D"auto">Warner=C2=A0</div><div dir=3D"auto"><br></div><div=
 dir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-- <br>
Peter Jeremy<br>
</blockquote></div></div></div>

--00000000000027c10305d704624f--



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