20100425 linux trim

Preview:

Citation preview

Linux TRIM Support for SSDs

  

Bergwolf@linuxfb.org

Index

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

What is SSD?

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

What is SSD?

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

What is TRIM?

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

Why TRIM for SSDs

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

as a side effect of ongoing writes

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.

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

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

Thank You~~~

Recommended