Download presentation
Presentation is loading. Please wait.
Published byMabel Carroll Modified over 9 years ago
1
1 Course Matters
2
NUS.SOC.CS5248 OOI WEI TSANG 2 Paper Review October 2003 MonTueWedThuFriSatSun 171819 20212223242526 Paper Reviews Due 20% off for each late day
3
NUS.SOC.CS5248 OOI WEI TSANG 3 Diwali/Deepavali October 2003 MonTueWedThuFriSatSun 171819 20212223242526 No Class
4
NUS.SOC.CS5248 OOI WEI TSANG 4 Guest Lecture October 2003 MonTueWedThuFriSatSun 171819 20212223242526 CS6212 Guest Lecture “A/V Synchronization” SR1 4-6pm
5
NUS.SOC.CS5248 OOI WEI TSANG 5 Books
6
NUS.SOC.CS5248 OOI WEI TSANG 6 Project Grading
7
7 Previously, on CS5248
8
NUS.SOC.CS5248 OOI WEI TSANG 8 Cello OS disk scheduler Support multiple classes Protect classes from each other Work conserving Use two-level scheduling
9
NUS.SOC.CS5248 OOI WEI TSANG 9 CPU vs Disk Scheduling Task computation time unpredictable Task can be preemptive
10
NUS.SOC.CS5248 OOI WEI TSANG 10 Problem How can multimedia applications co-exists with normal applications?
11
NUS.SOC.CS5248 OOI WEI TSANG 11 Same Old Idea
12
NUS.SOC.CS5248 OOI WEI TSANG 12 Same Gang P. Goyal, X. Guo, and H. M. Vin. “A hierarchical CPU scheduler for multimedia operating systems.” OSDI’96
13
NUS.SOC.CS5248 OOI WEI TSANG 13 So Far Best-Effort Real-Time Scheduling
14
NUS.SOC.CS5248 OOI WEI TSANG 14 How to Guarantee Services?
15
15 Resource Reservation: CPU
16
NUS.SOC.CS5248 OOI WEI TSANG 16 Resource Reservations How to reserve? Overbook? Overuse?
17
NUS.SOC.CS5248 OOI WEI TSANG 17 Example: Memory How to reserve? malloc Overbook? return NULL Overuse? crash, throw exception
18
NUS.SOC.CS5248 OOI WEI TSANG 18 Example: Memory How to reserve? “I will need 128KB” Overbook? “Sorry!” Overuse? malloc returns NULL
19
NUS.SOC.CS5248 OOI WEI TSANG 19 Example: CPU How to reserve? Overbook? Overuse? Memory is discrete. CPU time is continuous.
20
20 How to Reserve?
21
NUS.SOC.CS5248 OOI WEI TSANG 21 CPU Reservation “I need C units of time, out of every T units.”
22
NUS.SOC.CS5248 OOI WEI TSANG 22 Two Problems How to determine C? take measurement and estimate What if C is not constant? take the maximum
23
NUS.SOC.CS5248 OOI WEI TSANG 23 Effects of T and C
24
24 CPU Scheduling Algorithm
25
25 Classic Real-Time Scheduler
26
NUS.SOC.CS5248 OOI WEI TSANG 26 Rate Scheduling Algorithms Rate Monotonic Earliest Deadline First
27
NUS.SOC.CS5248 OOI WEI TSANG 27 Rate Monotonic
28
NUS.SOC.CS5248 OOI WEI TSANG 28 EDF
29
NUS.SOC.CS5248 OOI WEI TSANG 29 Classic Schedulability Theorems Rate Monotonic Scheduler Earliest Deadline First
30
NUS.SOC.CS5248 OOI WEI TSANG 30 Assumptions programs are periodic computation time is constant zero context switch time programs are independent
31
NUS.SOC.CS5248 OOI WEI TSANG 31 Why do we care about RM? Theoretically, RM has lower CPU utilization (70%) but RM is more efficient than EDF Can support up to 80-90% CPU utilization in practice Don’t want to commit 100% CPU anyway (for emergency)
32
32 Rialto Scheduler From MS Research
33
NUS.SOC.CS5248 OOI WEI TSANG 33 Overview Given a set of task, pre-compute a scheduling graph
34
NUS.SOC.CS5248 OOI WEI TSANG 34 TaskABCDEF Amount432115 Period201040201040 EBCA EBFD EBA EBD
35
NUS.SOC.CS5248 OOI WEI TSANG 35 TaskABCDEF Amount432115 Period201040201040 C F A D EB
36
NUS.SOC.CS5248 OOI WEI TSANG 36 Advantages Only need to make new scheduling decisions when new task is added
37
NUS.SOC.CS5248 OOI WEI TSANG 37 Computing Scheduling Graph Input: A set of tasks with their reservations Output: A scheduling graph if feasible
38
NUS.SOC.CS5248 OOI WEI TSANG 38 Many Possible Solutions C F A D EB F C A D EB
39
NUS.SOC.CS5248 OOI WEI TSANG 39 TaskABCDEF Amount432115 Period201040201040 C F F A D EB
40
NUS.SOC.CS5248 OOI WEI TSANG 40 Computing Scheduling Graph Input: A set of tasks with their reservations Output: A scheduling graph if feasible Goals: (a) Minimize context switches (b) Distribute free time evenly
41
NUS.SOC.CS5248 OOI WEI TSANG 41 Life is Tough.. NP-Hard
42
NUS.SOC.CS5248 OOI WEI TSANG 42 Heuristic 10
43
NUS.SOC.CS5248 OOI WEI TSANG 43 10 5 5 5 F TaskABCDEF Amount432115 Period201040201040
44
NUS.SOC.CS5248 OOI WEI TSANG 44 6 1 6 6 1 6 1 F B+E TaskABCDEF Amount432115 Period201040201040
45
NUS.SOC.CS5248 OOI WEI TSANG 45 4 1 1 1 1 1 1 F B+E A+D C TaskABCDEF Amount432115 Period201040201040
46
NUS.SOC.CS5248 OOI WEI TSANG 46 TaskABCDEF Amount432115 Period201040201040 EBC EBDA EBF EBAD
47
47 Time Constraints
48
NUS.SOC.CS5248 OOI WEI TSANG 48 Time Constraint “I need to run the following code, that takes 30ms, 100ms from now, and the deadline is (now+180ms).”
49
NUS.SOC.CS5248 OOI WEI TSANG 49 Pseudocode can = begin_constraint(start_time, deadline, estimate) if can schedule then do work else adapt time_taken = end_constraint()
50
NUS.SOC.CS5248 OOI WEI TSANG 50 Scheduling Constraints C F F A D EB
51
NUS.SOC.CS5248 OOI WEI TSANG 51 Scheduling Constraints C F F A D EB C1, C2, C5
52
NUS.SOC.CS5248 OOI WEI TSANG 52 Advantages of Scheduling Graph Only need to make new scheduling decisions when new task is added Feasibility of time constraint can be predicted accurately
53
53 Peaceful Coexistence
54
NUS.SOC.CS5248 OOI WEI TSANG 54 Running Unreserved Task C F F A D EB
55
55 Media Player on Rialto/NT
56
NUS.SOC.CS5248 OOI WEI TSANG 56 Look inside NT Scheduler Scheduling unit : Thread Priority level: 1-15, 16-31 rt 24 high 13 normal 8 idle 4
57
NUS.SOC.CS5248 OOI WEI TSANG 57 Priority Boosting Example: Priority +6 after awaken by keyboard input
58
NUS.SOC.CS5248 OOI WEI TSANG 58 Anti-Starvation If hasn’t run for 3 seconds Boost priority to 14 Avoid “Priority Inversion”
59
NUS.SOC.CS5248 OOI WEI TSANG 59 Mars Pathfinder
60
NUS.SOC.CS5248 OOI WEI TSANG 60 Rialto/NT NT Scheduler Rialto C F F A D EB Boost Priority to 30
61
NUS.SOC.CS5248 OOI WEI TSANG 61 Win Media Player 6.4 PeriodPriorityThread 1024Kernel Mixer 458GUI 10015Timer 1009MP3 Decoder 5008Unknown 20008Disk Reader
62
NUS.SOC.CS5248 OOI WEI TSANG 62 Experiment 1 WMP running alone PeriodPriorityThread 1024Kernel Mixer 458GUI 10015Timer 1009MP3 Decoder 5008Unknown 20008Disk Reader
63
NUS.SOC.CS5248 OOI WEI TSANG 63 Experiment 2 WMP running with priority 8 competitor PeriodPriorityThread 1024Kernel Mixer 458GUI 10015Timer 1009MP3 Decoder 5008Unknown 20008Disk Reader
64
NUS.SOC.CS5248 OOI WEI TSANG 64 Experiment 3 WMP running with priority 10 competitor PeriodPriorityThread 1024Kernel Mixer 458GUI 10015Timer 1009MP3 Decoder 5008Unknown 20008Disk Reader
65
NUS.SOC.CS5248 OOI WEI TSANG 65 Experiment 5 WMP running with priority 10 competitor PeriodPriorityReservationThread 1024Kernel Mixer 458GUI 10015Timer 100940/1024MP3 Decoder 5008Unknown 20008Disk Reader
66
NUS.SOC.CS5248 OOI WEI TSANG 66 Experiment 6 WMP running with priority 10 competitor PeriodPriorityReservationThread 10241/16Kernel Mixer 458GUI 10015Timer 100940/1024MP3 Decoder 5008Unknown 20008Disk Reader
67
NUS.SOC.CS5248 OOI WEI TSANG 67 Experiment 7 WMP running with priority 10 competitor PeriodPriorityReservationThread 1024Kernel Mixer 458GUI 10015Timer 100920/512MP3 Decoder 5008Unknown 20008Disk Reader
68
68 Summary
69
NUS.SOC.CS5248 OOI WEI TSANG 69 CPU Scheduling With guarantee percentage of CPU time task with deadline Algorithms Rate-monotonic EDF Rialto
70
NUS.SOC.CS5248 OOI WEI TSANG 70 CS5248 Summary Network Encoder Sender Middlebox Receiver Decoder
71
NUS.SOC.CS5248 OOI WEI TSANG 71 Last Two Lectures October/November 2003 MonTueWedThuFriSatSun 171819 20212223242526 272829303112 3456789
72
NUS.SOC.CS5248 OOI WEI TSANG 72 Last Two Lectures Papers from recent conferences and journals.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.