[xfs-masters] how to use fstrim?
Dave Chinner
david at fromorbit.com
Wed Jul 31 19:08:45 CDT 2013
On Wed, Jul 31, 2013 at 09:26:35AM -0400, Greg Freemyer wrote:
> On Fri, Jul 26, 2013 at 9:50 PM, Dave Chinner <david at fromorbit.com> wrote:
> > IOWs, the behaviour of fstrim on XFS is entirely dependent on the
> > speed of the block layer and hardware implementations of discards.
>
> And on a lot of SSDs, trim seems to act like a cache flush so it can
> hit performance hard.
That's because TRIM on SATA3 is an unqueued command. It basically
causes the pipeline to be emptied before it can be issued, and no
further IO can be issued until it completes. SATA3.1 is supposed to
add a queued TRIM command, but it might be some time before we see
that appearing in hardware...
> It should be scheduled for off-peak times
> afaik. It's not critical to run hourly or even daily. If you can
> schedule it once a week when other i/o is light that should be enough
> for most workloads.
I run it once every couple of months on my SSDs, if ever. Most
modern SSDs have background defragmentation so if they are left idle
for a couple of hours they clean themselves up pretty well without
needing TRIM...
Cheers,
Dave.
--
Dave Chinner
david at fromorbit.com
More information about the xfs
mailing list