1 / 17

Log-Structured File System (LFS)

Log-Structured File System (LFS). 6.033 Review Session May 19, 2014. Background. Problem: Sequential HD access is cheap, random access is expensive (true in 1991 and today) Standard UNIX file system does lots of random access for small file writes (small reads OK due to caching) Solution:

brigit
Download Presentation

Log-Structured File System (LFS)

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. Log-Structured File System(LFS) 6.033 Review Session May 19, 2014

  2. Background • Problem: • Sequential HD access is cheap, random access is expensive (true in 1991 and today) • Standard UNIX file system does lots of random access for small file writes (small reads OK due to caching) • Solution: • Design a new kind of file system that always writes data sequentially at the “end” of the disk

  3. Data Structures in LFS Same as in UNIX File System • Superblock (fixed position on disk) • Inode • Blocks containing file data or directory listings • Indirect Block Used to Maintain Log Structure • Inode map (replaces the “itable”/“inode table” in the UNIX FS; no longer in a fixed position on disk) Used to optimize cleaning • Segment summary • Segment usage table Used to handle crash recovery • Checkpoint region (fixed position on disk, incl. pointers to inode map blocks) • Directory change log

  4. Data Structures in LFS Same as in UNIX File System • Superblock (fixed position on disk) • Inode • Blocks containing file data or directory listings • Indirect Block Used to Maintain Log Structure • Inode map (replaces the “itable”/“inode table” in the UNIX FS; no longer in a fixed position on disk) Used to optimize cleaning • Segment summary • Segment usage table Used to handle crash recovery • Checkpoint region (fixed position on disk, incl. pointers to inode map blocks) • Directory change log

  5. Create file1/file2 in dir1/dir2: Without LFS

  6. Create file1/file2 in dir1/dir2: Without LFS = Disk Seek

  7. Create file1/file2 in dir1/dir2: With LFS

  8. Create file1/file2 in dir1/dir2: With LFS Boom. = Disk Seek

  9. Create file1/file2 in dir1/dir2: With LFS = Disk Seek

  10. What’s the Catch? • Eventually we’ll reach the end of the disk • As files are deleted, freed data blocks leave “holes” in the previously contiguous log • If we simply fill in the holes, we’re be back to standard UNIX FS performance (probably worse)

  11. Free Space Management Solutions

  12. Free Space Management Solutions • LFS uses combination; copy-and-compact 512KB “segments” but thread compacted segments into open spaces in the log • Why 512KB? Makes seek time neglibible.

  13. Data Structures in LFS Same as in UNIX File System • Superblock (fixed position on disk) • Inode • Blocks containing file data or directory listings • Indirect Block Used to Maintain Log Structure • Inode map (replaces the “itable”/“inode table” in the UNIX FS; no longer in a fixed position on disk) Used to optimize cleaning • Segment summary • Segment usage table Used to handle crash recovery • Checkpoint region (fixed position on disk, incl. pointers to inode map blocks) • Directory change log

  14. Data Structures in LFS Same as in UNIX File System • Superblock (fixed position on disk) • Inode • Blocks containing file data or directory listings • Indirect Block Used to Maintain Log Structure • Inode map (replaces the “itable”/“inode table” in the UNIX FS; no longer in a fixed position on disk) Used to optimize cleaning • Segment summary: Information that allows block liveness to be determined • Segment usage table: Statistics used to rank which segments to clean first Used to handle crash recovery • Checkpoint region (fixed position on disk, incl. pointers to inode map blocks) • Directory change log

  15. Data Structures in LFS Same as in UNIX File System • Superblock (fixed position on disk) • Inode • Blocks containing file data or directory listings • Indirect Block Used to Maintain Log Structure • Inode map (replaces the “itable”/“inode table” in the UNIX FS; no longer in a fixed position on disk) Used to optimize cleaning • Segment summary: Information that allows block liveness to be determined • Segment usage table: Statistics used to rank which segments to clean first Used to handle crash recovery • Checkpoint region (fixed position on disk, incl. pointers to inode map blocks) • Directory change log

  16. Performance Characteristics

  17. Performance Characteristics

More Related