From owner-freebsd-virtualization@freebsd.org Mon Jul 6 17:24:00 2020 Return-Path: Delivered-To: freebsd-virtualization@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BCDC436CC39 for ; Mon, 6 Jul 2020 17:24:00 +0000 (UTC) (envelope-from ml@netfence.it) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0sqh34k2z4KM2 for ; Mon, 6 Jul 2020 17:24:00 +0000 (UTC) (envelope-from ml@netfence.it) Received: by mailman.nyi.freebsd.org (Postfix) id 69A5436CB30; Mon, 6 Jul 2020 17:24:00 +0000 (UTC) Delivered-To: virtualization@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 696D836C863 for ; Mon, 6 Jul 2020 17:24:00 +0000 (UTC) (envelope-from ml@netfence.it) Received: from soth.netfence.it (net-2-44-121-52.cust.vodafonedsl.it [2.44.121.52]) (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 (2048 bits) client-digest SHA256) (Client CN "mailserver.netfence.it", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B0sqg3972z4KGx for ; Mon, 6 Jul 2020 17:23:55 +0000 (UTC) (envelope-from ml@netfence.it) Received: from alamar.ventu (alamar.local.netfence.it [10.1.2.18]) (authenticated bits=0) by soth.netfence.it (8.15.2/8.15.2) with ESMTPSA id 066HNjQ9077187 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO) for ; Mon, 6 Jul 2020 19:23:48 +0200 (CEST) (envelope-from ml@netfence.it) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netfence.it; s=202005; t=1594056228; bh=g3jwxfrI/vu4Sm6gX/IJBKoGC7i2/tlHWER7Y2QUX4E=; h=To:From:Subject:Date; b=qrwHr7bjK4ByTPGbyMv41DNXVNe2nwFsD0inrlB0C9WLl61/y0xLy2cSLvLdEgVZC oQAJ+pyn4uJz+KWf/xUrTCkHwzl5r/KVXuP/DNnyKXzBVEMa/wTobqIko2hrJt8aoH 7Z9w4CcuiTu0LP/ucJ0e/rPbFWXkwO1RtPnKJkUw= X-Authentication-Warning: soth.netfence.it: Host alamar.local.netfence.it [10.1.2.18] claimed to be alamar.ventu To: virtualization@FreeBSD.org From: Andrea Venturoli Subject: bhyve, Windows guest and trim support Message-ID: Date: Mon, 6 Jul 2020 19:23:45 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4B0sqg3972z4KGx X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=netfence.it header.s=202005 header.b=qrwHr7bj; dmarc=pass (policy=none) header.from=netfence.it; spf=pass (mx1.freebsd.org: domain of ml@netfence.it designates 2.44.121.52 as permitted sender) smtp.mailfrom=ml@netfence.it X-Spamd-Result: default: False [-3.08 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[netfence.it:s=202005]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:2.44.121.52]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[virtualization@freebsd.org]; HAS_XAW(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.01)[-1.013]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[netfence.it:+]; DMARC_POLICY_ALLOW(-0.50)[netfence.it,none]; NEURAL_HAM_SHORT(-0.02)[-0.024]; NEURAL_HAM_MEDIUM(-1.04)[-1.038]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:30722, ipnet:2.44.0.0/16, country:IT]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2020 17:24:00 -0000 Hello. 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. 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)? 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 ending 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? I tried changing from virtio-blk to ahci-hd: I was then able to manually 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). bye & Thanks av.