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

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS162Operating Systems andSystems ProgrammingLecture 18File Systems, Naming, and DirectoriesNovember 3rd, 2008Prof. John Kubiatowiczhttp://inst.eecs.berkeley.edu/~cs162Lec 18.211/03/08Kubiatowicz CS162 ©UCB Fall 2008Review: Device Drivers• Device Driver: Device-specific code in the kernel that interacts directly with the device hardware– Supports a standard, internal interface– Same kernel I/O system can interact easily with different device drivers– Special device-specific configuration supported with the ioctl() system call• Device Drivers typically divided into two pieces:– Top half: accessed in call path from system calls» implements a set of standard, cross-device calls like open(), close(), read(), write(), ioctl(),strategy()» This is the kernel’s interface to the device driver» Top half will startI/O to device, may put thread to sleep until finished– Bottom half: run as interrupt routine» Gets input or transfers next block of output» May wake sleeping threads if I/O now completeLec 18.311/03/08Kubiatowicz CS162 ©UCB Fall 2008Review: Magnetic Disk Characteristic• Cylinder: all the tracks under the head at a given point on all surface• Read/write data is a three-stage process:– Seek time: position the head/arm over the proper track (into proper cylinder)– Rotational latency: wait for the desired sectorto rotate under the read/write head– Transfer time: transfer a block of bits (sector)under the read-write head• Disk Latency = Queueing Time + Controller time +Seek Time + Rotation Time + Xfer Time• Highest Bandwidth: – transfer large group of blocks sequentially from one trackSectorTrackCylinderHeadPlatterSoftwareQueue(Device Driver)HardwareControllerMedia Time(Seek+Rot+Xfer)RequestResultLec 18.411/03/08Kubiatowicz CS162 ©UCB Fall 2008Goals for Today• Queuing Theory• File Systems– Structure, Naming, DirectoriesNote: Some slides and/or pictures in the following areadapted from slides ©2005 Silberschatz, Galvin, and Gagne Note: Some slides and/or pictures in the following areadapted from slides ©2005 Silberschatz, Galvin, and Gagne. Many slides generated from my lecture notes by Kubiatowicz.Lec 18.511/03/08Kubiatowicz CS162 ©UCB Fall 2008DeparturesArrivalsQueuing SystemIntroduction to Queuing Theory• 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 behaviorQueueControllerDiskLec 18.611/03/08Kubiatowicz CS162 ©UCB Fall 2008Background: 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-m12– Squared coefficient of variance: C = σ2/m12Aggregate description of the distribution.• Important values of C:– No variance or deterministic ⇒ C=0 – “memoryless” or exponential ⇒ C=1» Past tells nothing about future» Many complex systems (or aggregates)well described as memoryless– Disk response times C ≈ 1.5 (wider variance ⇒ long tail)Mean (m1)meanMemorylessDistributionof service timesσLec 18.711/03/08Kubiatowicz CS162 ©UCB Fall 2008A Little Queuing Theory: Some Results• Assumptions:– System in equilibrium; No limit to the queue– Time between successive arrivals is random and memoryless• Parameters that describe our system:– λ: mean number of arriving customers/second– Tser: mean time to service a customer (“m1”)– C: squared coefficient of variance = σ2/m12– μ: service rate = 1/Tser– u: server utilization (0≤u≤1): u = λ/μ = λ×Tser• Parameters we wish to compute:– Tq: Time spent in queue– Lq: Length of queue = λ×Tq(by Little’s law)• Results:– Memoryless service distribution (C = 1):» Called M/M/1 queue: Tq= Tserx u/(1 – u)– General service distribution (no restrictions), 1 server:» Called M/G/1 queue: Tq= Tserx ½(1+C) x u/(1 – u))Arrival Rate λQueueServerService Rate μ=1/TserLec 18.811/03/08Kubiatowicz CS162 ©UCB Fall 2008A Little Queuing Theory: An Example• Example Usage Statistics:– User requests 10 x 8KB disk I/Os per second– Requests & service exponentially distributed (C=1.0)– Avg. service = 20 ms (From controller+seek+rot+trans)• 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(Little’s law)– What is the avg response time for disk request? » Ans: Tsys= Tq+ Tser• Computation:λ (avg # arriving customers/s) = 10/sTser(avg time to service customer) = 20 ms (0.02s)u (server utilization) = λ x Tser= 10/s x .02s = 0.2Tq(avg time/customer in queue) = Tserx u/(1 – u) = 20 x 0.2/(1-0.2) = 20 x 0.25 = 5 ms (0 .005s)Lq(avg length of queue) = λ x Tq=10/s x .005s = 0.05Tsys(avg time/customer in system) =Tq+ Tser= 25 msLec 18.911/03/08Kubiatowicz CS162 ©UCB Fall 2008Queuing Theory Resources• Handouts page contains Queueing Theory Resources:– Scanned pages from Patterson and Hennesey book that gives further discussion and simple proof for general eq.– A complete website full of resources• Midterms with queueing theory questions:– Midterm IIs from previous years that I’ve taught• Assume that Queueing theory is fair game for Midterm II or for the finalLec 18.1011/03/08Kubiatowicz CS162 ©UCB Fall 2008Administrivia• Course Feedback Tomorrow and Wednesday in Section – Make sure to go to section!• Group Evaluations notOptional– You will get a zero for project if you don’t fill them out!– We use these for grading• No normal office hours on Wednesday– I will be gone for most of Wed/Thu– Will pop back for class on Wednesday• Regrade requests for Midterm I– must be in by next week• Some discussion about the grading of Project I– We are considering giving a few points back– Always talk to your TA, not the reader• Feel free to ask questions in lectures and sections• Visit my office hours (except for this week)– M/W 2:30-3:30– Or:


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
Download Lecture 18 File Systems, Naming, and Directories
Our administrator received your request to download this document. We will send you the file to your email shortly.
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 2 2 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?