Date: Wed, 2 Feb 2022 11:49:44 +0200 From: Andriy Gapon <avg@freebsd.org> To: Warner Losh <imp@bsdimp.com> Cc: Peter Jeremy <peterj@freebsd.org>, 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: <9848cde6-5c12-cdd4-e722-42fe26fa0349@FreeBSD.org> In-Reply-To: <CANCZdfp=0rbBkr4SoXhvn7hrQniPQzTeZra2HGBwXDGsJjN8XQ@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> <b75872f4-521b-5eab-68d0-4b1c04a10add@FreeBSD.org> <CANCZdfp=0rbBkr4SoXhvn7hrQniPQzTeZra2HGBwXDGsJjN8XQ@mail.gmail.com>
index | next in thread | previous in thread | raw e-mail
On 02/02/2022 11:14, Warner Losh wrote: > On Wed, Feb 2, 2022 at 2:05 AM Andriy Gapon <avg@freebsd.org > <mailto:avg@freebsd.org>> wrote: > 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. > > > It's an unordered flush then. The flush will happen whenever. I have a vague > memory that ZFS will only issue this command in cases where there's no other I/O > pending. I think that there is still a potential problem that an earlier write request might get re-ordered after the flush. I think that we should add BIO_ORDERED for correctness. > It will be the only way for it to be reliable with nvme, since the > BIO_FLUSH > command isn't ordered w/o BIO_ORDERED flag. So ggate needn't do anything > special for BIO_FLUSH, just BIO_ORDERED. Otherwise, it's free to reorder as it > sees fit. > > The CAM I/O scheduler takes a little bit of liberty here, btw. It interprets > BIO_ORDERED > as being only wrt BIO_WRITE and BIO_FLUSH because if you schedule both a read > and write, the results are undefined. nvd takes a stricter approach and honors > the ordering > more strictly. > > Warner > -- Andriy Gaponhelp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9848cde6-5c12-cdd4-e722-42fe26fa0349>
