Lec14_distribute

Lec14_distribute - Review CSE120 Principles of Operating...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CSE120 Principles of Operating Systems Prof Yuanyuan (YY) Zhou Lecture 14: Distributed Systems May 23, 2011 Review Disk performance Seek time, rotation delay, transfer Disk scheduling FCFS, Shorted seek time, SCAN, C-SCAN File system Files, directory Protection: capability vs. access control list File data layout Contiguous, linked, indexed (inode) 5/22/2011 CSE 120 2 5/22/2011 CSE 120 3 Unix Inodes Unix inodes implement an indexed structure for files Also store metadata info (protection, timestamps, length, ref count…) Each inode contains 15 block pointers First 12 are direct blocks (e.g., 4 KB blocks) Then single, double, and triple indirect 0 12 13 14 1 (Metadata) (1) (2) (3) 5/22/2011 CSE 120 4 Unix Inodes and Path Search Unix Inodes are not directories Inodes describe where on the disk the blocks for a file are placed Directories are files Directories have inodes for themselves, too Directory entries map file names to inodes To open “/one”, use Master Block to find inode for “/” on disk Open “/”, look for entry for “one” This entry gives the disk block number for the inode for “one” Read the inode for “one” into memory The inode says where first data block is on disk Read that block into memory to access the data in the file
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 5/22/2011 CSE 120 5 File Buffer Cache Applications exhibit significant locality for reading and writing files Idea: Cache file blocks in memory to capture locality This is called the file buffer cache Cache is system wide, used and shared by all processes Reading from the cache makes a disk perform like memory Even a 4 MB cache can be very effective Issues The file buffer cache competes with VM (tradeoff here) Like VM, it has limited size Need replacement algorithms again (LRU usually used) 5/22/2011 CSE 120 6 Caching Writes On a write, some applications assume that data makes it through the buffer cache and onto the disk As a result, writes are often slow even with caching Several ways to compensate for this “write-behind” Maintain a queue of uncommitted blocks Periodically flush the queue to disk Unreliable Battery backed-up RAM (NVRAM) As with write-behind, but maintain queue in NVRAM Expensive Log-structured file system Always write next block after last block written Complicated 5/22/2011 CSE 120 7 Read Ahead (Prefetch) Many file systems implement “read ahead” FS predicts that the process will request next block FS goes ahead and requests it from the disk This can happen while the process is computing on previous block Overlap I/O with execution When the process requests block, it will be in cache Compliments the disk cache, which also is doing read ahead For sequentially accessed files can be a big win Unless blocks for the file are scattered across the disk
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/26/2012 for the course CSE 120 taught by Professor Staff during the Spring '08 term at UCSD.

Page1 / 10

Lec14_distribute - Review CSE120 Principles of Operating...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online