From owner-freebsd-fs@freebsd.org Mon May 14 20:37:46 2018 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A23BE76A36 for ; Mon, 14 May 2018 20:37:46 +0000 (UTC) (envelope-from eborisch@alumni.stanford.edu) Received: from mail-lf0-x232.google.com (mail-lf0-x232.google.com [IPv6:2a00:1450:4010:c07::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F0C3F82F7B for ; Mon, 14 May 2018 20:37:45 +0000 (UTC) (envelope-from eborisch@alumni.stanford.edu) Received: by mail-lf0-x232.google.com with SMTP id r2-v6so20014420lff.4 for ; Mon, 14 May 2018 13:37:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=lfsAkfca1D1+DH6z17qUZ/RfA27k9fA5XSyJ+dDeTho=; b=MEw5kw2Uxw28bUyCw0HjXug2Eh6CWBJo7O82pBlsX1BSqEcphj/056a4s6wEWSg804 A5Rh3/5TXTueaq9IoepoIrZxfV282o9/zzxGMjsZWw+LfQXk5RykMhqn2ewJd5UZ1Y7/ jW6RWC15QTt2Qt9o3bs83LlflFZHmoYJorBSVcvQcooO8VDJLfIMmBHf8Dl0LnEuEpnY dItw1J8Wb/DOx2gVF/inmWwQLh2SzPTspPXS0Uw1tPooHtjIRptFX6yoWdWrjB/mRujv U51mXkQZtyHqXhPQYQceuKgcf5kvySlgKMfzUDMTXK+gpP6+aJ4+M/Vv7OxMucRAqXfb qVWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=lfsAkfca1D1+DH6z17qUZ/RfA27k9fA5XSyJ+dDeTho=; b=AKsy8owSyEvQrxwW6UV7aQqCrq3xf06c3QE7uREHUrUDmrtpukdg6U9UtcITEAdyIw bY0bFZaXeIeguEgFJRcTl3BcI8CjjvK60fzABnuUmkGpNLwXDOzSEi60YnH4gr0iDYFo bpdOFoCZVcEskSYSK+91Fwnpk9H/MZW5pj+sR62Wa+jRfU3gskmTJSFlCEpt6cAF5ksX RMJpUP2U6OHhS5+BTBhBfnM67agnvF3RyBjAI7C1AcdaBYtDoB/2f7SLUF+A7S2lLXSA SeV5Ua3OksbAOvpj8sT6W7/5OjTTTHE8QfTJMCZ8wcAssKI639Xb4iGz5pHMYX5TFtcY YwkQ== X-Gm-Message-State: ALKqPweaLCMxytjbkk0M3/Sq2WcblpFlzlLTyOqHmPo7c8TsKDrMDzR9 pGXmpU+LPxT+aPI/w7Vl8h9c/FGzNPxKMo3uu+bDgg== X-Google-Smtp-Source: AB8JxZpSL02m1QoJGQH95JMt96ySuJ3mzirx6Sd/p+RgUHiD6x5vSudzOX26MJiuEXDm2/NUgFzlHU5askduEleE30E= X-Received: by 2002:a19:23c8:: with SMTP id j191-v6mr9290420lfj.1.1526330264605; Mon, 14 May 2018 13:37:44 -0700 (PDT) MIME-Version: 1.0 Sender: eborisch@alumni.stanford.edu Received: by 2002:a2e:84cc:0:0:0:0:0 with HTTP; Mon, 14 May 2018 13:37:43 -0700 (PDT) In-Reply-To: References: From: Eric Borisch Date: Mon, 14 May 2018 15:37:43 -0500 X-Google-Sender-Auth: 7KrRhX6Bm6J6007gWiKsfVhA4Bs Message-ID: Subject: Re: Releasing deleted blocks from a sparse ZVOL To: =?UTF-8?Q?Karli_Sj=C3=B6berg?= Cc: Paul Esson , "freebsd-fs@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2018 20:37:46 -0000 I've had success in a similar config by attaching the zvol as 'ahci-hd', which shows up as a 'BHYVE SATA DISK' in a BSD guest. With such a guest (running a zpool on the attached device): kstat.zfs.misc.zio_trim.failed: 0 kstat.zfs.misc.zio_trim.unsupported: 0 kstat.zfs.misc.zio_trim.success: 179883 kstat.zfs.misc.zio_trim.bytes: 13126696960 Also working with a linux guest. I see the expected tracking of the 'logicalreferenced' size in the host with the ALLOC size in the guest (allowing for upward bias due to using 32k sector sizes on my zvols). Note that TRIM and UNMAP are two extremely similar but distinct (used for SATA & SCSI, respectively) commands. Both are commonly referred to as 'trim' by layers above the device drivers. - Eric