Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Dec 2010 01:58:38 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Bakul Shah <bakul@bitblocks.com>
Cc:        Kirk McKusick <mckusick@mckusick.com>, Oliver Fromme <olli@lurza.secnetix.de>, freebsd-fs@freebsd.org
Subject:   Re: TRIM support for UFS?
Message-ID:  <20101210005838.GD1866@garage.freebsd.pl>
In-Reply-To: <20101210003749.3F7E15B92@mail.bitblocks.com>
References:  <201012091813.oB9IDd2H078366@chez.mckusick.com> <20101210003749.3F7E15B92@mail.bitblocks.com>

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

--ylS2wUBXLOxYXZFQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Dec 09, 2010 at 04:37:48PM -0800, Bakul Shah wrote:
> On Thu, 09 Dec 2010 10:13:39 PST Kirk McKusick <mckusick@mckusick.com>  w=
rote:
> > Other than the nit pointed out by Pawel, the diffs look good to me.
> > You should consider adding the -t option to newfs so that the TRIM
> > option can be specified at the time the filesystem is created (as
> > a general rule, anything you can do with tunefs should also be
> > possible with newfs).
> >=20
> > I agree with your decision to let administrators opt-out of doing
> > TRIM. If experience shows it to be generally useful to have it on,
> > we can change the default to enabled later. If we do change the
> > default to enabled, then we will want to delete the warning about TRIM
> > not being supported by the underlying disk that you added at mount
> > time as we would start getting a lot of them for all the non-SSD disks.
>=20
> Would be nice if something like ftrim(fd, offset, size) or
> trim(path, offsetm size) or TRIM file ioctl is added, to free
> up blocks undelying a given range in a file.  ftruncate can
> delete blocks at the end but there is no facility to lose
> blocks in the middle.  Mainly handy for virtual disks and
> databases (and would work nicely with SEEK_DATA, SEEK_HOLE).

libgeom(3) provides:

	int g_delete(int fd, off_t offset, off_t length);

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
pjd@FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

--ylS2wUBXLOxYXZFQ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAk0Bez0ACgkQForvXbEpPzTIDQCfV8O/HK/uNsslogvXeWYVfaaO
qtsAnRCRdCZTCBUxhBhCCI4EDkwe/oPk
=Irz9
-----END PGP SIGNATURE-----

--ylS2wUBXLOxYXZFQ--



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