NUS.SOC.CS5248 Ooi Wei Tsang 1 Course Matters
NUS.SOC.CS5248 Ooi Wei Tsang 2 Make-Up Lecture This Saturday, 23 October TR7, 1-3pm Topic: “CPU scheduling”
NUS.SOC.CS5248 Ooi Wei Tsang 3 Multimedia Storage Issues
NUS.SOC.CS5248 Ooi Wei Tsang 4 Media vs. Documents
NUS.SOC.CS5248 Ooi Wei Tsang 5 Media vs. Documents large file size write once, read many sequential access periodic access deadlines
NUS.SOC.CS5248 Ooi Wei Tsang 6 Average Service Time?
NUS.SOC.CS5248 Ooi Wei Tsang 7 OS Review: Disk
NUS.SOC.CS5248 Ooi Wei Tsang 8 Disk head, spindle, track, sector, cylinder
NUS.SOC.CS5248 Ooi Wei Tsang 9 Latency components seek time, rotational time and transfer time
NUS.SOC.CS5248 Ooi Wei Tsang 10 Disk Scheduler disk sched I/O Request read/write command
NUS.SOC.CS5248 Ooi Wei Tsang 11 OS Review: Disk Scheduling Algorithm
NUS.SOC.CS5248 Ooi Wei Tsang 12 FCFS
NUS.SOC.CS5248 Ooi Wei Tsang 13 SSTF
NUS.SOC.CS5248 Ooi Wei Tsang 14 SCAN (Elevator)
NUS.SOC.CS5248 Ooi Wei Tsang 15 C-SCAN
NUS.SOC.CS5248 Ooi Wei Tsang 16 EDF
NUS.SOC.CS5248 Ooi Wei Tsang 17 EDF-SCAN
NUS.SOC.CS5248 Ooi Wei Tsang 18 Other Schemes FD-SCAN SSEDO SSEDV
NUS.SOC.CS5248 Ooi Wei Tsang 19 Data Placement
NUS.SOC.CS5248 Ooi Wei Tsang 20 Contiguous
NUS.SOC.CS5248 Ooi Wei Tsang 21 Fragmented
NUS.SOC.CS5248 Ooi Wei Tsang 22 Striping (RAID-0)
NUS.SOC.CS5248 Ooi Wei Tsang 23 Mirroring (RAID-1)
NUS.SOC.CS5248 Ooi Wei Tsang 24 Parity (RAID-5)
NUS.SOC.CS5248 Ooi Wei Tsang 25 Parity
NUS.SOC.CS5248 Ooi Wei Tsang 26 Summary of Concerns High Throughput Fault Tolerant Load balancing
NUS.SOC.CS5248 Ooi Wei Tsang 27 This Lecture Consider striping only (RAID-0)
NUS.SOC.CS5248 Ooi Wei Tsang 28 Efficient Striping Techniques for Multimedia File Servers P. Shenoy, H. Vin NOSSDAV 97
NUS.SOC.CS5248 Ooi Wei Tsang 29 Design Parameters unit of striping (block size) degree of striping (num of disks)
NUS.SOC.CS5248 Ooi Wei Tsang 30 Stripe Unit
NUS.SOC.CS5248 Ooi Wei Tsang 31 Model Disk serves clients in rounds Time to read media from disk should be smaller than round time Concern: minimize service time of most heavily loaded disk
NUS.SOC.CS5248 Ooi Wei Tsang 32 Effects of Block Size Block Size service time
NUS.SOC.CS5248 Ooi Wei Tsang 33 Problem Find block size such that the service time for the most heavily loaded disk is minimize
NUS.SOC.CS5248 Ooi Wei Tsang 34 Analysis Model: A Plan service time of the busiest disk as a function of block size expected num of blocks accessed on the busiest disk expected num of blocks accessed on any disk
NUS.SOC.CS5248 Ooi Wei Tsang 35 Assumptions Non-redundant array VBR Analyze read operation only
NUS.SOC.CS5248 Ooi Wei Tsang 36 Variables Declaration N d : Number of Disks N c : Number of Clients B: Block size
NUS.SOC.CS5248 Ooi Wei Tsang 37 Variables Declaration N b (i,j): Number of blocks client i access from disk j P a (i,m): Probability of i access m blocks in a round
NUS.SOC.CS5248 Ooi Wei Tsang 38 Analysis Suppose i request m blocks
NUS.SOC.CS5248 Ooi Wei Tsang 39 Reading 1 block Prob(N b (i,j)=1) N d : Number of Disks N c : Number of Clients B: Block size N b (i,j): Number of blocks client i access from disk j P a (i,m): Probability of i access m blocks in a round
NUS.SOC.CS5248 Ooi Wei Tsang 40 Reading k block Prob(N b (i,j)=k) N d : Number of Disks N c : Number of Clients B: Block size N b (i,j): Number of blocks client i access from disk j P a (i,m): Probability of i access m blocks in a round
NUS.SOC.CS5248 Ooi Wei Tsang 41 Blocks Read From a Disk N b (*,j) = N d : Number of Disks N c : Number of Clients B: Block size N b (i,j): Number of blocks client i access from disk j P a (i,m): Probability of i access m blocks in a round
NUS.SOC.CS5248 Ooi Wei Tsang 42 Busiest Disk N max = N d : Number of Disks N c : Number of Clients B: Block size N b (i,j): Number of blocks client i access from disk j P a (i,m): Probability of i access m blocks in a round
NUS.SOC.CS5248 Ooi Wei Tsang 43 Access Time T = N max (t s + t r + Bt t ) Depends on: block size B disk characteristic t s,t r,t t server design N d workload characteristic N c, N b (i,j) _ N d : Number of Disks N c : Number of Clients B: Block size N b (i,j): Number of blocks client i access from disk j P a (i,m): Probability of i access m blocks in a round
NUS.SOC.CS5248 Ooi Wei Tsang 44 Model Verification
NUS.SOC.CS5248 Ooi Wei Tsang 45 Imbalance and Overhead
NUS.SOC.CS5248 Ooi Wei Tsang 46 Effects of Block Size
NUS.SOC.CS5248 Ooi Wei Tsang 47 Effects of Clients
NUS.SOC.CS5248 Ooi Wei Tsang 48 Effects of Num of Disks
NUS.SOC.CS5248 Ooi Wei Tsang 49 Choosing Block Size Given N c, assume rest is fixed find B that minimize T if T < duration of a round incr N c and try again
NUS.SOC.CS5248 Ooi Wei Tsang 50 There is more.. redundant array finding optimum degree of striping
NUS.SOC.CS5248 Ooi Wei Tsang 51 Cello: A Disk Scheduling Framework for Next Generation Operating Systems P. Shenoy, H. Vin SIGMETRICS 98
NUS.SOC.CS5248 Ooi Wei Tsang 52 Problem How to co-exist with other applications?
NUS.SOC.CS5248 Ooi Wei Tsang 53 Classes of Applications Real-time hard/soft periodic/aperiodic Best-effort interactive troughput-intensive
NUS.SOC.CS5248 Ooi Wei Tsang 54 Attempt 1 Priority-based scheduler Always schedule real-time tasks ahead of best-effort tasks
NUS.SOC.CS5248 Ooi Wei Tsang 55 Attempt 2 Partition time slots into real-time and best-effort
NUS.SOC.CS5248 Ooi Wei Tsang 56 Attempt 3 Assign weight to application class, based on their priority Service based on weight
NUS.SOC.CS5248 Ooi Wei Tsang 57 Attempt 3: Cello Two-level scheduling
NUS.SOC.CS5248 Ooi Wei Tsang 58 Class Independent Scheduler
NUS.SOC.CS5248 Ooi Wei Tsang 59 Allocating Disk Bandwidth Allocate in proportion to time Allocate in proportion to bytes
NUS.SOC.CS5248 Ooi Wei Tsang 60 Proportionate Time-Allocation
NUS.SOC.CS5248 Ooi Wei Tsang 61 Variables P: Interval of a period I: Idle time so far U i : Allocated time for class i w i : Weightage of class i
NUS.SOC.CS5248 Ooi Wei Tsang 62 Proportional Time Allocation
NUS.SOC.CS5248 Ooi Wei Tsang 63 Example Weights 1:1:2 P = 100 I =
NUS.SOC.CS5248 Ooi Wei Tsang 64
NUS.SOC.CS5248 Ooi Wei Tsang 65 r next prev
NUS.SOC.CS5248 Ooi Wei Tsang 66 Need to Make Sure.. Does not exceed share for class i
NUS.SOC.CS5248 Ooi Wei Tsang 67 Need to Make Sure.. Total service time does not exceed available time
NUS.SOC.CS5248 Ooi Wei Tsang 68 Update and Repeat next prev
NUS.SOC.CS5248 Ooi Wei Tsang 69 Being Work Conserving Work conserving: “don’t work only if no work to do”
NUS.SOC.CS5248 Ooi Wei Tsang 70 What if.. a class have no pending request? put in no_work group a class violates one of the constraints? put in too_much_work group
NUS.SOC.CS5248 Ooi Wei Tsang 71 Improving Utilization When disk is idle, distribute service time among classes in too_much_work group Pick a request from this class and put into scheduled queue
NUS.SOC.CS5248 Ooi Wei Tsang 72 Free Time Utilization
NUS.SOC.CS5248 Ooi Wei Tsang 73 Class Specific Scheduler How to pick (r, prev, next)? Must not affect tasks in queue Idea: Compute slack time
NUS.SOC.CS5248 Ooi Wei Tsang 74 Slack Time l i Latest time must begin servicing request i e i Earliest time may begin servicing request i d i Deadline for request i s i Slack time for i = l i – e i t i Time to service request i
NUS.SOC.CS5248 Ooi Wei Tsang 75 Slack Time i i
NUS.SOC.CS5248 Ooi Wei Tsang 76 Class 1: Interactive Best Effort next prev
NUS.SOC.CS5248 Ooi Wei Tsang 77 Class 2: High Throughput Best Effort next prev
NUS.SOC.CS5248 Ooi Wei Tsang 78 Class 3: Real Time Application next prev
NUS.SOC.CS5248 Ooi Wei Tsang 79 Evaluations response time # video
NUS.SOC.CS5248 Ooi Wei Tsang 80 Evaluations %time time
NUS.SOC.CS5248 Ooi Wei Tsang 81 Cello Summary OS disk scheduler Support multiple classes Protect classes from each other Work conserving Use two-level scheduling