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.56 ( 4 votes)
SSD QUICK SEARCH