Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Dec 2010 21:45:46 -0800
From:      Kirk McKusick <>
To:        Julian Elischer <>
Cc:        Oliver Fromme <>, Pawel Jakub Dawidek <>,
Subject:   Re: TRIM support for UFS? 
Message-ID:  <>
In-Reply-To: <> 

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
> Date: Thu, 09 Dec 2010 21:19:52 -0800
> From: Julian Elischer <>
> To: Pawel Jakub Dawidek <>
> CC: Bakul Shah <>, Kirk McKusick <>,
>         Oliver Fromme <>,
> Subject: Re: TRIM support for UFS?
> One of the things that has not been mentioned is that releasing
> space in a file is not really 'free' (at least not for us) if you
> want things to remain trimmed after a reboot.  So if I were
> implementing it I'd want a couple of parameters.
> 1/ don't bother trimming free space under some size.
> 2/ does it matter if the trimmed space comes back as garbage
> after an unclean shutdown? (a hint to the driver, and no, I don't
> know anyone that supports this yet)
> (there are security implications to that one but cheap trim (that
> may come back) is way cheaper than persistent trim to impliment).
> With these parameters we (fusion-io) could tune our behaviour
> which can save performance, and also the file system could tune
> it's min-trim value to see what gives best performance.

The above is one of the reasons that we never implemented the
`release' system call. To be stable after a crash requires either
a lot of synchronous writes or a bunch more soft update dependencies.
Many of the same issues relate to stability of snapshots across
system crashes. In the end we added the dopersistence flag:

 * To ensure the consistency of snapshots across crashes, we must
 * synchronously write out copied blocks before allowing the
 * originals to be modified. Because of the rather severe speed
 * penalty that this imposes, the following flag allows this
 * crash persistence to be disabled.
int dopersistence = 0;
#ifdef DEBUG
#include <sys/sysctl.h>
SYSCTL_INT(_debug, OID_AUTO, dopersistence, CTLFLAG_RW, &dopersistence, 0, "");
#endif /* DEBUG */

As you can see it defaults to off.

	Kirk McKusick

Want to link to this message? Use this URL: <>