Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jul 2020 10:51:24 -0400
From:      Allan Jude <allanjude@freebsd.org>
To:        freebsd-virtualization@freebsd.org
Subject:   Re: bhyve, Windows guest and trim support
Message-ID:  <4e0c7427-8bb4-37d6-b717-181d5c9b66d3@freebsd.org>
In-Reply-To: <e15ba239-9a73-2821-1f42-1700d74d031b@netfence.it>
References:  <e15ba239-9a73-2821-1f42-1700d74d031b@netfence.it>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--TOh9EVsdOfXdp6fBxAbexTLj7pbOMK1hM
Content-Type: multipart/mixed; boundary="kMiD2s1biVk0B0MRV2f7MOPwQH2rZP9eo";
 protected-headers="v1"
From: Allan Jude <allanjude@freebsd.org>
To: freebsd-virtualization@freebsd.org
Message-ID: <4e0c7427-8bb4-37d6-b717-181d5c9b66d3@freebsd.org>
Subject: Re: bhyve, Windows guest and trim support
References: <e15ba239-9a73-2821-1f42-1700d74d031b@netfence.it>
In-Reply-To: <e15ba239-9a73-2821-1f42-1700d74d031b@netfence.it>

--kMiD2s1biVk0B0MRV2f7MOPwQH2rZP9eo
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

On 2020-07-06 13:23, Andrea Venturoli wrote:
> Hello.
>=20
> I'm running zvol-backed Windows guests in bhyve on FreeBSD 12.1.
> Over time, I see the zvol effectively used space grow in size: a sign
> that Windows isn't trimming it.
>=20
> I'm using virtio-blk: I guess this driver does not support trim?
> I see reports that this support was added, but it's not clear to me
> whether it's in the released version or not (I've downloaded the stable=

> binary ISO from RedHat).
> Is trim expected to work in such a scenario?
> If not, is it a bhyve problem or a guest-driver problem (or both)?
>=20
> I tried virtio-scsi, which should support trim, but the guest doesn't
> even start in this case, getting stuck at the UEFI boot stage and endin=
g
> up in UEFI prompt.
> Again, is this expected?
> No guest driver has been loaded yet, so is it a bhyve limitation?
> Is some tweak needed?
>=20
> I tried changing from virtio-blk to ahci-hd: I was then able to manuall=
y
> trim the disk from inside the guest and recover a lot of space in the
> zpool.
> Alas ahci-hd is much slower, so I moved back to virtio-blk after that
> (at least for the time being).
>=20
> =C2=A0bye & Thanks
> =C2=A0=C2=A0=C2=A0=C2=A0av.
> _______________________________________________
> freebsd-virtualization@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
> To unsubscribe, send any mail to
> "freebsd-virtualization-unsubscribe@freebsd.org"

I added support for bhyve to understand virtio-blk TRIM messages to
FreeBSD 13 back in April, r360229

It should be possible to apply that patch to FreeBSD 12.1, and then your
Windows guest should be able to issue TRIM commands, and you will see
the space become free in your zvol.


There is a separate patch to teach the FreeBSD virtio-blk driver to send
TRIM commands, it is still in review (needs testing on hypervisors other
than bhyve):

https://reviews.freebsd.org/D21708


--=20
Allan Jude


--kMiD2s1biVk0B0MRV2f7MOPwQH2rZP9eo--

--TOh9EVsdOfXdp6fBxAbexTLj7pbOMK1hM
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)

iQIcBAEBAgAGBQJfBIvvAAoJEBmVNT4SmAt+wXsP/iDDQTYB1OyMvxHqhr9Y6Bhy
shBQOl2dKCa0QFsE667L2p3qaIp4FubXFZOOXIbLz6wV5PWHH29g6HEb2fuM0vO2
ToTMlXMTLyi4oCHHexZt24uU2mdASL0OJbnprUWR12HKvYSyvzlL7utHyaJTW08x
Ma6CC0LRvbld+dppD+QmDkqfHuZazPXWMfgmRSNXDY73bUXKSVV9oD0gnRZIM+0N
pZGRKyTbVqUyVPfJPSujBYr7JDPduPtwMHGFa1U1fHuKjFdlismf3pBXQnSQkJAm
WlfdGaQhu7SaoI94rGUIGiwa/WMie9jD0nF6eP7uCbWK5LjuWN2xd8GpnN96z45I
HhAkvnZNFfipGkg5x44uXFUwZ+wp8jZo+tpR3qMTGByNjfeunPmaZb+JlSpVXHtj
QaWwfWf++ZGPfr9UrUgNNevoQiUGY9lWNklhqVVWbNrJQGcG/I2XFBqdUICvbaxT
sfnlKOyMy/uiB4Kkdu0VrHf3IJdLFjPezA8rcsFU4v1drsjLpBke5TMNEcfyDFtO
pyYdr8ZYcomDAwEkyxepWKVFHdhnqR4aPaeMQpZZ4K9azjPq0XBFKRDj3ojec1S3
ReNfmWInYLYJ96GBOW7XXEf96tKcXtHj9gTXSwVeb7Qsm8pKIKAvs4DxLj9bEYec
pgP73JmY+g/hK9/OdEH+
=q2LU
-----END PGP SIGNATURE-----

--TOh9EVsdOfXdp6fBxAbexTLj7pbOMK1hM--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4e0c7427-8bb4-37d6-b717-181d5c9b66d3>