Date: Sat, 13 Jul 2024 16:06:10 -0600 From: Warner Losh <imp@bsdimp.com> To: David Chisnall <theraven@freebsd.org> Cc: Alan Somers <asomers@freebsd.org>, FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: Is anyone working on VirtFS (FUSE over VirtIO) Message-ID: <CANCZdfp0h%2BXhGoTk43e3ycZSg2Qh-6Fih9y5zfssGjRpoJaS-A@mail.gmail.com> In-Reply-To: <E46B9396-7679-4C03-B144-BF4F9431F649@FreeBSD.org> References: <CAOtMX2gmc6L4H8L9107D84xofmd-idDgtVg8nkFkXPaPX1E8wg@mail.gmail.com> <A14C40DA-15EE-4777-B47F-2B342CE787EA@freebsd.org> <CANCZdfr7kKxTgBJ_LSKxAGsMUN9%2B=fiw1Fwy7Oxrc4G2mdSdYQ@mail.gmail.com> <E46B9396-7679-4C03-B144-BF4F9431F649@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000c75fa9061d283433 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hey David, You might want to check out https://reviews.freebsd.org/D45370 which has the testing framework as well as hints at other work that's been done for virtiofs by Emil Tsalapatis. It looks quite interesting. Anything he's done that's at odds with what I've said just shows where my analysis was flawed :) This looks quite promising, but I've not had the time to look at it in detail yet. Warner On Sat, Jul 13, 2024 at 2:44=E2=80=AFAM David Chisnall <theraven@freebsd.or= g> wrote: > On 31 Dec 2023, at 16:19, Warner Losh <imp@bsdimp.com> wrote: > > > Yea. The FUSE protocol is going to be the challenge here. For this to be > useful, the VirtioFS support on the FreeBSD needs to be 100% in the > kernel, since you can't have userland in the loop. This isn't so terrible= , > though, since our VFS interface provides a natural breaking point for > converting the requests into FUSE requests. The trouble, I fear, is a > mismatch between FreeBSD's VFS abstraction layer and Linux's will cause > issues (many years ago, the weakness of FreeBSD VFS caused problems for a > company doing caching, though things have no doubt improved from those > days). Second, there's a KVM tie-in for the direct mapped pages between t= he > VM and the hypervisor. I'm not sure how that works on the client (FreeBSD= ) > side (though the description also says it's mapped via a PCI bar, so mayb= e > the VM OS doesn't care). > > > From what I can tell from a little bit of looking at the code, our FUSE > implementation has a fairly cleanly abstracted layer (in fuse_ipc.c) for > handling the message queue. For VirtioFS, it would 'just' be necessary t= o > factor out the bits here that do uio into something that talked to a Virt= IO > ring. I don=E2=80=99t know what the VFS limitations are, but since the p= rotocol > for VirtioFS is the kernel <-> userspace protocol for FUSE, it seems that > any functionality that works with FUSE filesystems in userspace would wor= k > with VirtioFS filesystems. > > The shared buffer cache bits are nice, but are optional, so could be done > in a later version once the basic functionality worked. > > David > > --000000000000c75fa9061d283433 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hey David,</div><div><br></div><div>You might want to= check out=C2=A0 <a href=3D"https://reviews.freebsd.org/D45370">https://rev= iews.freebsd.org/D45370</a> which has the testing framework as well as hint= s at other work that's been done for virtiofs=C2=A0by Emil=C2=A0Tsalapa= tis. It looks quite interesting. Anything he's done that's at odds = with what I've said just shows where my analysis was flawed :) This loo= ks quite promising, but I've not had the time to look at it in detail y= et.</div><div><br></div><div>Warner</div></div><br><div class=3D"gmail_quot= e"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Jul 13, 2024 at 2:44=E2=80= =AFAM David Chisnall <<a href=3D"mailto:theraven@freebsd.org">theraven@f= reebsd.org</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style= =3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding= -left:1ex"><div>On 31 Dec 2023, at 16:19, Warner Losh <<a href=3D"mailto= :imp@bsdimp.com" target=3D"_blank">imp@bsdimp.com</a>> wrote:<br><div><b= lockquote type=3D"cite"><br><div><div style=3D"font-family:Helvetica;font-s= ize:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-= spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-s= pace:normal;word-spacing:0px;text-decoration:none">Yea. The FUSE protocol i= s going to be the challenge here. For this to be useful, the VirtioFS=C2=A0= support on=C2=A0the FreeBSD=C2=A0 needs to be 100% in the kernel, since you= can't have userland in the loop. This isn't so terrible, though, s= ince our VFS interface provides a natural breaking point for converting the= requests into FUSE requests. The trouble, I fear, is a mismatch between Fr= eeBSD's VFS abstraction layer and Linux's will cause issues (many y= ears ago, the weakness of FreeBSD VFS caused problems for a company doing c= aching, though things have no doubt improved from those days). Second, ther= e's a KVM tie-in for the direct mapped pages between the VM and the hyp= ervisor. I'm not sure how that works on the client (FreeBSD) side (thou= gh the description also says it's mapped via a PCI bar, so maybe the VM= OS doesn't care).</div></div></blockquote><br></div><div>From what I c= an tell from a little bit of looking at the code, our FUSE implementation h= as a fairly cleanly abstracted layer (in fuse_ipc.c) for handling the messa= ge queue.=C2=A0 For VirtioFS, it would 'just' be necessary to facto= r out the bits here that do uio into something that talked to a VirtIO ring= .=C2=A0 I don=E2=80=99t know what the VFS limitations are, but since the pr= otocol for VirtioFS is the kernel <-> userspace protocol for FUSE, it= seems that any functionality that works with FUSE filesystems in userspace= would work with VirtioFS filesystems.</div><div><br></div><div>The shared = buffer cache bits are nice, but are optional, so could be done in a later v= ersion once the basic functionality worked. =C2=A0</div><div><br></div><div= >David</div><div><br></div></div></blockquote></div> --000000000000c75fa9061d283433--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfp0h%2BXhGoTk43e3ycZSg2Qh-6Fih9y5zfssGjRpoJaS-A>