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

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

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 10 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 10 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 10 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 10 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS162Operating Systems andSystems ProgrammingLecture 18File Systems, Naming, and DirectoriesNovember 2nd, 2009Prof. John Kubiatowiczhttp://inst.eecs.berkeley.edu/~cs162Lec 18.211/02/09Kubiatowicz CS162 ©UCB Fall 2009Review: 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/02/09Kubiatowicz CS162 ©UCB Fall 2009Review: Disk Performance Model• 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 trackSoftwareQueue(Device Driver)HardwareControllerMedia Time(Seek+Rot+Xfer)RequestResultLec 18.411/02/09Kubiatowicz CS162 ©UCB Fall 2009DeparturesArrivalsQueuing SystemReview: Introduction 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.511/02/09Kubiatowicz CS162 ©UCB Fall 2009Goals for Today• Queuing Theory: Continued• 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.611/02/09Kubiatowicz CS162 ©UCB Fall 2009Background: 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– 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 (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) = m1Mean (m1)meanMemorylessDistributionof service timesLec 18.711/02/09Kubiatowicz CS162 ©UCB Fall 2009A Little Queuing Theory: Mean Wait Time• 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)• 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= Tser ½(1+C)» Chance something at server = u  mean time is u  m1(z)• Computation of wait time in queue (Tq):– Tq= Lq Tser+ u  m1(z)Arrival RateQueueServerService Rateμ=1/TserLec 18.811/02/09Kubiatowicz CS162 ©UCB Fall 2009A Little Queuing Theory: M/G/1 and M/M/1• Computation of wait time in queue (Tq):Tq= Lq Tser+ u  m1(z) Tq= Tq Tser+ u  m1(z) Tq= u  Tq+ u  m1(z)Tq (1 – u) = m1(z)  u  Tq= m1(z)  u/(1-u) Tq= 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)Little’s LawDefn of utilization (u)Lec 18.911/02/09Kubiatowicz CS162 ©UCB Fall 2009A 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/sTser(avg time to service customer) = 20 ms (0.02s)u (server utilization) = Tser= 10/s  .02s = 0.2Tq(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.05Tsys(avg time/customer in system) =Tq+ Tser= 25 msLec 18.1011/02/09Kubiatowicz CS162 ©UCB Fall 2009Queuing Theory Resources• Handouts page contains Queueing Theory Resources:–


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?