From owner-freebsd-current@freebsd.org Wed Apr 29 15:45:00 2020 Return-Path: Delivered-To: freebsd-current@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 8D88A2B8CCA; Wed, 29 Apr 2020 15:45:00 +0000 (UTC) (envelope-from maurizio1018@gmail.com) Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) 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 49C2rq3p65z4NM3; Wed, 29 Apr 2020 15:44:59 +0000 (UTC) (envelope-from maurizio1018@gmail.com) Received: by mail-pl1-x62f.google.com with SMTP id s10so981944plr.1; Wed, 29 Apr 2020 08:44: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=LlynscaEQsCbgPXe3mcKso8sONw8o237H9qQHeW4usA=; b=uji208oJlzs9V/UsiyTzPydJIWInZESRlHHjNfoISCl8LjQfjpJln98FImpppI1wfC Nri+a2HgBdebKJnSSAO3n2zCOYDVxkFpRBm5ttvu773D0XMTw3WUzUMZ22wbXM92r2XD 8B5tJWMgBmRBKiidsKCFn1HCZ0sXHHY1SoQPxdavX1mFvNPg/A1BIHHR/QH5l3XvL52m ZLbHr8pYFXQFPgNoz1l1V6lIu3IXu/m1R0GnLKwWFanfDGjAjzfGboVRNeWzgAqog2gP sYzGa3HuhBWgWomrkf4qjXmMoC4jfUeK/qq0z7HPHJugkFrsUGYgARlZKz2RXgvmpWGG x8dA== 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=LlynscaEQsCbgPXe3mcKso8sONw8o237H9qQHeW4usA=; b=lXMuTD9uPflLdjio+jxXmb2j921+5QzSy1EsLdnaZpPdSCHDO3f0uIcIIj8B1Az2JD CDn0jHpNbuyVSChAeFW0x0KFYuaSwFXT7I3t/mJFVdbsnk7TgQXizx42yjvQemC5zXzp vDyY992OmhWSEznTNOcBqc8gTCyMg+QOrxVS8QT1deXfQssK8rPAG69E6+TSGIjphVmV NKQ5YSKbxJJMfcq+rI7hriyi7IrD3qopsfvH+GsxQO2bR8YFYcC3Fi7Rjqwp69LYdA67 /JHQw5Wc4wNDCdFIJorVwdySXc0ZEi09DFCGZXGzxR+8XG2Ny0WlG6Vn46l2+udHAGBE oHhw== X-Gm-Message-State: AGi0Pubre42JopgI67IVYEgGu3pjQSuidxxfK8z0D9N+R9xeYm9OzidA DHE103wmJabKGntbG1euHfOMF1uw83uuexPaz7QaAhbP X-Google-Smtp-Source: APiQypIaGAMCA9P1S5KLlw2uLpEmjS2We2ezsyJ0EnfmaHgdggspnkbsjuOvQDpJYiqGrLvbUTGXBcogOsEhDXLBcJs= X-Received: by 2002:a17:90b:b08:: with SMTP id bf8mr3974265pjb.158.1588175097667; Wed, 29 Apr 2020 08:44:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Maurizio Vairani Date: Wed, 29 Apr 2020 17:44:44 +0200 Message-ID: Subject: Re: OpenZFS port updated To: Ryan Moeller Cc: freebsd-current , freebsd-stable@freebsd.org X-Rspamd-Queue-Id: 49C2rq3p65z4NM3 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=uji208oJ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of maurizio1018@gmail.com designates 2607:f8b0:4864:20::62f as permitted sender) smtp.mailfrom=maurizio1018@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; URI_COUNT_ODD(1.00)[9]; IP_SCORE_FREEMAIL(0.00)[]; IP_SCORE(0.00)[ip: (-9.13), ipnet: 2607:f8b0::/32(-0.33), asn: 15169(-0.43), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[f.2.6.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2020 15:45:00 -0000 Il giorno ven 17 apr 2020 alle ore 20:36 Ryan Moeller ha scritto: > FreeBSD support has been merged into the master branch of the openzfs/zfs > repository, and the FreeBSD ports have been switched to this branch. > > OpenZFS brings many exciting features to FreeBSD, including: > * native encryption > * improved TRIM implementation > * most recently, persistent L2ARC > > Of course, avoid upgrading your pools if you want to keep the option to g= o > back to the base ZFS. > > OpenZFS can be installed alongside the base ZFS. Change your loader.conf > entry to openzfs_load=3D=E2=80=9CYES=E2=80=9D to load the OpenZFS module = at boot, and set > PATH to find the tools in /usr/local/sbin before /sbin. The base zfs tool= s > are still basically functional with the OpenZFS module, so changing PATH = in > rc is not strictly necessary. > > The FreeBSD loader can boot from pools with the encryption feature > enabled, but the root/bootenv datasets must not be encrypted themselves. > > The FreeBSD platform support in OpenZFS does not yet include all features > present in FreeBSD=E2=80=99s ZFS. Some notable changes/missing features i= nclude: > * many sysctl names have changed (legacy compat sysctls should be added > at some point) > * zfs send progress reporting in process title via setproctitle > * extended 'zfs holds -r' ( > https://svnweb.freebsd.org/base?view=3Drevision&revision=3D290015) > * vdev ashift optimizations ( > https://svnweb.freebsd.org/base?view=3Drevision&revision=3D254591) > * pre-mountroot zpool.cache loading (for automatic pool imports) > > To the last point, this mainly effects the case where / is on ZFS and > /boot is not or is on a different pool. OpenZFS cannot handle this case > yet, but work is in progress to cover that use case. Booting directly fro= m > ZFS does work. > > If there are pools that need to be imported at boot other than the boot > pool, OpenZFS does not automatically import yet, and it uses > /etc/zfs/zpool.cache rather than /boot/zfs/zpool.cache to keep track of > imported pools. To ensure all pool imports occur automatically, a simple > edit to /etc/rc.d/zfs will suffice: > > diff --git a/libexec/rc/rc.d/zfs b/libexec/rc/rc.d/zfs > index 2d35f9b5464..8e4aef0b1b3 100755 > --- a/libexec/rc/rc.d/zfs > +++ b/libexec/rc/rc.d/zfs > @@ -25,6 +25,13 @@ zfs_start_jail() > > zfs_start_main() > { > + local cachefile > + > + for cachefile in /boot/zfs/zpool.cache /etc/zfs/zpool.cache; do > + if [ -f $cachefile ]; then > + zpool import -c $cachefile -a > + fi > + done > zfs mount -va > zfs share -a > if [ ! -r /etc/zfs/exports ]; then > > This will probably not be needed long-term. It is not necessary if the > boot pool is the only pool. > > Happy testing :) > > - Ryan > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org= " > On my laptop I am testing the new OpenZFS, I am running: > uname -a FreeBSD NomadBSD 12.1-RELEASE-p3 FreeBSD 12.1-RELEASE-p3 GENERIC amd64 > freebsd-version -ku 12.1-RELEASE-p3 12.1-RELEASE-p4 I want let ZFS to write to the laptop SSD only every 1800 seconds: > sudo zfs set sync=3Ddisabled zroot and I have added these lines in /etc/sysctl.conf: # Write to SSD every 30 minutes. # 19/04/20 Added support for OpenZFS. # Force commit Transaction Group (TXG) at 1800 secs, increase to aggregated # more data (default 5 sec) # vfs.zfs.txg.timeout for ZFS, vfs.zfs.txg_timeout for OpenZFS vfs.zfs.txg.timeout=3D1800 vfs.zfs.txg_timeout=3D1800 # Write throttle when dirty "modified" data reaches 98% of dirty_data_max #(default 60%) vfs.zfs.delay_min_dirty_percent=3D98 # Force commit Transaction Group (TXG) if dirty_data reaches 95% of # dirty_data_max (default 20%) # vfs.zfs.dirty_data_sync_pct for ZFS, vfs.zfs.dirty_data_sync_percent for OpenZFS vfs.zfs.dirty_data_sync_pct=3D95 vfs.zfs.dirty_data_sync_percent=3D95 For testing the above settings I use the command: =E2=80=98zpool iostat -v = -Td zroot 600=E2=80=99 . On the classic FreeBSD ZFS the output of the above command is similar to: Tue Apr 28 14:44:08 CEST 2020 capacity operations bandwidth pool alloc free read write read write ---------------------------- ----- ----- ----- ----- ----- ----- zroot 31.9G 61.1G 206 38 5.52M 360K diskid/DISK-185156448914p2 31.9G 61.1G 206 38 5.52M 360K ---------------------------- ----- ----- ----- ----- ----- ----- Tue Apr 28 14:54:08 CEST 2020 capacity operations bandwidth pool alloc free read write read write ---------------------------- ----- ----- ----- ----- ----- ----- zroot 31.9G 61.1G 8 0 297K 0 diskid/DISK-185156448914p2 31.9G 61.1G 8 0 297K 0 ---------------------------- ----- ----- ----- ----- ----- ----- Tue Apr 28 15:04:08 CEST 2020 capacity operations bandwidth pool alloc free read write read write ---------------------------- ----- ----- ----- ----- ----- ----- zroot 31.9G 61.1G 0 0 14.4K 0 diskid/DISK-185156448914p2 31.9G 61.1G 0 0 14.4K 0 ---------------------------- ----- ----- ----- ----- ----- ----- Tue Apr 28 15:14:08 CEST 2020 capacity operations bandwidth pool alloc free read write read write ---------------------------- ----- ----- ----- ----- ----- ----- zroot 31.9G 61.1G 0 0 2.89K 18.4K diskid/DISK-185156448914p2 31.9G 61.1G 0 0 2.89K 18.4K ---------------------------- ----- ----- ----- ----- ----- ----- Tue Apr 28 15:24:08 CEST 2020 capacity operations bandwidth pool alloc free read write read write ---------------------------- ----- ----- ----- ----- ----- ----- zroot 31.9G 61.1G 0 0 798 0 diskid/DISK-185156448914p2 31.9G 61.1G 0 0 798 0 ---------------------------- ----- ----- ----- ----- ----- ----- Tue Apr 28 15:34:08 CEST 2020 capacity operations bandwidth pool alloc free read write read write ---------------------------- ----- ----- ----- ----- ----- ----- zroot 31.9G 61.1G 0 0 2.43K 0 diskid/DISK-185156448914p2 31.9G 61.1G 0 0 2.43K 0 ---------------------------- ----- ----- ----- ----- ----- ----- Tue Apr 28 15:44:08 CEST 2020 capacity operations bandwidth pool alloc free read write read write ---------------------------- ----- ----- ----- ----- ----- ----- zroot 31.9G 61.1G 0 0 587 14.2K diskid/DISK-185156448914p2 31.9G 61.1G 0 0 587 14.2K ---------------------------- ----- ----- ----- ----- ----- ----- where the SSD is written every 1800 seconds. On the new OpenZFS the output is: Tue Apr 28 15:58:09 2020 capacity operations bandwidth pool alloc free read write read write ---------------------------- ----- ----- ----- ----- ----- ----- zroot 31.9G 61.1G 203 24 5.18M 236K diskid/DISK-185156448914p2 31.9G 61.1G 203 24 5.18M 236K ---------------------------- ----- ----- ----- ----- ----- ----- Tue Apr 28 16:08:09 2020 capacity operations bandwidth pool alloc free read write read write ---------------------------- ----- ----- ----- ----- ----- ----- zroot 31.9G 61.1G 8 0 287K 9.52K diskid/DISK-185156448914p2 31.9G 61.1G 8 0 287K 9.52K ---------------------------- ----- ----- ----- ----- ----- ----- Tue Apr 28 16:18:09 2020 capacity operations bandwidth pool alloc free read write read write ---------------------------- ----- ----- ----- ----- ----- ----- zroot 31.9G 61.1G 0 0 15.6K 10.0K diskid/DISK-185156448914p2 31.9G 61.1G 0 0 15.6K 10.0K ---------------------------- ----- ----- ----- ----- ----- ----- Tue Apr 28 16:28:09 2020 capacity operations bandwidth pool alloc free read write read write ---------------------------- ----- ----- ----- ----- ----- ----- zroot 31.9G 61.1G 0 0 3.07K 12.2K diskid/DISK-185156448914p2 31.9G 61.1G 0 0 3.07K 12.2K ---------------------------- ----- ----- ----- ----- ----- ----- Tue Apr 28 16:38:09 2020 capacity operations bandwidth pool alloc free read write read write ---------------------------- ----- ----- ----- ----- ----- ----- zroot 31.9G 61.1G 0 0 573 11.1K diskid/DISK-185156448914p2 31.9G 61.1G 0 0 573 11.1K ---------------------------- ----- ----- ----- ----- ----- ----- Tue Apr 28 16:48:09 2020 capacity operations bandwidth pool alloc free read write read write ---------------------------- ----- ----- ----- ----- ----- ----- zroot 31.9G 61.1G 0 0 1.96K 10.6K diskid/DISK-185156448914p2 31.9G 61.1G 0 0 1.96K 10.6K ---------------------------- ----- ----- ----- ----- ----- ----- where the SSD is always written. What I am missing ? Thanks in advance. -- Maurizio