programming interfaces to non vola4le memory
play

Programming Interfaces to Non-Vola4le Memory Michael Swi: - PowerPoint PPT Presentation

Programming Interfaces to Non-Vola4le Memory Michael Swi: University of WisconsinMadison Outline NVM solid-state drives Persistent memory file systems


  1. Programming ¡Interfaces ¡to ¡ Non-­‑Vola4le ¡Memory ¡ Michael ¡Swi: ¡ University ¡of ¡Wisconsin—Madison ¡

  2. Outline ¡ • NVM ¡solid-­‑state ¡drives ¡ • Persistent ¡memory ¡file ¡systems ¡ • Persistent ¡Regions ¡ • Persistent ¡data ¡stores ¡ 2 ¡

  3. SNIA ¡Model ¡ • NVM ¡block ¡mode: ¡NVM-­‑aIached ¡devices ¡ – Legacy ¡or ¡enhanced ¡file ¡system ¡ • Persistent ¡Memory ¡Volume: ¡RAM ¡disk ¡ – Raw ¡access ¡to ¡PM ¡from ¡kernel ¡ – Legacy ¡file ¡system ¡ • Persistent ¡Memory ¡File ¡System: ¡PMFS, ¡SCMFS, ¡BPFS ¡ – File ¡system ¡tuned ¡for ¡NVM ¡proper4es ¡ • Persistent ¡memory: ¡NV-­‑Heaps, ¡Mnemosyne, ¡CDDS ¡ – Load-­‑store ¡access ¡from ¡user ¡mode ¡ [Rudoff ¡;login’13] ¡ 3 ¡

  4. Modes ¡of ¡NVM ¡Use ¡ Mode ¡ Programming ¡Interface ¡ NVM ¡Accessibility ¡ NVM ¡block ¡ Read/write ¡block ¡ Kernel, ¡User ¡ PM ¡Block ¡ Read/write ¡block, ¡byte ¡ Kernel ¡ PM ¡File ¡ Open, ¡read, ¡write ¡file ¡ Kernel ¡ PM ¡ Load, ¡store ¡ User ¡ 4 ¡

  5. NVM ¡as ¡SSD ¡ App ¡ App ¡ System ¡call ¡interface ¡ VFS ¡ NVM ¡FS ¡ Disk ¡FS ¡ ~Const. ¡latency ¡to ¡NVM ¡ Variable ¡latency ¡to ¡disk ¡ Generic ¡Block ¡layer ¡ I/O ¡Scheduler ¡ Device ¡Driver ¡ Device ¡Driver ¡ I/O ¡Bus ¡ 5 ¡

  6. Devices: ¡NVM-­‑based ¡SSDs ¡ • Challenges ¡ – Hardware ¡interface ¡ – So:ware ¡latency ¡ – Protec4on ¡and ¡user-­‑mode ¡access ¡ • Examples: ¡ – Moneta-­‑D ¡ – NVMExpress ¡ 6 ¡

  7. NVM ¡SSD ¡Challenges ¡ • 25 Hardware costs – PCM • So:ware ¡overheads ¡in ¡ 20 – Ring kernel ¡ DMA Latency (us) 15 Wait Interrupt 10 Issue Copy 5 Schedule OS/User 0 Base [Caulfield, ¡SC’10] ¡ 7 ¡

  8. OS ¡Scheduling ¡Overhead ¡ • 25 er than PCM Ring • I/O ¡scheduling ¡ 20 DMA – • Locking ¡ Latency (us) Wait 15 – Interrupt • Interrupts ¡and ¡wai4ng ¡ Issue 10 Copy • • Example: ¡Moneta ¡ 5 Schedule – OS/User [MICRO’10] ¡ – 0 [Caulfield, ¡SC’10] ¡ 8 ¡

  9. NVM ¡Express ¡ • • • • All ¡parameters ¡for ¡4KB ¡command ¡in ¡single ¡64B ¡DMA ¡ • fetch ¡ ¡ • Deep ¡queues ¡(64K ¡commands ¡/queue, ¡u64K ¡queues) ¡ ¡ • 3 ¡μs ¡latency: ¡no ¡cached ¡I/O ¡reads ¡ • 9 ¡ e) Intel ¡IDF ¡‘12 ¡

  10. NVMexpress ¡Opera4on ¡ NVMe Command Execution 7 1 1) Queue Command(s) 2) Ring Doorbell (New Tail) 3) Fetch Command(s) 4) Process Command 5) Queue Completion(s) 2 8 6) Generate Interrupt 7) Process Completion PCIe TLP PCIe TLP PCIe TLP PCIe TLP PCIe TLP PCIe TLP PCIe TLP 8) Ring Doorbell (New PCIe TLP Head) 6 3 4 5 10 ¡ Intel ¡IDF ¡‘12 ¡

  11. User-­‑mode ¡Data ¡Access ¡ • Challenge: ¡metadata, ¡I/O ¡Latency ¡ Device ¡Driver ¡ App ¡ App ¡ System ¡call ¡interface ¡ VFS ¡ NVM ¡FS ¡ Generic ¡Block ¡layer ¡ Device ¡Driver ¡ I/O ¡Bus ¡ 11 ¡

  12. Remove ¡FS ¡Overhead ¡ Latency ¡Improvement ¡ • Metadata ¡calls ¡s4ll ¡in ¡ 20 ¡ kernel ¡ 18 ¡ 16 ¡ • Kernel ¡grants ¡program ¡ 14 ¡ Latency ¡us ¡ access ¡to ¡ data ¡ 12 ¡ • Program ¡issues ¡DMA ¡ 10 ¡ 8 ¡ directly ¡to ¡device ¡ 6 ¡ • Example: ¡Moneta-­‑D ¡ 4 ¡ [ASPLOS’12] ¡ 2 ¡ 0 ¡ Kernel ¡FS ¡ User ¡Direct ¡ [Caulfield, ¡ASPLOS’12] ¡ 12 ¡

  13. Outline ¡ • NVM ¡solid-­‑state ¡drives ¡ • Persistent ¡memory ¡file ¡systems ¡ • Persistent ¡Regions ¡ • Persistent ¡data ¡stores ¡ 13 ¡

  14. NVM ¡in ¡the ¡PC ¡ • NVM ¡and ¡DRAM ¡are ¡ L1 addressable ¡by ¡the ¡CPU ¡ L2 Memory ¡bus • Physical ¡address ¡space ¡is ¡ DRAM NVM par;;oned ¡ PCI/IDE ¡bus • NVM ¡data ¡may ¡be ¡ cached ¡ HD / Flash in ¡L1/L2 ¡ [Condit, ¡SOSP’09] ¡ 14 ¡

  15. Direct ¡VS ¡Peripheral ¡Access ¡ App ¡ App ¡ System ¡call ¡interface ¡ VFS ¡ NVM ¡FS ¡ Disk ¡FS ¡ ~Const. ¡latency ¡to ¡NVM ¡ Variable ¡latency ¡to ¡disk ¡ Generic ¡Block ¡layer ¡ I/O ¡Scheduler ¡ Device ¡Driver ¡ Device ¡Driver ¡ Load/store ¡interface ¡ No ¡standard ¡interface ¡ I/O ¡Bus ¡ CPU ¡access ¡protected ¡ by ¡VM ¡ DMA ¡not ¡protected ¡ ¡ 15 ¡

  16. Op4on ¡1: ¡NVM ¡Disks ¡ • Design: ¡ – Small ¡block ¡driver ¡exposes ¡regions ¡of ¡NVM ¡as ¡a ¡ block ¡devices ¡ – Use ¡unmodifed ¡file ¡systems ¡ • Issues: ¡ – Performance ¡ • Example: ¡ ¡ – Light ¡VM ¡ 16 ¡

  17. Op4on ¡2: ¡NVM ¡File ¡systems ¡ • Issues: ¡ – Consistency ¡and ¡Durability ¡ – Memory ¡copies ¡ • BPFS ¡ • PMFS ¡ • Aerie ¡ 17 ¡

  18. Memory-­‑Mapped ¡File ¡System ¡ • All ¡file ¡data ¡available ¡ Logical ¡View ¡ through ¡memory ¡ • I/O ¡opera4ons ¡become ¡ So:ware ¡ loads/stores ¡ / ¡ bob ¡ alice ¡ shared ¡ • Example: ¡BPFS ¡from ¡ MSR ¡[SOSP’09] ¡ HW ¡ / ¡ bob ¡ alice ¡ shared ¡ NVM ¡ 18 ¡

  19. BPFS: ¡A ¡NVM ¡File ¡System ¡ • New ¡feature: ¡Guarantees ¡that ¡all ¡file ¡ opera4ons ¡execute ¡atomically ¡and ¡in ¡program ¡ order ¡ • BeIer ¡performance ¡than ¡disk-­‑based ¡on ¡NVM ¡ disk ¡ • Short-­‑circuit ¡shadow ¡paging ¡o:en ¡allows ¡ atomic, ¡in-­‑place ¡updates ¡ [Condit, ¡SOSP’09] ¡ 19 ¡

  20. BPFS: ¡A ¡NVM ¡File ¡System ¡ root ¡pointer ¡ inode ¡ indirect ¡blocks ¡ file ¡ inodes ¡ file ¡ directory ¡ file ¡ 20 ¡

  21. Enforcing ¡FS ¡Consistency ¡Guarantees ¡ • What ¡happens ¡if ¡we ¡crash ¡during ¡an ¡update? ¡ – Disk: ¡Use ¡journaling ¡or ¡shadow ¡paging ¡ – NVM: ¡Use ¡short-­‑circuit ¡shadow ¡paging ¡ 21 ¡

  22. Review ¡1: ¡Journaling ¡ • Write ¡to ¡journal, ¡then ¡write ¡to ¡file ¡system ¡ file ¡system ¡ A’ ¡ A ¡ B’ ¡ B ¡ journal ¡ A’ ¡ B’ ¡ • Reliable, ¡but ¡all ¡data ¡is ¡wriIen ¡twice ¡ 22 ¡

  23. Review ¡2: ¡Shadow ¡Paging ¡ • Use ¡copy-­‑on-­‑write ¡up ¡to ¡root ¡of ¡file ¡system ¡ file’s ¡root ¡pointer ¡ A ¡ B ¡ A’ ¡ B’ ¡ • Any ¡change ¡requires ¡bubbling ¡to ¡the ¡FS ¡root ¡ • Small ¡writes ¡require ¡large ¡copying ¡overhead ¡ 23 ¡

  24. Short-­‑Circuit ¡Shadow ¡Paging ¡ • Inspired ¡by ¡shadow ¡paging ¡ – Op4miza4on: ¡In-­‑place ¡update ¡when ¡possible ¡ 24 ¡

  25. Short-­‑Circuit ¡Shadow ¡Paging ¡ • Inspired ¡by ¡shadow ¡paging ¡ – Op4miza4on: ¡In-­‑place ¡update ¡when ¡possible ¡ file’s ¡root ¡pointer ¡ A ¡ B ¡ A’ ¡ B’ ¡ • Uses ¡byte-­‑addressability ¡and ¡atomic ¡64b ¡writes ¡ 25 ¡

  26. Opt. ¡1: ¡In-­‑Place ¡Writes ¡ • Aligned ¡64-­‑bit ¡writes ¡are ¡performed ¡in ¡place ¡ – Data ¡and ¡metadata ¡ file’s ¡root ¡pointer ¡ in-­‑place ¡write ¡ 26 ¡

  27. Opt. ¡2: ¡Exploit ¡Data-­‑Metadata ¡ Invariants ¡ • Appends ¡commiIed ¡by ¡upda4ng ¡file ¡size ¡ file’s ¡root ¡pointer ¡+ ¡size ¡ file ¡size ¡update ¡ in-­‑place ¡append ¡ 27 ¡

  28. BPFS ¡Example ¡ root ¡pointer ¡ inode ¡ indirect ¡blocks ¡ file ¡ inodes ¡ add ¡entry ¡ remove ¡entry ¡ directory ¡ directory ¡ file ¡ • Cross-­‑directory ¡rename ¡bubbles ¡to ¡common ¡ ancestor ¡ 28 ¡

  29. Cache ¡Op4miza4on ¡ L1 • Replace ¡DRAM ¡cache ¡ with ¡processor ¡L1/L2 ¡ L2 cache ¡ Memory ¡bus • Data ¡persists ¡as ¡soon ¡as ¡ NVM DRAM it ¡hits ¡NVM ¡ PCI/IDE ¡bus HD / Flash Ø Need ¡to ¡control ¡order ¡ of ¡cache ¡evic4ons ¡ 29 ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend