Presentation is loading. Please wait.

Presentation is loading. Please wait.

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”

Similar presentations


Presentation on theme: "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”"— Presentation transcript:

1 NUS.SOC.CS5248 Ooi Wei Tsang 1 Course Matters

2 NUS.SOC.CS5248 Ooi Wei Tsang 2 Make-Up Lecture This Saturday, 23 October TR7, 1-3pm Topic: “CPU scheduling”

3 NUS.SOC.CS5248 Ooi Wei Tsang 3 Multimedia Storage Issues

4 NUS.SOC.CS5248 Ooi Wei Tsang 4 Media vs. Documents

5 NUS.SOC.CS5248 Ooi Wei Tsang 5 Media vs. Documents large file size write once, read many sequential access periodic access deadlines

6 NUS.SOC.CS5248 Ooi Wei Tsang 6 Average Service Time?

7 NUS.SOC.CS5248 Ooi Wei Tsang 7 OS Review: Disk

8 NUS.SOC.CS5248 Ooi Wei Tsang 8 Disk head, spindle, track, sector, cylinder

9 NUS.SOC.CS5248 Ooi Wei Tsang 9 Latency components seek time, rotational time and transfer time

10 NUS.SOC.CS5248 Ooi Wei Tsang 10 Disk Scheduler disk sched I/O Request read/write command

11 NUS.SOC.CS5248 Ooi Wei Tsang 11 OS Review: Disk Scheduling Algorithm

12 NUS.SOC.CS5248 Ooi Wei Tsang 12 FCFS 98 183 37 122 14 124 65 67

13 NUS.SOC.CS5248 Ooi Wei Tsang 13 SSTF 98 183 37 122 14 124 65 67

14 NUS.SOC.CS5248 Ooi Wei Tsang 14 SCAN (Elevator) 98 183 37 122 14 124 65 67

15 NUS.SOC.CS5248 Ooi Wei Tsang 15 C-SCAN 98 183 37 122 14 124 65 67

16 NUS.SOC.CS5248 Ooi Wei Tsang 16 EDF 98 183 37 122 14 124 65 67 30 10 13 5 24 33 21 39

17 NUS.SOC.CS5248 Ooi Wei Tsang 17 EDF-SCAN 98 183 37 122 14 124 65 67 30 10 13 5 24 33 21 39

18 NUS.SOC.CS5248 Ooi Wei Tsang 18 Other Schemes FD-SCAN SSEDO SSEDV

19 NUS.SOC.CS5248 Ooi Wei Tsang 19 Data Placement

20 NUS.SOC.CS5248 Ooi Wei Tsang 20 Contiguous

21 NUS.SOC.CS5248 Ooi Wei Tsang 21 Fragmented

22 NUS.SOC.CS5248 Ooi Wei Tsang 22 Striping (RAID-0)

23 NUS.SOC.CS5248 Ooi Wei Tsang 23 Mirroring (RAID-1)

24 NUS.SOC.CS5248 Ooi Wei Tsang 24 Parity (RAID-5)

25 NUS.SOC.CS5248 Ooi Wei Tsang 25 Parity

26 NUS.SOC.CS5248 Ooi Wei Tsang 26 Summary of Concerns High Throughput Fault Tolerant Load balancing

27 NUS.SOC.CS5248 Ooi Wei Tsang 27 This Lecture Consider striping only (RAID-0)

28 NUS.SOC.CS5248 Ooi Wei Tsang 28 Efficient Striping Techniques for Multimedia File Servers P. Shenoy, H. Vin NOSSDAV 97

29 NUS.SOC.CS5248 Ooi Wei Tsang 29 Design Parameters unit of striping (block size) degree of striping (num of disks)

30 NUS.SOC.CS5248 Ooi Wei Tsang 30 Stripe Unit

31 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

32 NUS.SOC.CS5248 Ooi Wei Tsang 32 Effects of Block Size Block Size service time

33 NUS.SOC.CS5248 Ooi Wei Tsang 33 Problem Find block size such that the service time for the most heavily loaded disk is minimize

34 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

35 NUS.SOC.CS5248 Ooi Wei Tsang 35 Assumptions Non-redundant array VBR Analyze read operation only

36 NUS.SOC.CS5248 Ooi Wei Tsang 36 Variables Declaration N d : Number of Disks N c : Number of Clients B: Block size

37 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

38 NUS.SOC.CS5248 Ooi Wei Tsang 38 Analysis Suppose i request m blocks

39 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

40 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

41 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

42 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

43 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

44 NUS.SOC.CS5248 Ooi Wei Tsang 44 Model Verification

45 NUS.SOC.CS5248 Ooi Wei Tsang 45 Imbalance and Overhead

46 NUS.SOC.CS5248 Ooi Wei Tsang 46 Effects of Block Size

47 NUS.SOC.CS5248 Ooi Wei Tsang 47 Effects of Clients

48 NUS.SOC.CS5248 Ooi Wei Tsang 48 Effects of Num of Disks

49 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

50 NUS.SOC.CS5248 Ooi Wei Tsang 50 There is more.. redundant array finding optimum degree of striping

51 NUS.SOC.CS5248 Ooi Wei Tsang 51 Cello: A Disk Scheduling Framework for Next Generation Operating Systems P. Shenoy, H. Vin SIGMETRICS 98

52 NUS.SOC.CS5248 Ooi Wei Tsang 52 Problem How to co-exist with other applications?

53 NUS.SOC.CS5248 Ooi Wei Tsang 53 Classes of Applications Real-time hard/soft periodic/aperiodic Best-effort interactive troughput-intensive

54 NUS.SOC.CS5248 Ooi Wei Tsang 54 Attempt 1 Priority-based scheduler Always schedule real-time tasks ahead of best-effort tasks

55 NUS.SOC.CS5248 Ooi Wei Tsang 55 Attempt 2 Partition time slots into real-time and best-effort

56 NUS.SOC.CS5248 Ooi Wei Tsang 56 Attempt 3 Assign weight to application class, based on their priority Service based on weight

57 NUS.SOC.CS5248 Ooi Wei Tsang 57 Attempt 3: Cello Two-level scheduling

58 NUS.SOC.CS5248 Ooi Wei Tsang 58 Class Independent Scheduler

59 NUS.SOC.CS5248 Ooi Wei Tsang 59 Allocating Disk Bandwidth Allocate in proportion to time Allocate in proportion to bytes

60 NUS.SOC.CS5248 Ooi Wei Tsang 60 Proportionate Time-Allocation

61 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

62 NUS.SOC.CS5248 Ooi Wei Tsang 62 Proportional Time Allocation

63 NUS.SOC.CS5248 Ooi Wei Tsang 63 Example Weights 1:1:2 P = 100 I = 30 10201614

64 NUS.SOC.CS5248 Ooi Wei Tsang 64

65 NUS.SOC.CS5248 Ooi Wei Tsang 65 r next prev

66 NUS.SOC.CS5248 Ooi Wei Tsang 66 Need to Make Sure.. Does not exceed share for class i

67 NUS.SOC.CS5248 Ooi Wei Tsang 67 Need to Make Sure.. Total service time does not exceed available time

68 NUS.SOC.CS5248 Ooi Wei Tsang 68 Update and Repeat next prev

69 NUS.SOC.CS5248 Ooi Wei Tsang 69 Being Work Conserving Work conserving: “don’t work only if no work to do”

70 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

71 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

72 NUS.SOC.CS5248 Ooi Wei Tsang 72 Free Time Utilization

73 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

74 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

75 NUS.SOC.CS5248 Ooi Wei Tsang 75 Slack Time i i

76 NUS.SOC.CS5248 Ooi Wei Tsang 76 Class 1: Interactive Best Effort next prev

77 NUS.SOC.CS5248 Ooi Wei Tsang 77 Class 2: High Throughput Best Effort next prev

78 NUS.SOC.CS5248 Ooi Wei Tsang 78 Class 3: Real Time Application next prev

79 NUS.SOC.CS5248 Ooi Wei Tsang 79 Evaluations response time # video

80 NUS.SOC.CS5248 Ooi Wei Tsang 80 Evaluations %time time

81 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


Download ppt "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”"

Similar presentations


Ads by Google