10
Linux TRIM Support for SSDs [email protected]

20100425 linux trim

Embed Size (px)

Citation preview

Page 1: 20100425 linux trim

Linux TRIM Support for SSDs

  

[email protected]

Page 2: 20100425 linux trim

Index

• What is SSD?• What is TRIM?• Why TRIM for SSDs?• State of Art

Page 3: 20100425 linux trim

What is SSD?

• Solid State Drive• NAND based. SATA/PCI interface. • Compatible write, excellent read performance• High price

Page 4: 20100425 linux trim

What is SSD?

• FTL (Flash Translation Layer)• Wear-leveling• Write-gathering • Disks are dead! Long live Flash!

Page 5: 20100425 linux trim

What is TRIM?

• A ATA command• Discard• Tells which blocks can be deleted

Page 6: 20100425 linux trim

Why TRIM for SSDs

• Log-structured filesystem inside SSDs• Best performance comes when empty segments are created

as a side effect of ongoing writes

Page 7: 20100425 linux trim

State of Art

• TRIM is designed as a non-queued command. The block driver must clear the cmd queue before sending a TRIM cmd and should wait TRIM to complete before sending subsequent cmd.

• Same effect as an io barrier.• Delays of hundreds of milliseconds per TRIM.

Page 8: 20100425 linux trim

State of Art

• Ext4 impl (patch available)• ioctl based batched trim• Walk through all free extents in each allocating group and

discard those extents• Users can specify the minimal length of extents to be

trimmed

Page 9: 20100425 linux trim

State of Art

• Linux kernel Batched discard

• FS level (proposal): use a rbtree to track deleted blocks and send it down after collapsing neighbor blocks

• Lvm level (proposal): mdraid tracks all used/trimmed blocks • Block level (proposal): have a discard management layer• App level (impl): hdparm creates a large file, map it to blocks

and discard them

Page 10: 20100425 linux trim

Thank You~~~