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