Date: Fri, 10 Jan 2025 09:17:19 -0700 From: Warner Losh <imp@bsdimp.com> To: Rick Macklem <rick.macklem@gmail.com> Cc: Dan Shelton <dan.f.shelton@gmail.com>, freebsd-hackers@freebsd.org Subject: Re: WRITE_SAME support in FreeBSD nfsd NFSv4.1 mode? Message-ID: <CANCZdfpxucn_gcWSWvVaS2RGztuCWew-dZ0jc3Hz-VQ5T1sD3g@mail.gmail.com> In-Reply-To: <CAM5tNy449p7o00ANcRFm_oDGqwRwtkiMXv8ZuQaJuOrGBqGwVQ@mail.gmail.com> References: <CAAvCNcD1CziGxmgyzyWix5ADsDXRpkbFUM32H9nEji9kR%2BVc-Q@mail.gmail.com> <CAM5tNy7NATNcoaQsm=ZZ-sGJc8wK=yJE5Cz-7nv4cOXxH2Z%2BhA@mail.gmail.com> <CAAvCNcB_PhT2phz6qM-=5C19MtPW7QppxaRL6B1mK7LFH4xWfQ@mail.gmail.com> <CAM5tNy449p7o00ANcRFm_oDGqwRwtkiMXv8ZuQaJuOrGBqGwVQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000008017d4062b5c6e56 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 10, 2025 at 7:58=E2=80=AFAM Rick Macklem <rick.macklem@gmail.co= m> wrote: > On Thu, Jan 9, 2025 at 8:14=E2=80=AFPM Dan Shelton <dan.f.shelton@gmail.c= om> > wrote: > > > > On Fri, 10 Jan 2025 at 02:59, Rick Macklem <rick.macklem@gmail.com> > wrote: > > > > > > On Thu, Jan 9, 2025 at 4:31=E2=80=AFPM Dan Shelton <dan.f.shelton@gma= il.com> > wrote: > > > > > > > > Hello! > > > > > > > > Does FreeBSD nfsd support the WRITE_SAME request in NFSv4.1 mode? > > > Not at this time, I'm afraid. > > > > > > Maybe in a future release, rick > > > > How fast could it be implemented? > For the simplest version, not too long. > The simplest version would be synchronous only and use > VOP_WRITE() calls. Doing a new VOP_xxx() call to try and optimize > it per-fs would take quite a bit longer. (I know very little about ZFS, > but just > maybe, block cloning would be useful for this?) > I had discussions years ago about adding a BIO_WRITE_SAME and whether or not it made sense. It's mildly helpful to just send one write command that writes all the LBAs using the SCSI WRITE SAME command. But it got hairy in a hurry and WRITE SAME is mostly only used to unmap / trim blocks anyway. But only SCSI drives support this, and it's been too long to recall if they all support writing multiple blocks from the same OUT BUFFER or not. NVME doesn't have a similar concept (just write zeros), so I gave up on it. I didn't have a good use case for it. Warner > Btw, it is a NFSv4.2 call, so it would only be supported for NFSv4.2 and > not > NFSv4.1. > > rick > > > > > Dan > > -- > > Dan Shelton - Cluster Specialist Win/Lin/Bsd > > > > --0000000000008017d4062b5c6e56 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g= mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jan 10,= 2025 at 7:58=E2=80=AFAM Rick Macklem <<a href=3D"mailto:rick.macklem@gm= ail.com">rick.macklem@gmail.com</a>> wrote:<br></div><blockquote class= =3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg= b(204,204,204);padding-left:1ex">On Thu, Jan 9, 2025 at 8:14=E2=80=AFPM Dan= Shelton <<a href=3D"mailto:dan.f.shelton@gmail.com" target=3D"_blank">d= an.f.shelton@gmail.com</a>> wrote:<br> ><br> > On Fri, 10 Jan 2025 at 02:59, Rick Macklem <<a href=3D"mailto:rick.= macklem@gmail.com" target=3D"_blank">rick.macklem@gmail.com</a>> wrote:<= br> > ><br> > > On Thu, Jan 9, 2025 at 4:31=E2=80=AFPM Dan Shelton <<a href=3D= "mailto:dan.f.shelton@gmail.com" target=3D"_blank">dan.f.shelton@gmail.com<= /a>> wrote:<br> > > ><br> > > > Hello!<br> > > ><br> > > > Does FreeBSD nfsd support the WRITE_SAME request in NFSv4.1 = mode?<br> > > Not at this time, I'm afraid.<br> > ><br> > > Maybe in a future release, rick<br> ><br> > How fast could it be implemented?<br> For the simplest version, not too long.<br> The simplest version would be synchronous only and use<br> VOP_WRITE() calls. Doing a new VOP_xxx() call to try and optimize<br> it per-fs would take quite a bit longer. (I know very little about ZFS, but= just<br> maybe, block cloning would be useful for this?)<br></blockquote><div><br></= div><div>I had discussions=C2=A0years ago about adding a BIO_WRITE_SAME and= whether or not it made sense.</div><div>It's mildly helpful to just se= nd one write command that writes all the LBAs using the SCSI WRITE SAME</di= v><div>command. But it got hairy in a hurry and WRITE SAME is mostly only u= sed to unmap / trim blocks</div><div>anyway.</div><div><br></div><div>But o= nly SCSI drives support this, and it's been too long to recall if they = all support writing multiple</div><div>blocks from the same OUT BUFFER or n= ot. NVME doesn't have a similar concept (just write zeros),</div><div>s= o I gave up on it. I didn't have a good use case for it.</div><div><br>= </div><div>Warner</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" s= tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad= ding-left:1ex"> Btw, it is a NFSv4.2 call, so it would only be supported for NFSv4.2 and no= t<br> NFSv4.1.<br> <br> rick<br> <br> ><br> > Dan<br> > --<br> > Dan Shelton - Cluster Specialist Win/Lin/Bsd<br> ><br> <br> </blockquote></div></div> --0000000000008017d4062b5c6e56--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpxucn_gcWSWvVaS2RGztuCWew-dZ0jc3Hz-VQ5T1sD3g>