From nobody Wed Feb 11 02:38:34 2026 X-Original-To: freebsd-virtualization@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 4f9jL040zVz6Rcw2 for ; Wed, 11 Feb 2026 02:38:48 +0000 (UTC) (envelope-from emil@etsalapatis.com) Received: from mail-yx1-xb132.google.com (mail-yx1-xb132.google.com [IPv6:2607:f8b0:4864:20::b132]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f9jL02479z42Nt for ; Wed, 11 Feb 2026 02:38:48 +0000 (UTC) (envelope-from emil@etsalapatis.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yx1-xb132.google.com with SMTP id 956f58d0204a3-649e456e8a2so1454871d50.0 for ; Tue, 10 Feb 2026 18:38:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1770777526; cv=none; d=google.com; s=arc-20240605; b=E6DM60VO7XUckihoKwikA6wRHsvLSBKadBsaVkjcWaC+XJyIzlr5R7TlNLRkeqtTka Bsaq+82qyWF/ULjqk0hLIaM8ZnAtYfe/7t7maqfESNddPQPjEKQqw+vuRp3p2lO0RVNu vSV0eByJUXvrgYDwCUvYs0fliRZG2+TRhgl9B4fUtjsA/9BWSszsaVZVoRArSZ2xNkSh xZwR7HaBuk5HDx2/BOwTU+act0KRoOHSeJxXh2mxHLefRXy07AeUL5SQ0cpxeraoUz/1 lwSyVtdU+I3S0yf5AX6UWyPu/LtCuwqOiXx9hmvXFPCD5aueJKRC1mgdyfN1GjxkkXL1 DFoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=iXo1BAOcn8ytUQMKAdD2191+g2t0aXUk9aoDugnw3Zo=; fh=cEo1R40b3YR1i7OsuXnHKva73lchnWtBrRLxOYhwDi0=; b=iRsKzp3Rf3p7hruRjhbTxPG4V2cMyzv9Mu1Onf7+NWBrL5O7LPi6OSby71x5xS2ZIc r7q4aqhZG9uxitikvYmegrL8S6d+asa0oeb4yVLhcuce+y/KsrJTpjfpuLodbpF9bcs2 sySBI+ij8oJHKuBC2YvTxh6g1vCVyHGTiYjtmvo++HRPgFENTfq88g3E3oBMlL2F4dzw UgujwMTU2MfEujAFA/CQ0n/53JxAnitEiJDozEffTJ7kVGYqEuRMbHd7GHXyP8QIzuq6 S2bdJ8P3wjoWBUsQ9rIk0bb+PyLl8eMh7Lh8vn5ViJrqIAJyZOluuQQnfVZCwv4n3Fd7 fcWA==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=etsalapatis-com.20230601.gappssmtp.com; s=20230601; t=1770777526; x=1771382326; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=iXo1BAOcn8ytUQMKAdD2191+g2t0aXUk9aoDugnw3Zo=; b=X4bKlvOulplIbld4FB0sDQpVeWQ40I5PIl/7tLwo1hmb2e4faRGWp2dTGP37ddyeKA H8GwLlj1Piy3GpHapIT3Id/g7DubvWC3r0sEFSxaH/iRCCfY/XG7iXg2aKMigChIURiV ciElRWx879bl2kWtdf37dxv4pBAULA2gEDBwZfkz3C+DaUNFLDKpy1Noc5PMXD1deH9H 0YzvYbhDv2I7YWUMYOutNWSYY2wnKF5H1zEdzqRErJRmrLAIEDo+efwSJ25Cny0LrAp5 jDZNO6l6mQVF8wmcXAXv1Olb9M+JpG53SeJvCg3yCrVtFObJsQ19nE3ezeqmEE4HXxco jLOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770777526; x=1771382326; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=iXo1BAOcn8ytUQMKAdD2191+g2t0aXUk9aoDugnw3Zo=; b=sKeibPIh2vsalRia2uPGmFV6QrQTS45s8iuqdNYreF2Q3WHIWTkawhuUqJnwqh7NZH 3wj2bTN7ydfa6b4yXXz19/JJZq1Va9sw8pj41IyZFJItw57yNmVb5HOPSN1WF56mkebZ mYD8YOfLsXD6893jpQ60KpgCzOJI7jla1hN8yNeBYyKOZESU8phUzyqmGmK6MjHiJycJ mSGpFoeLILMrDxySS1AswLnNh9qbqpvOqZrkG3N0xTKRprXEEK+F4nIpCRZC598BnFkM Vs8P1jFlbsdAbQxKjQefixF26bHwzXuCVwzN/5IXnb+4c8BvKmRXxrBr4efnCKqxwKg2 RQgg== X-Forwarded-Encrypted: i=1; AJvYcCULa4jaHfZ8LrveObJJSNuet/Px7Gjke3Dxt7s9Bqd3nsX/us6oZZXrT+6mcd65R/8cSUa4oLMx0D24j3RQEmw6Fyp1nwoS@freebsd.org X-Gm-Message-State: AOJu0YwKGaIf+LucQ9tqBBnHKPO1zIgbDD7HvDAceVMl2ky5NbWzUmO3 fkonC/hJm8NpS79mhoBZQE/TvFd51MOwcgy85W17alEIHdovJHINF4zbvfG0vAMRngERD423U2p L5p7WdxbJWw2QNqF8/17LiXSoDAleJJfdsJrP8USy9tT2XyBej2YRUi2dow== X-Gm-Gg: AZuq6aKxlev1+x6TBI1/SjFfhohkJGKFK40k9HywhOYNb/JGGmArLmbM/CV069IlnzX NycugPXf8VMd89EEngMYY2Glvem2p5r8P8o0CwFVvw3AVjq782DXSbZwxp2JPAmEdazJjK6rlfZ SSlOeQQefKlz9sc33ijfuYp0uBy3R+/P8y5VE7I9vh1JlAaH5MXu44mKDF2J+lPXDNd7Vv3i/tl 8xeckFpVZrzQbF5mAxjtoyHhH58JPzAEF3zG0gYeS6z3T5M4fMBao9qXCcEc6syGDwiZzdwcz0O oqn/XIW4bw== X-Received: by 2002:a05:690c:e3c7:b0:796:4235:ea0d with SMTP id 00721157ae682-7964235ebd4mr184712477b3.37.1770777525559; Tue, 10 Feb 2026 18:38:45 -0800 (PST) List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org MIME-Version: 1.0 References: <9c3f1865-d47f-4fcf-a34b-866ee727a25b@nomadlogic.org> In-Reply-To: <9c3f1865-d47f-4fcf-a34b-866ee727a25b@nomadlogic.org> From: Emil Tsalapatis Date: Tue, 10 Feb 2026 21:38:34 -0500 X-Gm-Features: AZwV_QhBmV-oP-VtJaDEILJ5Ee2AY_kZoHxo6T48m1FzVbJE1MDTw-0kLffbEYE Message-ID: Subject: Re: RFC: Kernel virtiofs driver To: Pete Wright Cc: Mario Marietto , FreeBSD virtualization Content-Type: multipart/alternative; boundary="0000000000006332ec064a8345df" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4f9jL02479z42Nt X-Spamd-Bar: ---- --0000000000006332ec064a8345df Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Mario, Eva, Pete, Thank you for the feedback. To address some points: 1) virtiofs is significantly faster. AFAICT the p9fs FreeBSD driver has no guest-side caching caching - at least I've found no such option when mounting. To test the speed I measure from the host the time it takes to clone and build a simple repo: cd /mnt git clone https://github.com/redis/redis.git cd redis gmake -j32 cd /mnt rm -rf redis virtiofs takes 42 seconds, p9fs takes 7 minutes and 30 seconds. This is without turning on full writeback caching for virtiofs. I'm not familiar with p9fs' internals so if I've missed some caching-related option please let me know, but on the face of it virtiofs is worth it just for the speed increase. The current numbers do not even include the optimization in the FAQ ( https://virtio-fs.gitlab.io/) that Pete mentioned above. That is later work for after the initial driver gets merged. 2) Like Eva said, it's just a matter of feature parity. It's not always the case that both virtiofs and p9fs are available, and a user may prefer one over the other for whatever reason. The only counter argument I can think of is maintainance burden, but virtiofs is pretty maintainable: It's 1/5 the size of p9fs with a simple cloc (795 SLOC vs 4192 SLOC) because it reuses much of the existing FUSE logic. The existing testbench for FUSE largely also covers virtiofs. On Tue, Feb 10, 2026 at 12:45=E2=80=AFPM Pete Wright = wrote: > > > On 2/9/26 10:57 PM, Mario Marietto wrote: > > |Hello Emil,| > > > > |Inside a FreeBSD guest OS (15.0-RELEASE) I do :| > > > > kldload virtio_p9fs > > > > kldload p9fs_load > > > > |mount -t p9fs sharename /mnt/host| > > > > || > > > > |This works for me,I can share files between FreeBSD 15.0 guest and > > FreeBSD 14.3 host os. So,what's missing in this case and which features > > you added ?| > > > > > i had a similar question since i've been happy with p9fs. the virtiofs > faq states (https://virtio-fs.gitlab.io/): > > "Existing solutions to this problem, such as virtio-9p, are based on > existing network protocols that are not optimized for virtualization use > cases. As a result they do not perform as well as local file systems and > do not provide the semantics that some applications rely on. > > Virtiofs takes advantage of the virtual machine=E2=80=99s co-location wit= h the > hypervisor to avoid overheads associated with network file systems." > > > that seems super reasonable to me. i also think there is windows > support for virtiofs which is probably another benefit. > > -pete > > -- > Pete Wright > pete@nomadlogic.org > > --0000000000006332ec064a8345df Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Mario, Eva, Pete,

=C2=A0= =C2=A0=C2=A0 Thank you for the feedback. To address some points:
=
1) virtiofs is significantly faster. AFAICT the p9fs FreeBSD= driver has no guest-side caching caching - at least I've found no such= option when mounting. To test the speed I measure from the host the time i= t takes to clone and build a simple repo:

cd /mnt<= br>git clone https://github.= com/redis/redis.git
cd redis
gmake -j32
cd /mnt
rm -rf redis

virtiofs takes 42 seconds, p9f= s takes 7 minutes and 30 seconds. This is without turning on full writeback= caching for virtiofs. I'm not familiar with p9fs' internals so if = I've missed some caching-related option please let me know, but on the = face of it virtiofs is worth it just for the speed increase.

=
The current numbers do not even include the optimization in the = FAQ (https://virtio-fs.gitlab.io/) that Pete mentioned above. That i= s later work for after the initial driver gets merged.

2) Like Eva said, it's just a matter of feature parity. It'= ;s not always the case that both virtiofs and p9fs are available, and a use= r may prefer one over the other for whatever reason. The only counter argum= ent I can think of is maintainance burden, but virtiofs is pretty maintaina= ble: It's 1/5 the size of p9fs with a simple cloc (795 SLOC vs 4192 SLO= C) because it reuses much of the existing FUSE logic. The existing testbenc= h for FUSE largely also covers virtiofs.


On Tue, Feb 10, 2026 at 1= 2:45=E2=80=AFPM Pete Wright <pete@nomadlogic.org> wrote:


On 2/9/26 10:57 PM, Mario Marietto wrote:
> |Hello Emil,|
>
> |Inside a FreeBSD guest OS (15.0-RELEASE) I do :|
>
> kldload virtio_p9fs
>
> kldload p9fs_load
>
> |mount -t p9fs sharename /mnt/host|
>
> ||
>
> |This works for me,I can share files between FreeBSD 15.0 guest and > FreeBSD 14.3 host os. So,what's missing in this case and which fea= tures
> you added ?|
>


i had a similar question since i've been happy with p9fs.=C2=A0 the vir= tiofs
faq states (https://virtio-fs.gitlab.io/):

"Existing solutions to this problem, such as virtio-9p, are based on <= br> existing network protocols that are not optimized for virtualization use cases. As a result they do not perform as well as local file systems and do not provide the semantics that some applications rely on.

Virtiofs takes advantage of the virtual machine=E2=80=99s co-location with = the
hypervisor to avoid overheads associated with network file systems."

that seems super reasonable to me.=C2=A0 i also think there is windows
support for virtiofs which is probably another benefit.

-pete

--
Pete Wright
pete@nomadlogic.or= g

--0000000000006332ec064a8345df--