Course Matters - PowerPoint PPT Presentation

About This Presentation
Title:

Course Matters

Description:

20% off for each late day. NUS.SOC.CS5248. OOI WEI TSANG. 3. Diwali/Deepavali. 19. 18. 17 ... How can multimedia applications co-exists with normal applications? ... – PowerPoint PPT presentation

Number of Views:59
Avg rating:3.0/5.0
Slides: 73
Provided by: dcso
Category:
Tags: course | diwali | matters

less

Transcript and Presenter's Notes

Title: Course Matters


1
Course Matters
2
Paper Review
Paper Reviews Due 20 off for each late day
3
Diwali/Deepavali
No Class
4
Guest Lecture
CS6212 Guest Lecture A/V Synchronization SR1
4-6pm
5
Books
6
Project Grading
7
Previously, on CS5248
8
Cello
  • OS disk scheduler
  • Support multiple classes
  • Protect classes from each other
  • Work conserving
  • Use two-level scheduling

9
CPU vs Disk Scheduling
  • Task computation time unpredictable
  • Task can be preemptive

10
Problem
  • How can multimedia applications co-exists with
    normal applications?

11
Same Old Idea
12
Same Gang
  • P. Goyal, X. Guo, and H. M. Vin.
  • A hierarchical CPU scheduler for
  • multimedia operating systems.
  • OSDI96

13
So Far
  • Best-Effort Real-Time Scheduling

14
How to Guarantee Services?
15
Resource Reservation CPU
16
Resource Reservations
  • How to reserve?
  • Overbook?
  • Overuse?

17
Example Memory
  • How to reserve?
  • malloc
  • Overbook?
  • return NULL
  • Overuse?
  • crash, throw exception

18
Example Memory
  • How to reserve?
  • I will need 128KB
  • Overbook?
  • Sorry!
  • Overuse?
  • malloc returns NULL

19
Example CPU
  • How to reserve?
  • Overbook?
  • Overuse?

Memory is discrete. CPU time is continuous.
20
How to Reserve?
21
CPU Reservation
  • I need C units of time, out of every T units.

22
Two Problems
  • How to determine C?
  • take measurement and estimate
  • What if C is not constant?
  • take the maximum

23
Effects of T and C
24
CPU Scheduling Algorithm
25
Classic Real-Time Scheduler
26
Rate Scheduling Algorithms
  • Rate Monotonic
  • Earliest Deadline First

27
Rate Monotonic
28
EDF
29
Classic Schedulability Theorems
  • Rate Monotonic Scheduler
  • Earliest Deadline First

30
Assumptions
  • programs are periodic
  • computation time is constant
  • zero context switch time
  • programs are independent

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
  • Dont want to commit 100 CPU anyway (for
    emergency)

32
Rialto Scheduler
  • From MS Research

33
Overview
  • Given a set of task, pre-compute a scheduling
    graph

34
E
B
C
A
E
B
F
D
E
B
A
E
B
D
35
C
A
E
B
F
D
36
Advantages
  • Only need to make new scheduling decisions when
    new task is added

37
Computing Scheduling Graph
  • Input A set of tasks with their reservations
  • Output A scheduling graph if feasible

38
Many Possible Solutions
C
A
A
E
B
E
B
F
F
D
D
C
39
C
A
F
E
B
F
D
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
Life is Tough..
NP-Hard
42
Heuristic
10
10
10
10
10
10
10
43
10
5
F
5
5
10
10
10
44
6
1
F
1
BE
1
6
6
6
45
C
4
1
F
1
BE
1
1
1
AD
1
46
E
B
C
E
B
D
A
E
B
F
E
B
A
D
47
Time Constraints
48
Time Constraint
  • I need to run the following code, that takes
    30ms, 100ms from now, and the deadline is
    (now180ms).

49
Pseudocode
  • can begin_constraint(start_time, deadline,
    estimate)
  • if can schedule then
  • do work
  • else
  • adapt
  • time_taken end_constraint()

50
Scheduling Constraints
C
A
F
E
B
F
D
51
Scheduling Constraints
C
A
C1, C2, C5
F
E
B
F
D
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
Peaceful Coexistence
54
Running Unreserved Task
C
A
F
E
B
F
D
55
Media Player on Rialto/NT
56
Look inside NT Scheduler
  • Scheduling unit Thread
  • Priority level 1-15, 16-31
  • rt 24 high 13 normal 8 idle 4

57
Priority Boosting
  • Example
  • Priority 6 after awaken by keyboard input

58
Anti-Starvation
  • If hasnt run for 3 seconds
  • Boost priority to 14
  • Avoid Priority Inversion

59
Mars Pathfinder
60
Rialto/NT
Rialto
Boost Priority to 30
NT Scheduler
61
Win Media Player 6.4
62
Experiment 1
  • WMP running alone

63
Experiment 2
  • WMP running with priority 8 competitor

64
Experiment 3
  • WMP running with priority 10 competitor

65
Experiment 5
  • WMP running with priority 10 competitor

66
Experiment 6
  • WMP running with priority 10 competitor

67
Experiment 7
  • WMP running with priority 10 competitor

68
Summary
69
CPU Scheduling
  • With guarantee
  • percentage of CPU time
  • task with deadline
  • Algorithms
  • Rate-monotonic
  • EDF
  • Rialto

70
CS5248 Summary
71
Last Two Lectures
72
Last Two Lectures
  • Papers from recent conferences and journals.
Write a Comment
User Comments (0)
About PowerShow.com