Unformatted text preview:

CS162 Operating Systems and Systems Programming Lecture 18 File Systems Naming and Directories November 2 2005 Prof John Kubiatowicz http inst eecs berkeley edu cs162 Review Magnetic Disk Cylinder all the Characteristic tracks under the head at a given point on all surface Head Read write data is a three stage process Track Sector Cylinder Platter Seek time position the head arm over the proper track into proper cylinder Rotational latency wait for the desired sector to rotate under the read write head Transfer time transfer a block of bits sector under the read write head Seek Rot Xfer Kubiatowicz CS162 UCB Fall 2005 Result 11 02 05 Queue Device Driver Hardware Controller Request Disk Latency Queueing Time Controller time Seek Time Rotation Time Xfer Software Time Media Time Lec 18 2 Review Introduction to Queuing Theory Queue Controller Arrivals Disk Departures Queuing System What about queuing time Let s apply some queuing theory Queuing Theory applies to long term steady state behavior Arrival rate Departure rate Little s Law Mean tasks in system arrival rate x mean response time Observed by many Little was first to prove Simple interpretation you should see the same number of tasks in queue when entering as when leaving Applies to any system in equilibrium as long as nothing in black box is creating or destroying tasks Typical queuing theory doesn t deal with transient behavior only steady state behavior 11 02 05 Kubiatowicz CS162 UCB Fall 2005 Lec 18 3 Goals for Today Finishing Disk Performance Hardware performance parameters Queuing Theory File Systems Structure Naming Directories Note Some slides and or pictures in the following are adapted from slides 2005 Silberschatz Galvin and 11 02 05 Kubiatowicz CS162 UCB Fall 2005 Lec 18 4 Gagne Background Use of random distributions Server spends variable time with customers Mean Average m1 p T T Variance 2 p T T m1 2 p T T2 m1 Mean m1 Squared coefficient of variance C 2 m12 Distribution of service times Aggregate description of the distribution Important values of C No variance or deterministic C 0 memoryless or exponential C 1 mean Past tells nothing about future Many complex systems or aggregates Memoryless well described as memoryless Disk response times C 1 5 majority seeks avg Mean Residual Wait Time m1 z Mean time must wait for server to complete current task Can derive m1 z m1 1 C Not just m1 because doesn t capture variance C 0 m1 z m1 C 1 m1 z m1 11 02 05 Kubiatowicz CS162 UCB Fall 2005 Lec 18 5 A Little Queuing Theory Mean Wait Time Arrival Rate Queue Server Service Rate 1 Tser Parameters that describe our system Tser C u mean number of arriving customers second mean time to service a customer m1 squared coefficient of variance 2 m12 service rate 1 Tser server utilization 0 u 1 u Tser Parameters we wish to compute T q L q Time spent in queue Length of queue Tq by Little s law Basic Approach Customers before us must finish mean time Lq Tser If something at server takes m1 z to complete on avg m1 z mean residual wait time at server T ser 1 C Chance something at server u mean time is u m1 z Computation of wait time in queue T q Tq Lq Tser u m1 z 11 02 05 Kubiatowicz CS162 UCB Fall 2005 Lec 18 6 A Little Queuing Theory M G 1 and M M 1 Computation of wait time in queue T q Tq Lq Tser u m1 z Little s Law Tq Tq Tq Tq Tq Tser u m1 z Defn of utilization u u Tq u m1 z 1 u m1 z u Tq m1 z u 1 u Tser 1 C u 1 u Notice that as u 1 Tq Assumptions so far System in equilibrium No limit to the queue works First In First Out Time between two successive arrivals in line are random and memoryless M for C 1 exponentially random Server can start on next customer immediately after prior finishes General service distribution no restrictions 1 server Called M G 1 queue Tq Tser 1 C u 1 u Memoryless service distribution C 1 Called M M 1 queue Tq Tser u 1 u 11 02 05 Kubiatowicz CS162 UCB Fall 2005 Lec 18 7 A Little Queuing Theory An Example Example Usage Statistics User requests 10 8KB disk I Os per second Requests service exponentially distributed C 1 0 Avg service 20 ms controller seek rot Xfertime Questions How utilized is the disk Ans server utilization u Tser What is the average time spent in the queue Ans Tq What is the number of requests in the queue Ans Lq Tq What is the avg response time for disk request Ans Tsys Tq Tser Wait in queue then get served Computation avg arriving customers s 10 s Tser avg time to service customer 20 ms 0 02s u server utilization Tser 10 s 02s 0 2 Tq avg time customer in queue Tser u 1 u 20 x 0 2 1 0 2 20 0 25 5 ms 0 005s Lq avg length of queue Tq 10 s 005s 0 05 Tsys avg time customer in system Tq Tser 25 ms 11 02 05 Kubiatowicz CS162 UCB Fall 2005 Lec 18 8 Disk Scheduling Disk can do only one request at a time What order do you choose to do queued requests 2 3 2 1 3 10 7 2 5 2 2 2 User Requests Head FIFO Order SSTF Shortest seek time first 3 Pick the request that s closest on the disk Although called SSTF today must include 2 rotational delay in calculation since 1 rotation can be as long as seek Con SSTF good at reducing seeks but 4 may lead to starvation Disk Head Fair among requesters but order of arrival may be to random spots on the disk Very long seeks SCAN Implements an Elevator Algorithm take the closest request in the direction of travel No starvation but retains flavor of SSTF C SCAN Circular Scan only goes in one direction Skips any requests on the way back Fairer than SCAN not biased towards pages in middle 11 02 05 Kubiatowicz CS162 UCB Fall 2005 Lec 18 9 Administrivia My office hours How many people would like me to have an office hour on Tuesday or Thursday Better get started on Project 3 Design is due on Monday 11 02 05 Kubiatowicz CS162 UCB Fall 2005 Lec 18 10 Building a File System File System Layer of OS that transforms block interface of disks or other block devices into Files Directories etc File System Components Disk Management collecting disk blocks into files Naming Interface to find files by name not by blocks Protection Layers to keep data secure Reliability Durability Keeping of files durable despite crashes media failures attacks etc User vs System View of a File User s view Durable Data Structures System s view system call interface Collection of Bytes UNIX Doesn t matter to system what kind of data structures you want to store on …


View Full Document

Berkeley COMPSCI 162 - Lecture 18 File Systems, Naming, and Directories

Documents in this Course
Lecture 1

Lecture 1

12 pages

Nachos

Nachos

41 pages

Security

Security

39 pages

Load more
Loading Unlocking...
Login

Join to view Lecture 18 File Systems, Naming, and Directories 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 18 File Systems, Naming, and Directories 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?