3 Replies Latest reply: Oct 20, 2010 4:54 AM by PeterUK RSS

The reason why trim is so hard to do with RAID

PeterUK Community Member
Currently Being Moderated

This is my understanding of how the SSD and trim works so if I'm wrong I'm wrong...

 

What does trim do.

It does what the SSD would do if a block with deleted or stored data needs erasing for more space to do a read-modify-write to empty pages for a block and if any of the pages in that block can be empty and can be used. Now what I think (and if the above is correct too) trim does is it knows what pages are empty in a block and so can do a read-modify-write or empty a block for more space as if you write 2048KB across four 512KB blocks filling all pages then delete it the SSD with trim can just erase them four 512KB blocks as free space.

 

The reason you can't send the trim command to SSD's in RAID is because the OS is sending a trim command for what looks like one SSD and sees your RAID as a single SSD only the RAID controller can see RAID.

 

The only way trim can be done with RAID is if (big if really, really big if) the RAID controller as in and like Rapid Storage Technology to do the trim...the how must be extremely difficult in that the only way it might be done is that the OS sends the trim command to the RAID controller that by a complex understanding can make trim commands per SSD to erase/free up space in RAID.

 

...and if what I said is so far wrong I did say I might be wrong...

  • 1. Re: The reason why trim is so hard to do with RAID
    redux Community Member
    Currently Being Moderated

    The most plausible explanation I have come across was in a comment left on the Anandtech G3 spec review by HachavBanav.

     

    http://www.anandtech.com/show/3965/intels-3rd-generation-x25m-ssd-specs-revealed#comments

     

    "-Any OS uses one (or more) page size for all its io

    -A RAID array is build using a mix of a "stripe size" on each of the drives participating in the array

    -TRIMing less than a stripe is a very difficult task even for RAID 0

    Example with any Windows 7 installed on a RAID 0 array build with 2x HDD and a 64KB stripe

    ==> The OS cluster size is usually 4KB, so you may (simplified process):

    -Write a small file on the first clusters (#0 = 4KB)

    -The RAID controller read the first 64KB stripe of the first HDD and rewrite it with 4KB updated

    -Write another small file on the 2d clusters (#1 = 4KB)

    -The RAID controller read the first 64KB stripe of the first HDD and rewrite it with 4KB updated

    -Delete the first file will send a TRIM command to #0

    ==> Now, if the SSD TRIM this #0, what would be the 4KB values read from the first 64KB stripe for my 3rd small file to be written ?

    This implies that the controller should:

    -be able to read a dedicated special value for a TRIMmed sector

    -be able to ignore writing those sectors while updating a RAID 0/1 stripe

    -be able to compute parity on those sectors

    ==> And please keep in mind that TRIMing is not a mandatory feature, it just helps the SSD Garbage collector in its erase work...most SSD has some reserved FREE space that makes this TRIM feature as an obsolete one"

  • 2. Re: The reason why trim is so hard to do with RAID
    Currently Being Moderated

    Above is true. However, TRIM is almost trivial to implement on RAID0 with stripe size of 512K (and multiplies).

    Therefore, if Intel desired, they could just require stripe size of 512K for SSD RAID0 TRIM.

  • 3. Re: The reason why trim is so hard to do with RAID
    PeterUK Community Member
    Currently Being Moderated

    Thats if block sizes are 512K but I have seen it listed as 128K and even 5K the smaller the erasure blocks the better and as time goes on it will likely get smaller. Also I think how trim works even more is that it tells the drive to delete from here to here but only the SSD knowns how many blocks can be erased as some blocks may have other data on them.

     

    Part 2 if TRIM could be done with RAID controllers.

     

    So if my above is even possible or correct what about different types of RAID controllers?

     

    As said on how it might be possible listing for Rapid Storage Technology which is more known to be a Software-based RAID or fake RAID which is good if TRIM could be done because its software...and that means just coding it in to support.

     

    But what about these true hardware RAID controllers? Well that may be a problem to support TRIM because they are set in stone to do what they do. Intel having some very nice RAID cards and customers that don't understand this will not be happy if TRIM can be done for RAID volumes for the Software-based RAID and not their Hardware-based RAID, so unless there is enough Hardware for Firmware to do it or a way for the driver to run through software then to the RAID controller...then none of the hardware RAID controllers we have to day will support TRIM in a RAID volume.

     

    ….all I can say is hardware RAID is dead...long live Software RAID.

More Like This

  • Retrieving data ...