Unformatted text preview:

Recap 1 Devices Block devices Character devices Device Controllers DMA vs Programmed I O I O Software Goals Abstract away from device specifics Uniform naming Handle errors robustly 4 29 2002 Moran OS Lecture 12 1 Recap 2 Device Drivers Autoconf Init Top Half I O Requests Bottom Half Interrupt Service Routines Entry Points for Block Devices Entry Points for Character Devices 4 29 2002 Moran OS Lecture 12 2 System call interface to the kernel Active file entries Vnode layer socket NFS Local naming UFS Network protocols FFS LFS MFS Network interface drivers Buffer cache Block device driver VM Special devs Cooked TTY Raw Swap disk Disk Space And mgmt TTY Line discipline Character device driver The hardware 4 29 2002 Moran OS Lecture 12 3 Disks Disk Performance Seek Time Rotational Latency Time to Transfer the Actual Data Example Cheetah 73LP 73GB Disk 10K RPM 2 99 msec avg latency 5 1 msec 5 5 msec avg seek time read write Internal transfer rate 399 to 671 Mbits sec 4 discs 8 heads 29 549 cylinders Seek errors 10 per 10 8 Read errors 10 per 10 12 4 29 2002 Moran OS Lecture 12 4 Disk Arm Scheduling FCFS simple but has lousy performance Pick like FCFS but if we pass something that we want we service it Shortest Seek Time First greedy algorithm it tends to stay in the middle of the disk and starve outer requests Scan arm moves one way filling requests at the end last request it reverses direction and does the same going the other way No starvation Also called elevator Circular Scan like scan but only fills request in one direction Then it goes to the farthest request in the other direction and begins again 4 29 2002 Moran OS Lecture 12 5 RAID Redundant Array of Independent Disks Mirroring two disks contain the same data Allows for fault tolerance and possibly multiple readers Striping spread the contents of one disk on several so consecutive blocks are on different disks This makes large reads faster N striped disks with a parity or error correction disk Common number for N is 4 4 29 2002 Moran OS Lecture 12 6 RAID Issues Writing small amounts of data can be very expensive read old data compute the change write new data compute new parity write new parity For larger amounts of data we only have the increased time to write and compute the parity 4 29 2002 Moran OS Lecture 12 7 Virtual File System Interface File entries reference inodes Inodes are unique per file system What do we do when we network mount other FS Add a new layer the vnode Change all of the interfaces in the system from inode to vnode vnode for a local file system refers to an inode vnode for a remote file system refers to a protocol control block with location and naming info 4 29 2002 Moran OS Lecture 12 8 vnode Flags for locking and attributes like root of FS Various ref counts A pointer to the mount structure of the FS the vnode is in NFS info A pointer to the set of vnode operations defined Pointer to either the inode or nfsnode etc 4 29 2002 Moran OS Lecture 12 9 Pathname Translation We used to do namei but that doesn t work Vnode pathname translation determine starting point as either root or cwd vnode calls FS specific lookup and passes path and current lookup dir lookup returns a vnode and we repeat Key point the underlying FS doesn t know what is being used as a mount point Crossing a mount point means we switch FS 4 29 2002 Moran OS Lecture 12 10 File Systems Standard Unix FS Memory FS MFS Union Mount FS Portal FS Network File Systems RFS NFS AFS 4 29 2002 Moran OS Lecture 12 11 Union Mount Union Mount usr foo src src x a 4 29 2002 bar b src baz x c Moran OS Lecture 12 x a bar b baz c 12 Network FS History Objective share files across machines Easiest model is to allow remote machines to mount FS as if they were local 3 Important Concerns Semantics Coherence Performance Remote Disk a scheme that allowed a machine to talk to another s disk 4 29 2002 Moran OS Lecture 12 13 Remote Disk vs NFS NFS AFS RFS Machine A Machine B Remote Disk 4 29 2002 Moran OS Lecture 12 14 NFS Background Client Server Protocol Client imports the FS Server exports local FS to other machines Protocol spec in the public domain 4 29 2002 Moran OS Lecture 12 15 NFS Protocol Stateless Supports Unix FS Semantics but allows FS with less rich semantics as well Access follows Unix UID group model but allows FS with weaker models as well Protocol is transport independent Designed for UDP Ported to TCP and many other protocols 4 29 2002 Moran OS Lecture 12 16 NFS Design Limitations Assumes clients server are on a fast local net Works badly on slow networks Works badly for disconnected machines Caching model assumes files won t be shared If they are the performance is lousy Stateless model loses some Unix FS semantics flock 4 29 2002 Moran OS Lecture 12 17 NFS Operations NFS Server is stateless all requests are self contained requests may be sent multiple times if things are slow operations can be idempotent or not for those that aren t the server keeps a cache of recent operations so as to avoid having problems with non idempotent ops 4 29 2002 Moran OS Lecture 12 18 NFS Operation List 4 29 2002 GETATTR Get file attributes yes SETATTR LOOKUP READLINK READ WRITE CREATE REMOVE RENAME LINK SYMLINK MKDIR RMDIR READDIR STATFS Set file attributes Look up file name Read from a sym link Read from a file Write to file Create file Remove file Rename file Create link to a file Create a symbolic link Create directory Remove directory Read from a directory Get FS attributes yes yes yes yes yes yes no no no yes no no yes yes Moran OS Lecture 12 19 NFS Server Files are globally identified by a file handle this is a token by which a client identifies a file to the server handle is returned by lookup handle is file system id inode number generation number of the inode generation number insures that the inode still refers to the same file file handle allows the server to find the file being referred to 4 29 2002 Moran OS Lecture 12 20 NFS Protocol more Server is stateless doesn t maintain any info about which clients there are or which files they are accessing RPC message has all info necessary to satisfy a request In fact the server will maintain a cache of recently accessed files so it isn t really stateless 4 29 2002 Moran OS Lecture 12 21 Stateless Server Can simply startup no state recovery necessary no need to worry about which clients are around network partitions or failures followed by reconnects don t cause problems 4 29 2002 Moran OS Lecture …


View Full Document

NYU CSCI-GA 2250 - Lecture Notes

Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?