From nobody Sat Jul 13 08:44:40 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WLhq92DJRz5QHqT for ; Sat, 13 Jul 2024 08:44:53 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WLhq86Qjdz58pv; Sat, 13 Jul 2024 08:44:52 +0000 (UTC) (envelope-from theraven@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720860292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=b1g+PFlgr4LjAr+9FL5Oy9v9MznSqWzhKsj1LyxBSWA=; b=ni1KRw+BC5wWnhmUrHr3vBRQKB/LvKr05X53EWRcbx+HASrdRmNx+35BUj5vgadEVAwOk1 h6wY0TNnSVYoVDW4rsZYq6Wb9XRqbge2Y4XoeLb3NsxjOh7CxHHJEufnSz34JF55U49VM6 is1pruDrV8BTX1wLhZ7KLreJq0da07agIDUZ/NH6OUgo/GNhrSCg7xUZO5v/7l6IOVWfo0 oKxooi2O5uI/JVnkZqEsYghd+cVLCWjsJQZUh+t5LCw7URjK8FI+2tmnR1sBRMTWTi9/BJ XJaEgj0JeM42A41PzjeY3p+4+OAgfSniKln2Tg0Msc2SF3sIWU4KyscLpQkYSw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720860292; a=rsa-sha256; cv=none; b=e9k49zdJebf7kjDcqL+KhjPEUSM6DPaerEHusZTsB+Tx2pL7WcmXFFoqL04EyUQi4n9j0U I0/VQXXn4WorEScs/Uwmjm+Ek94H6ZThTzCrj2FYUfCcwWXyC8hOifx+5WcKjv6X1fCE0y veIz4UhrRkcsxRQ4bo0TS6TZvUUrEAfKd+7mbHeqAjL12C+B1gGlu7/FbwJqEIQ3IZqQAC AICyoTl+oJs/iPnjfcrswgk22Yx42/qklBm1GNRv1Ma2p5ahqROZaq6Dv2nS2hIMaifvCm lYCQdvSsUgRTOzU8mkn9zWzNXL6d6jd97vIPz/R8l6Omycncm6COD5aWpLJy0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720860292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=b1g+PFlgr4LjAr+9FL5Oy9v9MznSqWzhKsj1LyxBSWA=; b=tdUNRKtQQNlxJEXSgvziyfFJvIxD9TmecO+tX9IIFxkaroDlYr6z+NhtDZWUjO/LY+9smp heutuneD3fDzn7ZDZjw0nFJD7nmk/WR1mrGxV6eVAsVX9M2gT0MAa681rnar/zF5Mm8mdv H2hQgT5+zoGLVSSMQ1mSWP3pNDaE3H5FL9oZc6tfG6viHOcZmLbja1S5WkJwxPjMD/qXnP 13BB6e2f33fZHditmYWzIFNIfvH0sz5ok2W55taIw/2Tw3tX3Jvw7l5EF7XAQ5LK+qEEFx mD+U3wXBi8CxwZaxrhfwZS88JAvzsYu5wcLDRYmonh+npLDW36ctenZ+Ewd17Q== Received: from smtp.theravensnest.org (smtp.theravensnest.org [45.77.103.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: theraven) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WLhq84t3cz1D7J; Sat, 13 Jul 2024 08:44:52 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from smtpclient.apple (host86-138-165-11.range86-138.btcentralplus.com [86.138.165.11]) by smtp.theravensnest.org (Postfix) with ESMTPSA id BF4204407; Sat, 13 Jul 2024 09:44:51 +0100 (BST) From: David Chisnall Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_D84635F6-0B4C-4CED-8C92-2CAB98AB5C2B" List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: Is anyone working on VirtFS (FUSE over VirtIO) Date: Sat, 13 Jul 2024 09:44:40 +0100 In-Reply-To: Cc: Alan Somers , FreeBSD Hackers To: Warner Losh References: X-Mailer: Apple Mail (2.3774.600.62) --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 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 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 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. =  

David

= --Apple-Mail=_D84635F6-0B4C-4CED-8C92-2CAB98AB5C2B--