Date: Sun, 12 Apr 2020 18:43:40 -0700 From: John-Mark Gurney <jmg@funkthat.com> To: Allan Jude <allanjude@freebsd.org> Cc: freebsd-virtualization@freebsd.org Subject: Re: bhyve: TRIM support in AHCI controller Message-ID: <20200413014340.GN4213@funkthat.com> In-Reply-To: <c3b4ab3a-27c8-53ec-600b-f49e8c0ba465@freebsd.org> References: <CANBJ%2BxRW2F6U5_=p%2B_k33=1mvSfoONgNKtGF3T=2Ry%2B1fV_R=Q@mail.gmail.com> <c3b4ab3a-27c8-53ec-600b-f49e8c0ba465@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--t4apE7yKrX2dGgJC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Allan Jude wrote this message on Sat, Apr 11, 2020 at 11:15 -0400: > 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 >=20 > I have updated my patch to add TRIM support to the bhyve block interface > here: >=20 > https://reviews.freebsd.org/D21707 >=20 > I am working on an update to the virtio driver, to make FreeBSD guests > able to TRIM if the hypervisor supports it as well: >=20 > https://reviews.freebsd.org/D21708 One comment on that patch is that it looks like there are a number of white space and definitions (unrelated to the patch) that are included in the patch. It'd be good to break out those fixes and just commit them.. That would reduce the size of the patch a bit. --=20 John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." --t4apE7yKrX2dGgJC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJek8PLXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2MEI1RTRGMTNDNzYyMDZDNjEyMDBCNjAy MDVGMEIzM0REMDA2QURBAAoJECBfCzPdAGraiOEQAJGlLBoNg9TxABRKUQD7h1rg Ri7zqivD8NwmTrlmSzoUP3Pb/h6LszHivbbf6LXYG5NPGChps/kExZvLtMtuVjjk AejLW8xG8ZH1y8XWgy20eYitFkFf6/VZJqWexiiIpOxDKrYndbiJLY0zn7BSmPOn f6qpWCZuAyVsRy2sj2f0dVd9n8h/MEpgQw90bVzd/xyJoZitWuXLnk1YiKbyja+b a7qbt6J0rYlL9bXzoU6dbQgby0AlzmjeYa+JeUu/VigvPVElR5Kgrb9irQCb1bzD M+SaaVUDeB+4i8oOF891ey/Fi5iLtVgR2f4sYJSEdZadl1z6IHPipzMuVLXj4S9d pclW7PVGCuS4n9BVEoZfiG6HLj+G9jf79QhDf2pxYvnl5WMfFetkYM4iERJQTJWx LDnMJzJH6Ob9k189jxhkO1l30llegTEdYqdORxUVWVBVza57LrL+71ArVaMVSfq3 MrBcgEzOSyq5txH+yaLcuCNpi7s674aaWx8v6DAHN+TbansSgInRQ59ZtzoIEAqH AOsHfHeMZR7Dy+wQ7tXxOMrlrSxFKkANDlnXmbeun+f4Yvpu3wHsKW8zAoyReSco kFaltJMn/jvNp/TIX4Kz6VIDegR9Yk+Ceo0lN5+sobnQuJO4y6ScgsyaKa1rby2R +gPFLpjp95LH5UFFlT1c =jlue -----END PGP SIGNATURE----- --t4apE7yKrX2dGgJC--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200413014340.GN4213>