Date: Sat, 11 Apr 2020 11:15:50 -0400 From: Allan Jude <allanjude@freebsd.org> To: freebsd-virtualization@freebsd.org Subject: Re: bhyve: TRIM support in AHCI controller Message-ID: <c3b4ab3a-27c8-53ec-600b-f49e8c0ba465@freebsd.org> In-Reply-To: <CANBJ%2BxRW2F6U5_=p%2B_k33=1mvSfoONgNKtGF3T=2Ry%2B1fV_R=Q@mail.gmail.com> References: <CANBJ%2BxRW2F6U5_=p%2B_k33=1mvSfoONgNKtGF3T=2Ry%2B1fV_R=Q@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0GzGrlnBbqJ3I3vKS02NBJchnPLZjZM28 Content-Type: multipart/mixed; boundary="vZiEiHuNXaRtWIKADRrjcHZzbkiZJcNEG"; protected-headers="v1" From: Allan Jude <allanjude@freebsd.org> To: freebsd-virtualization@freebsd.org Message-ID: <c3b4ab3a-27c8-53ec-600b-f49e8c0ba465@freebsd.org> Subject: Re: bhyve: TRIM support in AHCI controller References: <CANBJ+xRW2F6U5_=p+_k33=1mvSfoONgNKtGF3T=2Ry+1fV_R=Q@mail.gmail.com> In-Reply-To: <CANBJ+xRW2F6U5_=p+_k33=1mvSfoONgNKtGF3T=2Ry+1fV_R=Q@mail.gmail.com> --vZiEiHuNXaRtWIKADRrjcHZzbkiZJcNEG Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2020-03-19 08:54, Wanpeng Qian wrote: > Hi all >=20 > I found the output of diskinfo inside VM of AHCI disk as follow, no > TRIM support. > root@smart:~ # diskinfo -v ada0 > ada0 > 512 # sectorsize > 21474836480 # mediasize in bytes (20G) > 41943040 # mediasize in sectors > 131072 # stripesize > 0 # stripeoffset > 41610 # Cylinders according to firmware. > 16 # Heads according to firmware. > 63 # Sectors according to firmware. > BHYVE SATA DISK # Disk descr. > BHYVE-0B98-104F-E9A7 # Disk ident. > No # TRIM/UNMAP support > 0 # Rotation rate in RPM > Not_Zoned # Zone Mode >=20 > Also camcontrol identify ada0 -v show not support of TRIM >=20 > Data Set Management (DSM/TRIM) no >=20 > I check to pci_ahci.c, TRIM support is decided by block_if.c's candelet= e flag. > while candelete is decided here >=20 > strlcpy(arg.name, "GEOM::candelete", sizeof(arg.name));= > arg.len =3D sizeof(arg.value.i); > if (ioctl(fd, DIOCGATTR, &arg) =3D=3D 0) > candelete =3D arg.value.i; >=20 > Obvious file backend will not have the candelete flag. >=20 > If the backend storage support TRIM, I think we should present TRIM > ability to VM. > Any better idea to check whether backend storage support TRIM or not, > so we can enable it. >=20 > Thanks. > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@fr= eebsd.org" >=20 I have updated my patch to add TRIM support to the bhyve block interface here: https://reviews.freebsd.org/D21707 I am working on an update to the virtio driver, to make FreeBSD guests able to TRIM if the hypervisor supports it as well: https://reviews.freebsd.org/D21708 --=20 Allan Jude --vZiEiHuNXaRtWIKADRrjcHZzbkiZJcNEG-- --0GzGrlnBbqJ3I3vKS02NBJchnPLZjZM28 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) iQIcBAEBAgAGBQJekd8pAAoJEBmVNT4SmAt+KcsQAJw5KEtADFY677repavDX6kK sT3+c1xU8ZkeN107FUcPa5ZE7/w5g+eyhgQaHe6wFpOMKWM5D7iby+zfx1sZgWgC IyRkfWSuhhnPOKadgQ8W598/NM+Yv6HykG8K50UFG0qTRpgBNK1vWwuKm0n0Bwuc NNnfTihxa3n538aTQbKvLmiCrByHD9KZecnLUahkbT9Qq2hIJnPTWkioiLalPz7j SMvgwysASPIjynUC9nVYWQbQI+xLxqBwu1+voXkLjHEEghcfcSXrRA3uIWj2PDW9 7WBYER+NnTW0onn2mtyVr7cMpyLoaWm23HoKerWXRotvOdJeWn5SA1EVMTvQSN70 XW6Egc9pdgQzLUJnIpOUbyblO0ebUX4D+ZTYNgCJDKWvkOazdXxQdWWKREp5kJnk RMHnaxHA6f8MBuwzQSggIfsEr0kqFzFiEvAV+z/SXQ3bFDrGiVZ9Ufhl0AHa3CTM LmefMLddzXqeWcoj/eQlh1FbaMxI8YK8PWVC+A7oRuATn5NCTHZTlLS9ijtY+wz0 ZM8VF2k95We8w9s5W7tFwm+oeYx748Tv5LZ1MTvADmMFpXkwZC0C5LpiWuspJJO9 CuUsoEtlawGpHMZCHgQCHsXWAE+P070NZ1sKzMs/jdA4JCgjDsr9FatHP9XFAdBf XUlT3Jkqqnd9FvCncCS/ =Myxf -----END PGP SIGNATURE----- --0GzGrlnBbqJ3I3vKS02NBJchnPLZjZM28--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c3b4ab3a-27c8-53ec-600b-f49e8c0ba465>