Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Mar 2013 09:27:32 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Thomas Steen Rasmussen <thomas@gibfest.dk>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: When will we see TRIM support for GELI volumes ?
Message-ID:  <20130319082732.GB1367@garage.freebsd.pl>
In-Reply-To: <51479D54.1040509@gibfest.dk>
References:  <51479D54.1040509@gibfest.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130319082732.GB1367>