Operating Systems CMPSCI 377 Lecture 23 Advanced File
- Slides: 25
Operating Systems CMPSCI 377 Lecture 23: Advanced File Systems Emery Berger University of Massachusetts Amherst UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science
Advanced File Systems n n n Motivation & Brief review Journaling Log-structured file system UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 2
New Challenges n Servers have special needs! n n n Large hard-disk partitions Quick crash recovery High-performance I/O Storing thousands of files, TB of data None supported well by ext 2 UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 3
Review: Blocks & Fragmentation n n Logical block – smallest unit of storage that can be allocated by file system Internal fragmentation – occurs when file does not fill block completely n n Example: file = 10 K, block = 8 K: wastes 6 K External fragmentation – occurs when logical blocks that make up file are scattered over the disk n Causes poor performance UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 4
Review: Organization n Extent – contiguous blocks: n Triple: (file offset, starting block number, length) n n file offset – offset of extent's first block from file starting block number – first block in extent length –number of blocks in extent Meta data – file system's internal data structures n Time stamps, ownership, size & locations on UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 5
Extents n n Triple: (offset, start, length) Contiguou s blocks UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 6
Review: Inodes n inode – stores information about file n e. g. , permissions, types, # of links to file n pointers to file data blocks (direct pointers) n pointers to direct pointers (indirect pointers) n each has unique inode number n directory = special file: contains pointers to other files U M , A Department of Computer Science NIVERSITY OF ASSACHUSETTS MHERST • 7
UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 8
Metadata Updates n Lots of meta data being updated n n Scattered on disk = slow, and non-atomic Example: Creating a new file n n Modifies inodes, free lists, directory entries What happens if interrupted? n n e. g. , power outage, crash Interrupted meta-data write ) file system in inconsistent state UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 9
Repairing File System Inconsistency n UNIX solution: fsck = “file-system check” n n n Analogous utilities for Windows, etc. Detect and repair structural integrity problems Scan file system’s entire meta data n n Looks for inconsistencies & fixes them Problems? n n S…l…o…w… Might not succeed UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 10
Journaling File Systems n Solve problem by maintaining journal n n n Log all transactions to disk Updates to the disk committed atomically Example: Creating a new file n n Log modifications to inodes Log changes to free lists, directory entries Now begin update When finished, write “committed” into journal UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 11
Recovery in JFS n Power outage: n Some updates fully committed to file system n n Not yet fully committed n n No problem File system reads journal, replays transaction Advantages over fsck: n n n Much quicker than scan of disk Guarantees file system always consistent But: does not guarantee zero data loss UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 12
Advanced File Systems n n n Brief review Journaling Log-structured file system UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 13
LFS: Beyond JFS n n Insight: While logging updates, why not log the data too? “Log-structured file system” n n Preserves data integrity Provides improved performance, too! UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 14
Sprite LFS [Rosenblum & Ousterhout] n n n Outperforms then-current Unix file systems by an order of magnitude for small-file writes Matches or exceeds Unix performance for reads and large writes Even with overhead n n Can use 70% of disk bandwidth for writing Unix file systems typically can use only 510%M , A Department of Computer Science UNIVERSITY OF ASSACHUSETTS MHERST • 15
Technology Trends n Disk technology improving rapidly n n Increasing RAM ) cache more effective n n But: capacity rather than performance Disk traffic dominated by writes Logs: write new information sequentially n Increase write performance, eliminating seeks UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 16
Existing File Systems n Exercise worst-case given trends! n Information spread around disk n n Many small accesses Synchronous writes n Application performance can be bottlenecked by disk performance UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 17
Log-Structured File Systems n Approach: improve write performance by combining into single sequential writes n n n Converts small random writes into large sequential transfers Use file cache as write buffer But where does meta data go? UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 18
Structure of LFS (1/3) n Some index structures used to retrieve information n n Inodes not fixed: inode map used to maintain location of each inode Fixed checkpoint region on each disk: identifies locations of inode map blocks UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 19
Structure of LFS (2/3) n Disk layout (compared with Unix FFS) dir 1 dir 2 Log file 1 Disk Sprite LFS file 2 file 1 file 2 Disk dir 1 Inode Unix FFS dir 2 Directory Data Inode map UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 20
Structure of LFS (3/3) n Segments n n n Important to maintain large free extents for writing new data Divide disk into large fixed-size extents called segments Segments always written sequentially n Before segment is rewritten, all live data must be copied out (“cleaned”) UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 21
Crash Recovery (1/2) n Checkpoints n n Position in log at which all of file system structures are consistent and complete Checkpoint region written on special fixed position: n n Periodic intervals When the file system unmounted or shut down UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 22
Crash Recovery (2/2) n Roll-forward n n After crashes, LFS scans through log segments that were written after last checkpoint Use information in segment summary blocks n When summary block indicates presence of new inode, LFS updates inode map UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 23
LFS Wrap-Up n n Extends journaling to data Sequential writes in segments n n n Fast! Periodic clean-up Periodic checkpoints UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 24
Summary n n n Traditional filesystems – integrity problems Solved by journaling Log-structured further improves speed by optimizing write performance UNIVERSITY OF MASSACHUSETTS, AMHERST • Department of Computer Science 25
- File-file yang dibuat oleh user pada jenis file di linux
- Operating system lecture notes
- Module 4 operating systems and file management
- Cs377 umass
- Proposta razoável para indemnização do dano corporal
- Sid 377
- Hippocrates (460-377 bc)
- An/urn-25
- 01:640:244 lecture notes - lecture 15: plat, idah, farad
- Advanced inorganic chemistry lecture notes
- Ricart-agrawala algorithm code in java
- Advanced operating system
- Multiprocessor scheduling in operating system
- File management worksheet answers
- File management in android operating system
- Components of an operating system
- File system in operating system
- Ufs4.0
- File system in operating system
- Physical image vs logical image
- Fungsi dari create file pada operasi-operasi file (cont.)
- Remote file access in distributed file system
- What does a markup tag tells the web browser
- In a file-oriented information system, a transaction file
- Articulators
- Lecture sound systems