From owner-freebsd-fs@FreeBSD.ORG Tue Mar 19 08:25:58 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 071EDAFC for ; Tue, 19 Mar 2013 08:25:58 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id AB026B29 for ; Tue, 19 Mar 2013 08:25:57 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 0B36D81C; Tue, 19 Mar 2013 09:22:39 +0100 (CET) Date: Tue, 19 Mar 2013 09:27:32 +0100 From: Pawel Jakub Dawidek To: Thomas Steen Rasmussen Subject: Re: When will we see TRIM support for GELI volumes ? Message-ID: <20130319082732.GB1367@garage.freebsd.pl> References: <51479D54.1040509@gibfest.dk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="PmA2V3Z32TCmWXqI" Content-Disposition: inline In-Reply-To: <51479D54.1040509@gibfest.dk> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-fs@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Mar 2013 08:25:58 -0000 --PmA2V3Z32TCmWXqI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 19, 2013 at 12:03:48AM +0100, Thomas Steen Rasmussen wrote: > Hello there, >=20 > I was happy to see TRIM support in UFS and ZFS, however: > I would really like to see TRIM support for GELI volumes. At this point I am convinced that TRIM support should be added to GELI. In the past I wanted to implement BIO_DELETE support as secure delete, which can be found in the comment: case BIO_DELETE: /* * We could eventually support BIO_DELETE request. * It could be done by overwritting requested sector * with random data g_eli_overwrites number of times. */ default: g_io_deliver(bp, EOPNOTSUPP); return; } This was written back when none of the file systems we had supported TRIM. > I finally got an SSD with TRIM support for the laptop, but I can't > really use it with GELI disk encryption because the lack of TRIM > support makes writing to the disk really slow after a while. This is not what I see. On one of my SSDs in my laptop I've two partitions, both running ZFS, but one of them on top of GELI. I don't use ZFS TRIM yet, as I see no slowdown whatsoever. How can you say this is lack of TRIM slowing your writes? The performance degraded over time? > I've been told this is not a huge job, but I wouldn't know. It isn't. My idea to implement this is the following: - Add -t and -T flags to geli init/onetime/configure subcommands. -t will enable TRIM and -T will disable it. TRIM should be enabled by default for providers that are only encrypted and disabled by default for providers with integrity verification. - Add G_ELI_FLAG_TRIM flag that is set by default and configured using new switches above. - Update g_eli.c to pass BIO_DELETEs down if the G_ELI_FLAG_TRIM flag is set. If BIO_DELETE returns EOPNOTSUPP error, the G_ELI_FLAG_TRIM should be removed from the in-memory structure (but not from on-disk metadata, of course). Unfortunately I have no time currently to implement this, so if someone would like to beat me to it, this is how I'd imagine it. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --PmA2V3Z32TCmWXqI Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlFIIXQACgkQForvXbEpPzTfGACgzz1qbF8TyixQ9A8Oja2bc7YF kRoAoM7yd1L6tMNDMAP6mSqg+jcCn2Wt =GTl0 -----END PGP SIGNATURE----- --PmA2V3Z32TCmWXqI--