Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jul 2024 08:47:33 +0100
From:      David Chisnall <theraven@freebsd.org>
To:        Emil Tsalapatis <freebsd-lists@etsalapatis.com>
Cc:        Warner Losh <imp@bsdimp.com>, Alan Somers <asomers@freebsd.org>, FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Is anyone working on VirtFS (FUSE over VirtIO)
Message-ID:  <75944503-8599-43CF-84C5-0C10CA325761@freebsd.org>
In-Reply-To: <CABFh=a4t=73NLyJFqBOs1pRuo8B_d8wOH_mavnD-Da9dU-3k8Q@mail.gmail.com>
References:  <CABFh=a4t=73NLyJFqBOs1pRuo8B_d8wOH_mavnD-Da9dU-3k8Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr"><div dir="ltr">Hi,</div><div dir="ltr"><br></div><div dir="ltr">This looks great! Are there infrastructure problems with supporting the DAX or is it ‘just work’? I had hoped that the extensions to the buffer cache that allow ARC to own pages that are delegated to the buffer cache would be sufficient.</div><div dir="ltr"><br></div><div dir="ltr">If I understand the protocol correctly, the DAX mode is the same as the direct mmap mode in FUSE (not sure if FreeBSD!’s kernel fuse bits support this?).</div><div dir="ltr"><br></div><div dir="ltr">David</div></div><div dir="ltr"><br><blockquote type="cite">On 14 Jul 2024, at 15:07, Emil Tsalapatis &lt;freebsd-lists@etsalapatis.com&gt; wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div>Hi David, Warner,</div><div><br></div><div>&nbsp;&nbsp;&nbsp; I'm glad you find this approach interesting! I've been meaning to update the virtio-dbg patch for a while but unfortunately haven't found the time in the last month since I uploaded it... I'll update it soon to address the reviews and split off the 
userspace device emulation code out of the patch to make reviewing 
easier (thanks Alan for the suggestion). If you have any questions or feedback please let me know.<br></div><div><br></div><div>WRT virtiofs itself, I've been working on it too but I haven't found the time to clean it up and upload it. I have a messy but working implementation <a href="https://github.com/etsal/freebsd-src/tree/virtiofs-head">here</a>. The changes to FUSE itself are indeed minimal because it is enough to redirect the messages into a virtiofs device instead of sending them to a local FUSE device. The virtiofs device and the FUSE device are both simple bidirectional queues. Not sure on how to deal with directly mapping files between host and guest just yet, because the Linux driver uses their DAX interface for that, but it should be possible.<br></div><div><br></div><div>Emil<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jul 14, 2024 at 3:11 AM David Chisnall &lt;<a href="mailto:theraven@freebsd.org">theraven@freebsd.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Wow, that looks incredibly useful.&nbsp; Not needing bhyve / qemu (nested, if your main development is a VM) to test virtio drivers would be a huge productivity win. &nbsp;<div><br></div><div>David<br id="m_2432313125591762966lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On 13 Jul 2024, at 23:06, Warner Losh &lt;<a href="mailto:imp@bsdimp.com" target="_blank">imp@bsdimp.com</a>&gt; wrote:</div><br><div><div dir="ltr"><div>Hey David,</div><div><br></div><div>You might want to check out&nbsp; <a href="https://reviews.freebsd.org/D45370" target="_blank">https://reviews.freebsd.org/D45370</a>; which has the testing framework as well as hints at other work that's been done for virtiofs&nbsp;by Emil&nbsp;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.</div><div><br></div><div>Warner</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jul 13, 2024 at 2:44 AM David Chisnall &lt;<a href="mailto:theraven@freebsd.org" target="_blank">theraven@freebsd.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="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 &lt;<a href="mailto:imp@bsdimp.com" target="_blank">imp@bsdimp.com</a>&gt; wrote:<br><div><blockquote type="cite"><br><div><div style="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;text-decoration:none">Yea. The FUSE protocol is going to be the challenge here. For this to be useful, the VirtioFS&nbsp;support on&nbsp;the FreeBSD&nbsp; 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>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.&nbsp; For VirtioFS, it would 'just' be necessary to factor out the bits here that do uio into something that talked to a VirtIO ring.&nbsp; I don’t know what the VFS limitations are, but since the protocol for VirtioFS is the kernel &lt;-&gt; 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. &nbsp;</div><div><br></div><div>David</div><div><br></div></div></blockquote></div>
</div></blockquote></div><br></div></div></blockquote></div>
</div></blockquote></body></html>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?75944503-8599-43CF-84C5-0C10CA325761>