1 / 72

Course Matters

Course Matters. Paper Review. Paper Reviews Due 20% off for each late day. Diwali/Deepavali. No Class. Guest Lecture. CS6212 Guest Lecture “A/V Synchronization” SR1 4-6pm. Books. Project Grading. Previously, on CS5248. Cello. OS disk scheduler Support multiple classes

Télécharger la présentation

Course Matters

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Course Matters

  2. Paper Review Paper Reviews Due 20% off for each late day NUS.SOC.CS5248 OOI WEI TSANG

  3. Diwali/Deepavali No Class NUS.SOC.CS5248 OOI WEI TSANG

  4. Guest Lecture CS6212 Guest Lecture “A/V Synchronization” SR1 4-6pm NUS.SOC.CS5248 OOI WEI TSANG

  5. Books NUS.SOC.CS5248 OOI WEI TSANG

  6. Project Grading NUS.SOC.CS5248 OOI WEI TSANG

  7. Previously, on CS5248

  8. Cello • OS disk scheduler • Support multiple classes • Protect classes from each other • Work conserving • Use two-level scheduling NUS.SOC.CS5248 OOI WEI TSANG

  9. CPU vs Disk Scheduling • Task computation time unpredictable • Task can be preemptive NUS.SOC.CS5248 OOI WEI TSANG

  10. Problem • How can multimedia applications co-exists with normal applications? NUS.SOC.CS5248 OOI WEI TSANG

  11. Same Old Idea 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 NUS.SOC.CS5248 OOI WEI TSANG

  13. So Far Best-Effort Real-Time Scheduling NUS.SOC.CS5248 OOI WEI TSANG

  14. How to Guarantee Services? NUS.SOC.CS5248 OOI WEI TSANG

  15. Resource Reservation: CPU

  16. Resource Reservations • How to reserve? • Overbook? • Overuse? NUS.SOC.CS5248 OOI WEI TSANG

  17. Example: Memory • How to reserve? malloc • Overbook? return NULL • Overuse? crash, throw exception NUS.SOC.CS5248 OOI WEI TSANG

  18. Example: Memory • How to reserve? “I will need 128KB” • Overbook? “Sorry!” • Overuse? malloc returns NULL NUS.SOC.CS5248 OOI WEI TSANG

  19. Example: CPU • How to reserve? • Overbook? • Overuse? Memoryis discrete. CPUtimeis continuous. NUS.SOC.CS5248 OOI WEI TSANG

  20. How to Reserve?

  21. CPU Reservation • “I need C units of time, out of every T units.” 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 NUS.SOC.CS5248 OOI WEI TSANG

  23. Effects of T and C NUS.SOC.CS5248 OOI WEI TSANG

  24. CPU Scheduling Algorithm

  25. Classic Real-Time Scheduler

  26. Rate Scheduling Algorithms • Rate Monotonic • Earliest Deadline First NUS.SOC.CS5248 OOI WEI TSANG

  27. Rate Monotonic NUS.SOC.CS5248 OOI WEI TSANG

  28. EDF NUS.SOC.CS5248 OOI WEI TSANG

  29. Classic Schedulability Theorems • Rate Monotonic Scheduler • Earliest Deadline First NUS.SOC.CS5248 OOI WEI TSANG

  30. Assumptions • programs are periodic • computation time is constant • zero context switch time • programs are independent 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) NUS.SOC.CS5248 OOI WEI TSANG

  32. Rialto Scheduler From MS Research

  33. Overview • Given a set of task, pre-compute a scheduling graph NUS.SOC.CS5248 OOI WEI TSANG

  34. B E A C B E D F B E A B E D NUS.SOC.CS5248 OOI WEI TSANG

  35. C A B E F D NUS.SOC.CS5248 OOI WEI TSANG

  36. Advantages • Only need to make new scheduling decisions when new task is added NUS.SOC.CS5248 OOI WEI TSANG

  37. Computing Scheduling Graph • Input: A set of tasks with their reservations • Output: A scheduling graph if feasible NUS.SOC.CS5248 OOI WEI TSANG

  38. Many Possible Solutions C A A B E B E F F D D C NUS.SOC.CS5248 OOI WEI TSANG

  39. C A F B E F D 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 NUS.SOC.CS5248 OOI WEI TSANG

  41. Life is Tough.. NP-Hard NUS.SOC.CS5248 OOI WEI TSANG

  42. Heuristic 10 10 10 10 10 10 10 NUS.SOC.CS5248 OOI WEI TSANG

  43. 10 5 F 5 5 10 10 10 NUS.SOC.CS5248 OOI WEI TSANG

  44. 6 1 F 1 B+E 1 6 6 6 NUS.SOC.CS5248 OOI WEI TSANG

  45. C 4 1 F 1 B+E 1 1 1 A+D 1 NUS.SOC.CS5248 OOI WEI TSANG

  46. B E C B E A D B E F B E A D NUS.SOC.CS5248 OOI WEI TSANG

  47. Time Constraints

  48. Time Constraint • “I need to run the following code, that takes 30ms, 100ms from now, and the deadline is (now+180ms).” 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() NUS.SOC.CS5248 OOI WEI TSANG

  50. Scheduling Constraints C A F B E F D NUS.SOC.CS5248 OOI WEI TSANG

More Related