Date: Sat, 13 Jul 2024 09:44:40 +0100 From: David Chisnall <theraven@FreeBSD.org> To: Warner Losh <imp@bsdimp.com> Cc: Alan Somers <asomers@freebsd.org>, FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: Is anyone working on VirtFS (FUSE over VirtIO) Message-ID: <E46B9396-7679-4C03-B144-BF4F9431F649@FreeBSD.org> In-Reply-To: <CANCZdfr7kKxTgBJ_LSKxAGsMUN9%2B=fiw1Fwy7Oxrc4G2mdSdYQ@mail.gmail.com> References: <CAOtMX2gmc6L4H8L9107D84xofmd-idDgtVg8nkFkXPaPX1E8wg@mail.gmail.com> <A14C40DA-15EE-4777-B47F-2B342CE787EA@freebsd.org> <CANCZdfr7kKxTgBJ_LSKxAGsMUN9%2B=fiw1Fwy7Oxrc4G2mdSdYQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_D84635F6-0B4C-4CED-8C92-2CAB98AB5C2B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 31 Dec 2023, at 16:19, Warner Losh <imp@bsdimp.com> wrote: >=20 > 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 the 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 maybe the VM OS doesn't care). =46rom 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 to factor out the bits here that do uio into = something that talked to a VirtIO ring. I don=E2=80=99t know what the = VFS limitations are, but since the protocol 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. The shared buffer cache bits are nice, but are optional, so could be = done in a later version once the basic functionality worked. =20 David --Apple-Mail=_D84635F6-0B4C-4CED-8C92-2CAB98AB5C2B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"content-type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;">On 31 Dec = 2023, at 16:19, Warner Losh <imp@bsdimp.com> = wrote:<br><div><blockquote type=3D"cite"><br = class=3D"Apple-interchange-newline"><div><meta charset=3D"UTF-8"><div = style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: = 12px; font-style: normal; font-variant-caps: normal; font-weight: 400; = letter-spacing: normal; text-align: start; text-indent: 0px; = text-transform: none; white-space: normal; word-spacing: 0px; = -webkit-text-stroke-width: 0px; text-decoration: none;">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 the 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 maybe the VM OS doesn't = care).</div></div></blockquote><br></div><div>=46rom 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 to factor out = the bits here that do uio into something that talked to a VirtIO ring. = I don=E2=80=99t know what the VFS limitations are, but since the = protocol 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 version once the = basic functionality worked. = </div><div><br></div><div>David</div><div><br></div></body></html>= --Apple-Mail=_D84635F6-0B4C-4CED-8C92-2CAB98AB5C2B--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E46B9396-7679-4C03-B144-BF4F9431F649>