Samsung 840 White Paper page 17

Samsung solid state drive white paper
Hide thumbs Also See for 840:
Table of Contents

Advertisement

04
Understanding SSDs
A Peek Behind the Curtain
Writing and Erasing NAND
Before we can understand the various maintenance algorithms that the
controller employs to keep your SSD neat and tidy, we need to understand a
few basics about how we read and write data to a NAND chip. Data is stored in
a unit called a "page," which is finite in size and can only be written to when
it is empty. Therefore, in order to write to a page that already contains data,
it must first be erased. This would be a simple process, except each page
belongs to a group of pages collectively known as a "block." While data is
written in pages, it can only be erased in blocks. To help illustrate the concept
of pages and blocks, let's use an analogy. Think of the Etch-A-Sketch toys
many of us used as children. You could continue drawing on the screen until
it was full – think of each artistic flourish you add to the canvas as a separate
"page" and the total canvas as the "block" that all of the pages exist in – but when you wanted to erase something,
you had to shake the toy and erase everything at once. Extending this thought process, there would be many Etch-A-
Sketches inside each NAND chip. This restriction obviously has great implications for how the controller manages the
NAND flash that stores your data.
Performance Over Time
With the above limitations in mind, let's look at what would happen if we wanted to re-use a page that contained old
data. If the SSD wanted to reuse an existing, no longer valid page, the other (valid) pages in the block would have to be
copied into an empty NAND cell while the entire block was erased. The SSD would then rewrite the entire set of valid
data, old and new, to the intended cell. This process is complex and time-consuming. Thus, the SSD controller avoids
directly "overwriting" existing data in favor of working some magic through the Flash Translation Layer (FTL), a special
mechanism that helps coordinate communication between the NAND flash and the host system. Utilizing the FTL,
SSDs implement a logical to physical mapping system called Logical Block Addressing (LBA). Physical NAND writes are
not required to correspond directly to the space the host system requests. Instead of performing all of the unnecessary
copies described above to overwrite a piece of old data, the SSD writes the new data to the next available page and simply
marks the old data as "invalid."
In reality, the technique just described only delays the inevitable – at some point the SSD will suffer some sort of
performance deficit regardless of whether or not it has to perform the complex overwrite procedure above. Let's think
of what happens when the drive is full. As an SSD is filled with more and more data, there will naturally be fewer free
blocks readily available. The SSD is then forced to actively consolidate valid data and prepare free blocks in order to write
new data and perform maintenance. This process of moving and consolidating data takes time, which is perceived as
decreased performance, and requires free space. This is why Over Provisioning, which guarantees a certain amount of
free swap space to use for Garbage Collection and other maintenance activities, is so important for SSD performance – it
allows the Garbage Collection algorithm to prepare free space in advance through data consolidation.
While an SSD might look like a simple device on the surface, there is a great deal
of complexity behind the scenes. In order to ensure that your SSD stays in prime
working condition, the SSD controller must manage complex performance and
lifetime optimization algorithms. To facilitate an understanding of why the design and
implementation of these algorithms is so crucial to your SSD experience, it is necessary to
understand the limitations of NAND technology and what exactly is going on behind the
scenes to compensate for them.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents