xfs
[Top] [All Lists]

Re: automatically running fstrim

To: Phil Karn <karn@xxxxxxxxxxxx>
Subject: Re: automatically running fstrim
From: Lukas Czerner <lczerner@xxxxxxxxxx>
Date: Wed, 25 May 2011 12:06:32 +0200 (CEST)
Cc: xfs@xxxxxxxxxxx
In-reply-to: <4DDBE293.8030203@xxxxxxxxxxxx>
References: <4DDBE293.8030203@xxxxxxxxxxxx>
User-agent: Alpine 2.00 (LFD 1167 2008-08-23)
On Tue, 24 May 2011, Phil Karn wrote:

> Now that the Linux 2.6.39 kernel is out, is there any reason I shouldn't
> run fstrim out of my crontab? It doesn't seem to slow down my system
> significantly while it runs.
> 
> As I understand fstrim, it walks through the file system free list
> issuing TRIMs for each entry, and except for whatever load the TRIM
> commands themselves generate (which is drive dependent) it shouldn't
> interfere that much with system operation. Correct? Is there any
> mechanism to issue these commands at a lower priority than regular disk I/O?

No, not that I know of. But why not to run fstrim from cron lets say every
day ? Note that you do not necessarily need to run it "all the time",
because if the drive firmware has a lot of space for doing
wear-leveling, there is no point of sending TRIM.

Also keep in mind that lot of newer SSD's has some "hidden" space just
for wear-leveling, so to get to the point where firmware will have hard
time doing it and the drive actually get slower takes even more writes
than just filling your drive up to max.

So doing fstrim once or twice a day (it really depends on your work
load) is more than enough.

Also, since we have all this in place we might talk to distributions to
add the infrastructure to actually recognise "discard enabled" devices
and add fstrim into cron job automatically. Or, since the filesystem
should know the best when is the "right" time to do this, we might try
to figure out some kernel logic to trigger it. However it might be a
little bit tricky, since every drive behaves differently...

Thanks!
-Lukas

> 
> Thanks for all the work you guys do on XFS. It is much appreciated.
> 
> Phil
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs
> 

-- 

<Prev in Thread] Current Thread [Next in Thread>