From owner-freebsd-virtualization@freebsd.org Tue Jul 7 02:01:01 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 4B88A34F94F for ; Tue, 7 Jul 2020 02:01:01 +0000 (UTC) (envelope-from dmarquess@gmail.com) 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 4B15JF0Vhwz3bdd for ; Tue, 7 Jul 2020 02:01:01 +0000 (UTC) (envelope-from dmarquess@gmail.com) Received: by mailman.nyi.freebsd.org (Postfix) id 1133334F9D9; Tue, 7 Jul 2020 02:01:01 +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 10FBE34FA93 for ; Tue, 7 Jul 2020 02:01:01 +0000 (UTC) (envelope-from dmarquess@gmail.com) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (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 "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B15JD1fDbz3bkL for ; Tue, 7 Jul 2020 02:00:59 +0000 (UTC) (envelope-from dmarquess@gmail.com) Received: by mail-ej1-x629.google.com with SMTP id l12so44918985ejn.10 for ; Mon, 06 Jul 2020 19:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=611Mc70qDkad2ozbPQ5Qp5uUxvPn8DR4sLklbgxKovc=; b=V+ZaErPNOd0oYMHFcT09y4Zpi8gnctyRO/uJlGH7UanVFek/Xt2esn3A8WApLg4isA GnkayuSIpvk7QV+yQFT0vQBFeP61Br8uVQkYHGr9cC2DCP9SfJwp1jeLKPh0a9LIm8no nXa4YCQ9buNIiCxUmpLhNGqwR297CoXB5HRiSgvqFAVNa+tTkZvH4unArePkeQKTSUQI +cPWx4NZn2xJqHGSLi5QP8zrWXKoo1nP+JjZo6M+Mt7luulJp6jGNrDdPnwg2EDShixd yTdzYnkzYnXF58pC5PhE0z+hPgLTIe9uyeoilZRz+OZGhGQVOpaCBYpjIL9RV+D3TQiF P71Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=611Mc70qDkad2ozbPQ5Qp5uUxvPn8DR4sLklbgxKovc=; b=XhGoYPX7Vm2OnTcHNITzHusQzitqZJQSFIE/w0oe7TSpzBqDzl7c7Osohxwr/aYWqw tk6PD0dCKWCzcuuVJnLmWp9sYbYnKS+8m7PyJyOkukR1/9fQ9DDf72cVAE6pXgyrKkVI jwuM12kGvQwu0QVWboU9aNKF7EyF/Xz0Obj9HeCOgI5bIfIi2Rs5VFNE4+xJMVFW7t3q jrfx2Au0lSq0wFdB6pS1ZEbfeCs4s0S/c6QKeQ7Kei3maJ7OCFbTPECL7/hwHllXStdY KaNu+CLgoX4xn8MCr8880DteB3jHYXpEuWHpLJ7yMHs5QDZQDyFKySbG2WazG0c/OKGr Oo3Q== X-Gm-Message-State: AOAM532OSfKFZUX+p64AA/l+kV+65Z57M+gKcpmpbV8f+v1ANZ/rnubE z1lNyunO+jlobexy5Uwv/TCJwK097GTlwQ5HTe8= X-Google-Smtp-Source: ABdhPJzu2VMYzShoQ5Rl5XqYEqPomEj7A22ZpDILm5p5rDi002lC0jiJmY8sOG3T7VPQm9iukhrpAM/4bZb34L6OsKU= X-Received: by 2002:a17:906:3a04:: with SMTP id z4mr39174676eje.441.1594087257837; Mon, 06 Jul 2020 19:00:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dustin Marquess Date: Mon, 6 Jul 2020 21:00:46 -0500 Message-ID: Subject: Re: bhyve, Windows guest and trim support To: Wanpeng Qian Cc: Andrea Venturoli , virtualization@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4B15JD1fDbz3bkL X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=V+ZaErPN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of dmarquess@gmail.com designates 2a00:1450:4864:20::629 as permitted sender) smtp.mailfrom=dmarquess@gmail.com X-Spamd-Result: default: False [-3.42 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.97)[-0.973]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[virtualization@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.002]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::629:from]; NEURAL_HAM_SHORT(-0.45)[-0.450]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] 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: Tue, 07 Jul 2020 02:01:01 -0000 +1 A ghetto hack would be to enable compression on the zvol (at least zle) and then 0-fill available space. Granted it would still show as "used", but it would decrease the amount of really used space. But NVMe would still be better :) -Dustin On Mon, Jul 6, 2020 at 8:46 PM Wanpeng Qian wrote: > > I also recommend NVMe controller, it supports Deallocate(in SATA, it > is called TRIM.) > > chuck has committed a lot of patches to NVMe controller in 13.0 Current. > Just install 12.1-STABLE, fetch pci_nvme.c from 13.0 Current, recompile bhyve. > It works great. stable/fast. > > On Tue, Jul 7, 2020 at 6:40 AM Dustin Marquess wrote: > > > > Try nvme, I believe that driver supports TRIM and I've had a lot > > better performance with it over ahci-hd. > > > > -Dustin > > > > On Mon, Jul 6, 2020 at 12:24 PM Andrea Venturoli wrote: > > > > > > 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. > > > _______________________________________________ > > > 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" > > _______________________________________________ > > 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"