SSD Garbage Collection

garbage cansOne of the thorniest issues in SSD design how to manage erasing blocks that are no longer in use.  That’s saying a lot, because NAND flash presents so very many difficult challenges like wear leveling, bad block management, error correction, and write amplification.

The difficulty stems from the fact that all of today’s software was written for HDDs which don’t behave like the flash in an SSD.  An HDD can over-write existing data with new data.  In a flash SSD, a block must be erased before being over-written and this can take a half a second – a huge amount of time in the world of computing.  Since the software doesn’t accommodate flash’s “erase-before-write” needs, the controller inside the SSD must take care of this bit of housekeeping.  Unused and unerased blocks are moved out of the way and erased in the background.  This is called the “garbage collection” process.

Most SSD controller makers carefully guard their garbage collection algorithms under a veil of secrecy.  These techniques are an important part of the differentiation between suppliers.  One thing that is common to nearly all SSDs is the use of over provisioning to help with this process.  More flash resides within the SSD than is available to the user – a 64GB SSD may actually contain 80GB of internal NAND, but only 64GB is visible to the user.  The other 16GB provides an area that can be used for background processes.

The SSD controller moves unerased blocks that are no longer in use to this pool of reserve flash.  A background task erases these blocks without getting in the way of standard disk operation.  In most cases there is enough extra flash to ensure that the slow erases will not cause the SSD to run out of erased blocks.

A difficulty arises when the pool of spares backs up.  In certain very extreme cases this becomes a problem and the entire SSD is forced to wait until a block’s erase cycle is complete.

Another post explains the ATA “Trim” command that helps SSDs identify which blocks can be erased.

We expect to hear a lot more about this issue before it is resolved.  Nonetheless, most current garbage collection algorithms perform well enough for today’s applications, and we do not anticipate its getting in the way of the 148% unit growth that Objective Analysis projects in our reports covering the enterprise SSD market.

4 Responses to SSD Garbage Collection

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.