Garbage Collection and TRIM in SSDs Explained – An SSD Primer

DURAWRITE  AND THE TRIM COMMAND

 DuraWrite, found in LSI® SandForce® Flash Storage Processors, produces similar benefits to the TRIM command whether or not TRIM is present. And when TRIM is present, DuraWrite creates more free space on the SSD than would be possible otherwise. Figure 4 illustrates.

Figure 4: DuraWrite versus non-DuraWrite SSD Controllers and the TRIM command.

 In a standard SSD without DuraWrite (row 1 left), data pending deletion and the free space share the same space. There is less space available for GC, so the drive has to spend more time doing GC to efficiently use the available space. In a conventional SSD that supports TRIM (row 1 right), the data pending deletion becomes free space, and there is much more space available for GC. The more space available, the faster the SSD can write, so TRIM has a big impact on the SSD’s overall performance.

 In an SSD with DuraWrite technology (row 2 left), less data is physically written to the drive in the first place, so there is more free space available for GC. In fact, the amount of space available in a non-TRIM environment is comparable to the space available in a TRIM environment on a conventional SSD. Writing less data frees up more GC space and improves the performance of the SSD. In the DuraWrite drive with the TRIM command (row 2 right), there is a massive amount of space available for GC. However, having significant amounts of free space does not linearly improve the performance of the SSD, because there are other bottleneck points in place.

 There are many techniques used in the storage industry, such as data de-duplication, data compression, and data differencing. DuraWrite combines elements of these and similar technologies in order to reduce the amount of writes that must be passed through to the flash.

Therefore, an SSD with DuraWrite in a system that doesn’t support TRIM behaves much like a regular SSD that does support TRIM. It is also possible to use DuraWrite in a RAID environment and get the benefits of having the TRIM command without the RAID drivers having to support TRIM.

BACKGROUND VS FOREGROUND GARBAGE COLLECTION

The final question is when to perform GC. There is debate in the industry between doing background (or idle-time) GC, and foreground (or standard) GC.

It seems like a good idea to do GC in the background, when the host isn’t demanding something of the SSD. It seems reasonable to perform housekeeping like GC when the SSD isn’t otherwise busy, so it can be ready with optimized blocks when the OS writes a new file or changes a file.

However, there are two problems with this. First, background GC can potentially relocate all of the currently valid data on the SSD, when in fact some of that data may be invalid e.g., in temporary files, or may otherwise soon be deleted by the OS. If blocks with invalid data are garbage collected in the background, the SSD will be rewriting a lot of data that won’t be needed in a short time, directly leading to unnecessary wear on the SSD and reduced endurance.

Background GC is used primarily with SSDs whose write speed is slow, because it reduces the amount of GC that must be done in the foreground, and therefore allows the SSD to perform a bit faster during writes. That is until the incoming host data traffic catches up with the freed space from the background GC at which time is it forced to perform it real-time.

Foreground GC, on the other hand, results in data being rewritten only when the free space will be immediately needed. Foreground GC thus avoids performing GC on data that will soon be invalid, and it reduces overall wear on the drive. This requires an SSD that has very high write speeds. LSI SandForce Flash Storage Processors have an architecture that enables the fastest possible foreground GC.

The difference between background and foreground GC is less obvious in consumer-level drives where there tends to be a lot of idle time and endurance isn’t as critical, but it is more obvious in enterprise-class drives, where writes occur all the time and duty cycles are longer.

LSI SandForce Flash Storage Processors use optimized GC techniques, so they can perform foreground (or real-time) GC better than the other SSD controllers. If the SSD also writes less data overall with the DuraWrite technology, there is less data to rewrite during GC, and the SSD performs even better.

As we have seen, GC is a necessary function of all SSDs. The decisions to use foreground or background GC as well as the use of the TRIM command impact an SSD’s performance, write amplification, and endurance. These factors should be carefully considered when designing SSDs or selecting one for a computer system.

In case this article has reached you through one of the many search engines, we should mention that this is the third in our series of  SSD Primer articles meant to help us all along in our understand of solid state drives.

  1. BENEFITS OF A SOLID STATE DRIVE – AN SSD PRIMER
  2. SSD COMPONENTS AND MAKE UP – AN SSD PRIMER
  3. SSD TYPES AND FORM FACTORS – AN SSD PRIMER
  4. SSD ADVERTISED PERFORMANCE – AN SSD PRIMER
  5. SSD MIGRATION OR FRESH INSTALL – AN SSD PRIMER
  6. GC AND TRIM IN SSDS EXPLAINED – AN SSD PRIMER

 

User Rating: 4.39 ( 6 votes)

47
Leave a Reply

avatar
21 Comment threads
26 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
21 Comment authors
SajuttangskibumLocodocoKen Schleedepm015c7700_4 Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Paulalcorn
Guest
Paulalcorn

wow what a great resource, excellent work Kent, and thanks for contributing!

Kent Smith
Guest

Can I say thank you 2 years after the fact? 🙂

Doug Crowthers
Guest

Great article Les… I have added it to my running thread of “Useful SSD Articles” over at Tom’s Hardware (which included the other four SSD Primers).

http://www.tomshardware.com/forum/270102-32-useful-articles-part

The Muss
Guest
The Muss

.. That was useful. Thanks

Crunch
Guest

While I agree that it is a good and informative article, let’s remember that this is written by someone who is biased and is not completely impartial. Kent works for LSI, which makes SandForce controllers, which are the controllers (the only controllers) that use DuraWrite technology.

He tells us how TRIM works in great detail, but offers next to nothing about when and how DuraWrite optimizes an SSD. This is probably because he cannot or will not let anyone in on the technical aspects of DuraWrite, his company’s proprietary technology.

Kent Smith
Guest

I certainly would not want people to think that my TRIM explanation has any bias, so I will be as transparent as I can here. I think you do agree that the TRIM details here are pretty clear and I should reiterate that the explanation of its operation is orthogonal to DuraWrite data reduction technology.

If you want more information on DuraWrite, I do mention it in at least six of my blog posts http://blog.lsi.com/tag/durawrite/ and a few of them get into some details explaining how TRIM and DuraWrite will both help the performance of an SSD.

Miggins
Guest
Miggins

Les, I have an Intel 520/240GB and it frequently dumps about 20 x 1024KB “Intel_Trim_File” files in my SSD root directory. Do you know what these are and why they are there and SHOULD they be there? Thanks

Les@TheSSDReview
Guest

I don’t know where these are and it is definitely odd. My suggestion is to hit our Forums and get the experts there to assist you with this!

SSD QUICK SEARCH