Red Hat Bugzilla – Bug 852990
Document/Discuss added TRIM support to XFS
Last modified: 2013-02-25 19:51:43 EST
TRIM is not really an XFS specific function. FITRIM is also available for ext4, and both mkfs.ext4 and mkfs.xfs use FITRIM the same way. The fstrim application works identically from a user perspective for both ext4 and XFS.
So if you've already got FITRIM guidelines for ext4, it's likely to be pretty much the same for XFS as well. Do you have guidelines for ext4 already that you can point me at so i can see if they can be reused/made common?
Note: FITRIM != online discard.
(In reply to comment #3)
> Note: FITRIM != online discard.
To address online discard, the simple rule of thumb is this: Don't - use FITRIM instead. e.g.:
"The slowness of individual TRIM commands cannot be fixed in XFS -
it' aproperty of the SSD. And no, it's not unique to Sandforce
controllers - there are other types of controllers that have
similiar (or worse) TRIM behaviour. ....
This is one of the reasons why our current recommendation is to not
use online discard, but use background discard (FITRIM) to
periodically issue discards on the free space in the filesystem. It
does not happen in a filesystem performance fast-path, can be
configured with a minimum size to trim, and usually requires much
fewer TRIM commands to be sent to the device so is generally safer."
"So until the block layer is sorted out I can not recommend actually
using -o discard. I planned to sort out the block layer issues ASAP
when writing that code, but other things have kept me busy every since."
From my perspective, online discard on XFS is a checkbox feature due to the deficiencies of the implementation of discard in the layers below XFS. i.e. it's not something that should really be used in production systems at this point in time...
Oh and in another case the proposed documentation says:
> *FITRIM operations* are run explicitly by the user with the 'fitrim' command.
but there is no 'fitrim' command, it's 'fstrim' so that needs to be fixed.
I'm going to take another crack at rewriting the above documentation and see what folks think.
Resolved and released alongside Red Hat Enterprise Linux 6.4.