00:00

Understanding File Systems and SSDs in Operating Systems

The provided text covers various aspects of file systems and solid-state drives (SSDs) in operating systems. It explores topics like rotational disks versus CPUs, the organization of SSDs, techniques used in file systems for optimizing I/O, and the performance differences between SSDs and hard disk drives (HDDs). Additionally, it delves into the characteristics of rotational disks, such as sector numbering, and the operations considered slow on such disks. The content also discusses the Flash Translation Layer (FTL) in SSDs and provides insights into file system structures like flat index, single extent, fixed number of extents, and linked blocks.

bouchama
Download Presentation

Understanding File Systems and SSDs in Operating Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. File Systems CPEN 331, UBC Alexandra Fedorova

  2. Rotational Disks

  3. How much slower are rotational disks relative to CPUs? A. 102 x B. 103 x C. 104 x D. 106 x E. 109 x Hint: think how many nanoseconds it takes to execute a CPU instruction and (roughly) how many nanoseconds it takes to read a byte of data from a rotational disk.

  4. Which operations are considered especially slow on rotational disks, according to the video? 1. Memory-mapped I/O 2. Reading track headers 3. Seek 4. Sequential reads A. All of the above B. 2 and 3 C. 4 and 4 D. 3 E. 1

  5. Random vs Sequential Access 100 times HIGHER throughput! Source: OSTEP, Ch.44, Fig. 44.4 http://pages.cs.wisc.edu/~remzi/OSTEP/file-ssd.pdf

  6. What is the common way to number sectors in a rotational disk? proceed inward proceed outward proceed downward 2 2 1 10 11 1 4 10 11 4 9 16 9 16 1 2 8 15 4 12 12 TOP OF THE PLATTER PLATTER 5 13 5 6 14 13 8 7 5 8 proceed downward 15 proceed downward 14 12 13 9 16 6 DISK 7 6 7 BOTTOM OF THE PLATTER 14 19 15 18 17 20 proceed inward 21 24 28 29 25 32 22 23 30 31 A B C Proceed downward: Number the sectors at the track on the top of the platter, then move to the bottom of the same platter and number sectors on the track at the same position as you just numbered. Proceed to the next platter and repeat the pattern. Proceed inward: given a platter and either the top or the bottom surface, you start with the outward track and number sectors there; then you move to the next track inward. Proceed outward: same as inward, but you begin with the innermost track.

  7. Sequential Writes in File Systems Take the Sequential Writes in File Systems quiz on Canvas. You are not allowed to use the Internet or chat with classmates •

  8. What techniques were used in file systems to ensure that most of our I/O is sequential?

  9. SSDs Flash-based Solid State Drives

  10. Overview • Built out of transistors (like DRAM) • E.g. NAND flash, but there are other technologies • No moving parts • Data is retained after power failure (unlike DRAM)

  11. SSD Organization: Blocks and Pages Erase blocks: 128K/256K in size Source: OSTEP, Ch.44, Fig. 44.1 http://pages.cs.wisc.edu/~remzi/OSTEP/file-ssd.pdf Pages: 4K in size To over-write the data in a single page, you have to • Read the entire block, • Erase it, and then • Write the new data If you write blocks a lot, they wear out

  12. Other properties of SSDs • Time to read a page: about 10 microseconds • Contrast this to a few milliseconds on HDD • No seek time • Time to erase a page: a few milliseconds • Time to write (program) a page: 100s of microseconds

  13. Re-writing pages Source: OSTEP, Ch.44, page 4 http://pages.cs.wisc.edu/~remzi/OSTEP/file-ssd.pdf Previously programmed pages Entire block erased Re-program page 0

  14. Sequence of operations on a page Source: OSTEP, Ch.44, page 3 http://pages.cs.wisc.edu/~remzi/OSTEP/file-ssd.pdf

  15. Flash Translation Layer (FTL) • Typically implemented inside the storage device • Maps logical blocks (that the OS uses) to physical blocks (that the device uses) • Gives the device flexibility with respect to where the blocks are written • Tries to spread writes across blocks to minimize wearing out certain blocks – wear leveling • Performs garbage collection – consolidates valid data into new blocks, frees blocks with invalid data.

  16. FTL Example These are logical block addresses that make sense to the file system. Initial state of the device: all pages are INVALID (i)

  17. FTL Example • FTL decided to write logical block 100 to logical page 00 • It must, therefore, erase physical block 0 • Then it can write the page

  18. FTL Example • Mapping table tells us how to translate logical blocks to physical blocks

  19. FTL Example • We write the remaining blocks into the device.

  20. FTL Example • Blocks 100 and 101 are written again with contents c1 and c2

  21. FTL Example: Garbage collection

  22. FTL Example: Garbage collection BEFORE GC AFTER GC

  23. Based of videos, what file system does FTL most resemble? A. FFS B. Ext4 C. Xfs D. LFS

  24. Performance: SSD vs HDD Source: OSTEP, Ch.44, Fig. 44.4 http://pages.cs.wisc.edu/~remzi/OSTEP/file-ssd.pdf

  25. Sequential vs Random access speed According to simple benchmarks • SSD drive • Throughput over time • Throughput drops when “garbage collection” begins. Source: Lies, Damn Lies And SSD Benchmark Test Results (Seagate) https://vpsmate.net/lies-damn-lies-ssd-benchmark-test-result1.html

  26. File system structure

  27. Name each FS structure. A) Index D) Index B) Index … … … C) Index …

  28. Name the file system structure: A Index A. Flat index B. Single extent C. Fixed number of extents D. Linked blocks E. Hybrid index

  29. Name the file system structure: B Index A. Flat index B. Single extent C. Fixed number of extents D. Linked blocks E. Hybrid index

  30. Name the file system structure: C A. Flat index B. Single extent C. Fixed number of extents D. Linked blocks E. Hybrid index Index …

  31. Name the file system structure: D A. Flat index B. Single extent C. Fixed number of extents D. Linked blocks E. Hybrid index Index … … …

  32. Exercise: Discuss the pros and cons of each file index structure A) Index D) Index B) Index … … … C) Index …

  33. Storage and Memory: Relative Performance

  34. New indexing structure: ctFS ctFS: Replacing File Indexing with Hardware Memory Translation through Contiguous File Allocation for Persistent Memory Authors: Ruibin Li, Xiang Ren, Xu Zhao, Siwei He, Michael Stumm, and Ding Yuan, University of Toronto

  35. Crash consistency

  36. Which rules help ensure crash consistency? 1. Keep several copies of metadata A. True B. False 2. Persist bitmap to disk every time it is updated A. True B. False 3. Keep several copies of inodes A. True B. False 4. Always write the data before you write the pointer to the data A. True B. False

  37. File system corruption Take the File system crash scenarios quiz on Canvas. You are not allowed to use the Internet or chat with classmates •

  38. What crash scenarios could lead to these conditions? • Directory entries that don’t point to valid files • Files without directory entries • Files containing disk blocks to which they have not written data. • Files not containing disk blocks to which they have written data. • Disk blocks allocated but still in free list • Disk blocks unallocated but NOT in free list

  39. Logging

  40. Where is logging used? • According to the videos, which file systems used logging? 1. All modern file systems 2. Ext4 3. Journaling file systems 4. LFS 5. FFS A. All of the above B. 5 C. 3 and 4 D. 2 and 3 E. None of the above

  41. What is the key rule in of write-ahead logging? A. It ensures correct ordering of writes to disk (e.g. upon file creation you write the inode first and then directory entry). B. It ensures that you keep track of dependencies in memory and then respect those dependencies when you write blocks. C. It ensures that the metadata is written before the data. D. It ensures that the log entry is written to disk before any corresponding data or metadata.

More Related