SSD Theory Flashcards

1
Q

List some general characteristics of solid-state storage devices

A

There are no mechanical or moving parts like HDD

Retain information despite power loss unlike typical RAM

Uses traditional hard disk drive interfaces and form factors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the relationship between the amount of bits a cell can store, the voltage, and the performance and durability?

A

In flash memory, the cells are the fundamental storage units that hold bits of data. Flash memory cells can be broadly categorized based on the number of bits they store:

  1. Single-Level Cell (SLC):
    • Stores 1 bit per cell.
    • Advantages: Higher speed, greater endurance (higher number of write/erase cycles), and better reliability.
    • Disadvantages: Lower storage density and higher cost per bit.
  2. Multi-Level Cell (MLC):
    • Stores 2 bits per cell.
    • Advantages: Higher storage density and lower cost per bit compared to SLC.
    • Disadvantages: Lower speed, reduced endurance, and decreased reliability compared to SLC.
  3. Triple-Level Cell (TLC):
    • Stores 3 bits per cell.
    • Advantages: Even higher storage density and lower cost per bit compared to MLC.
    • Disadvantages: Further reduced speed, endurance, and reliability compared to MLC.
  4. Quad-Level Cell (QLC):
    • Stores 4 bits per cell.
    • Advantages: Maximum storage density and lowest cost per bit among the common types.
    • Disadvantages: Lowest speed, endurance, and reliability among the common types.

These flash memory cells work by trapping electrons in a floating gate transistor to represent different voltage levels corresponding to different bit values. The more bits a cell stores, the more precise the voltage levels must be, leading to trade-offs in performance and durability.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How is a NAND flash organized

A

NAND flash memory is organized in a hierarchical structure to optimize storage density and performance. The main components of this organization include cells, strings, pages, blocks, planes, and the overall memory array. Here’s a detailed breakdown:

  • Cell: The basic unit of NAND flash memory, storing one or more bits of data (SLC, MLC, TLC, QLC).
  • String: A series of cells connected in a sequence. Each string has a bit line on one end and a source line on the other.
  • Page: A group of cells that can be read or programmed (written) simultaneously. Pages are the smallest unit of data that can be read or written.
  • Size: Pages typically range from 2 KB to 16 KB.
  • Block: A larger unit composed of multiple pages. Blocks are the smallest unit that can be erased in NAND flash memory.
  • Size: A block usually contains 64 to 256 pages.
  • Plane: A collection of blocks. Multiple planes are organized within a NAND flash die to allow parallel operations and improve performance.
  • Size: Each plane may contain several thousand blocks.

To illustrate, consider a typical NAND flash memory organization:

  1. Cell Level: Each cell stores bits of data.
  2. String Level: 32 or 64 cells connected in series form a string.
  3. Page Level: 128 strings grouped together form a page (e.g., 8 KB per page).
  4. Block Level: 128 pages grouped together form a block (e.g., 1 MB per block).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the smallest units that can be erased in SSD

A

Blocks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the smallest unit that can be read/written in SSD’s

A

Pages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the possible stages a page can be?

A

Empty (or erased): do not contain data

Dirty (or invalid): Data is no longer in use

In use (or valid): things that can be actually read

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is right amplification and what are its impacts on the work of the SSD?

A

Write amplification is a phenomenon that occurs in solid-state drives (SSDs) where the amount of data physically written to the flash memory is greater than the amount of data logically written by the host system. This issue arises due to the nature of how SSDs manage data at the block and page level, impacting the drive’s performance and lifespan.

Impact on Write Amplification**:
- Write amplification is the ratio of the actual amount of data written to the NAND flash memory to the amount of data intended to be written by the host.
- For example, if 1 GB of data is written by the host, but 3 GB of writes are performed internally by the SSD due to garbage collection, the write amplification factor is 3.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Detail the causes of the right amplification in SSD

A
  1. Flash Memory Structure:
    • SSDs use NAND flash memory, which is organized into blocks and pages.
    • Data can be written to pages, but a page must be erased before it can be rewritten, and erasing can only be done at the block level.
  2. Data Management:
    • When data is written to an SSD, it is first written to a clean (erased) page.
    • If the same data needs to be updated or rewritten, it cannot overwrite the old data in the same page. Instead, the new data is written to a new page, and the old page is marked as invalid.
  3. Garbage Collection:
    • Over time, as more data is written and updated, the SSD accumulates invalid pages.
    • To reclaim space, the SSD performs garbage collection, where valid data from partially filled blocks is copied to new locations, and the old blocks are erased.
    • This process can involve copying more data than was originally written, leading to additional write operations.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are possible mitigation techniques for the write amplifications in SSD

A
  1. Mitigation Techniques:
    • Over-Provisioning: Allocating extra space that is not visible to the host to provide more room for garbage collection and wear leveling.
    • Efficient Garbage Collection Algorithms: Designing algorithms to minimize the amount of data movement during garbage collection.
    • Wear Leveling: Distributing write and erase cycles evenly across the memory cells to prevent certain cells from wearing out prematurely.
    • TRIM Command: Allowing the operating system to inform the SSD about blocks of data that are no longer in use, helping the SSD manage free space more effectively.

Understanding and mitigating write amplification is crucial for optimizing SSD performance and longevity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the consequences of writing amplifications for the SSD performance and durability?

A
  1. Consequences:
    • Performance: Increased write operations can slow down the SSD as it spends more time on internal management tasks.
    • Endurance: Flash memory cells have a limited number of write/erase cycles. Higher write amplification accelerates wear, reducing the SSD’s lifespan
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Hypothetical SSD:
§ Page Size: 4KB
§ Block Size: 5 Pages
§ Drive Size: 1 Block
§ Read Speed: 2 KB/s
§ Write Speed: 1 KB/s

Op 1. Lets write a 4Kb text file to the brand new SSD

Op 2. Now lets write a 8Kb pic file to the almost brand new SSD, thankfully there’s space

Op 3. Finally, let’s write a 12kb pic to the SSD (txt file in the first page is not more needed)

A

Writing times:

Op 1: 4 seconds!
Op 2: 8 seconds
Op 3: 24 seconds

Solution:

Step 1: Read block into cache
žStep 2: Delete page from cache
Step 3: Write new pic into cache ž
Step 4: ERASE the old block on SSD ž Step 5: Write cache to SSD

The OS only thought it was writing 12 KBs of data when in fact the SSD had to read 8 KBs (2 KB/s) and then write 20KBs (1 KB/s), the entire block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the FTL component in an SSD

A

The Flash Translation Layer (FTL) is a critical component in a solid-state drive (SSD) that manages the complexities of flash memory. Flash memory has specific characteristics, such as the inability to overwrite existing data without an erase operation and the requirement to erase data in large blocks. The FTL serves as an abstraction layer between the host system (which views the SSD as a simple block device like a hard drive) and the underlying NAND flash memory, handling the intricacies of data management.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the functions of the FTL component?

A
  1. Logical to Physical Address Mapping:
    • The FTL maintains a mapping table that translates logical block addresses (LBAs), which the host system uses to read and write data, to physical addresses in the NAND flash memory.
    • This mapping allows the SSD to present itself as a traditional block storage device to the host.
    1. Wear Leveling:
      • Flash memory cells have a limited number of write/erase cycles. Wear leveling algorithms in the FTL ensure that write and erase operations are distributed evenly across all memory cells, preventing premature wear of specific cells.
      • There are two types of wear leveling: dynamic and static. Dynamic wear leveling focuses on recently written data, while static wear leveling also relocates infrequently accessed data to ensure even wear.
    2. Garbage Collection:
      • When data is updated or deleted, invalid pages accumulate in the flash memory. The FTL includes garbage collection algorithms that consolidate valid data from partially filled blocks and erase blocks containing invalid data, freeing up space for future writes.
      • Efficient garbage collection minimizes write amplification, improving performance and extending the lifespan of the SSD.
    3. TRIM Command Support:
      • The FTL supports the TRIM command, which allows the operating system to inform the SSD about which blocks of data are no longer in use.
      • This helps the FTL manage free space more efficiently, improving performance and reducing write amplification.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is garbage collection and the two possible different cases it faces

A

It is the process of finding garbage blocks and reclaiming them

It can process a full garbage block, which is a simpler alternative, or, in a more complex case, partial blocks, in this case he needs to find a suitable partial block copy no garbage pages reclaim ((erase)) the entire block for writing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Assume that a page size is 4 Kbyte and a block consists of four pages.

• Write(pageNumber, value)
§ Write(100, a1)
§ Write(101, a2)
§ Write(2000, b1)
§ Write(2001, b2)
§ Write(100, c1)
§ Write(101, c2)

• The initial state is with all pages marked INVALID(i)

What are the steps taken by the SSD?

A

See the picture 1S in the Comp Infra album

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How would the garbage collection works in the A and B blocks in the picture 2 in the Comp Infra album?

A

See picture 2S in the Comp Infra album

17
Q

What is the drawback of the garbage collection and why it happens

A

Garbage collection is expensive, requires reading and rewriting off live data

18
Q

What are the solutions to alleviate the garbage collection problem?

A

Over provision the device by adding extra flash capacity

Run the garbage collection in the background using less busy periods for the disc.

19
Q

What is the problem TRIM solves

A

Due to the fact that most file systems do not actually delete data, some pages in a block may not be appropriately flagged as invalid what makes the garbage collection waste effort on copy useless pages

TRIM command allows the OS to tell the SSD that a specific LBA (Logical block address) is invalid and may be garbage collected

20
Q

What is a drawback of the FTL mapping, and what can be done to mitigated it?

A

The size of page level mapping table is too large

Some approaches to reduce the cost of mapping are: block based mapping, hybrid mapping, page mapping plus cashing

21
Q

What mapping at Block granularity means

A

Mapping at block granularity in an SSD involves maintaining a translation layer that maps logical block addresses (LBAs) to physical block addresses (PBAs). While this approach simplifies some aspects of address translation and can reduce the size of the mapping table, it also introduces several significant problems

22
Q

What are the problems introduced by mapping at Block and granularity

A
  1. Write Amplification:
    • Block granularity mapping can lead to higher write amplification. When updating a small portion of a block, the entire block must be read, modified, and rewritten because NAND flash memory must be erased at the block level. This results in more data being written than the actual amount of user data modified.
    • For instance, if a block is 128 KB and only 4 KB of data changes, the SSD still has to rewrite the entire 128 KB block, causing unnecessary wear and reducing efficiency.
    1. Garbage Collection Overhead:
      • Block-level mapping increases the overhead of garbage collection. Since data is managed at the block level, invalid data spread across multiple pages within a block cannot be erased until all valid data is relocated. This process is inefficient and time-consuming.
      • Frequent garbage collection operations due to block-level mapping can degrade SSD performance and increase latency.
    2. Reduced Performance:
      • The process of reading, modifying, and writing entire blocks for small updates can significantly slow down the SSD, especially under random write workloads. This reduced performance can impact overall system responsiveness.
      • Additionally, garbage collection triggered by block-level mapping can cause additional delays, further impacting performance.
23
Q

How many tables does FTL maintains when using the hybrid mapping technique?

A

Two tables, log blocks, page mapped, and data blocks, block mapped

24
Q

What is wear leveling?

A

Wear leveling is a crucial technique used in solid-state drives (SSDs) to ensure that the NAND flash memory cells are used evenly over the lifespan of the drive. Because flash memory cells have a limited number of write/erase cycles, uneven usage can lead to premature failure of certain cells while others remain relatively unused. Wear leveling mitigates this by distributing write and erase operations uniformly across all memory cells.

25
Q

How does wear leveling works?

A
  1. Tracking Block Usage:
    • The SSD maintains a table that tracks the number of write/erase cycles each block has undergone. This allows the controller to identify which blocks are more worn than others.
    1. Selecting Blocks for Writing:
      • When a write operation is needed, the controller selects blocks with the fewest write/erase cycles to minimize the disparity in wear levels across the drive.
    2. Relocating Data:
      • For static wear leveling, the controller occasionally relocates data from blocks that have been written to less frequently to those with higher cycle counts. This process is done in the background to minimize the impact on performance.
    3. Garbage Collection:
      • The wear leveling process is often integrated with garbage collection, which consolidates valid data from partially used blocks into fewer blocks, freeing up space and allowing for even wear distribution
26
Q

What are the benefits and disadvantages of wear leveling?

A

Benefits of Wear Leveling

1.	Extended Lifespan:
•	By ensuring that all memory cells are used evenly, wear leveling significantly extends the overall lifespan of the SSD, preventing early failure of frequently used blocks.
2.	Enhanced Reliability:
•	More uniform usage of flash memory cells increases the reliability of the SSD, as no single part of the drive becomes a failure point due to excessive wear.
3.	Improved Performance:
•	While wear leveling can introduce some overhead, effective wear leveling algorithms minimize performance impacts by performing these operations intelligently and often in the background.

Challenges and Considerations

1.	Algorithm Complexity:
•	Implementing effective wear leveling requires sophisticated algorithms to balance wear leveling with performance and other tasks like garbage collection and data integrity checks.
2.	Over-Provisioning:
•	SSDs often include extra storage capacity (over-provisioning) to aid in wear leveling and other maintenance tasks. This hidden storage helps manage write amplification and extends the drive’s lifespan.
3.	Performance Impact:
•	While wear leveling improves durability, the process of moving data can introduce latency. High-end SSDs use advanced controllers and firmware to minimize this impact.