Dreams in a Nutshell Steven Sommer steve@mpce.mq.edu.au Microsoft Research Institute Department of Computing Macquarie University Overview 1. Background 2. Dreams Model 3. Overrun 4. Implementation August 1997 USENIX Windows NT Workshop 2 Dreams Distributed Real-time Extensions with Application to Multimedia Systems Extend conventional operating systems to support distributed real-time applications Paradigm preserving August 1997 USENIX Windows NT Workshop 3 Key Paradigm Differences Multiple competing applications Temporal protection Absence of a priori knowledge Different kinds of applications Subsystems (servers) Interrupts Dynamic August 1997 distribution USENIX Windows NT Workshop 4 2. The Dreams Model Transient Periodic Processes Periodic Invocations Specified Period Deadline Execution Time August 1997 USENIX Windows NT Workshop 5 Application 100% Free Create Real-Time Process The Dreams Model Make Reservation Schedulability Test Reservations Manager Distribute Yes / No Create the Process 0% Real-Time Ready-to-Run Queue Process Table Reserved Process Manager P5 P1 P9 System Scheduler CPU 80486 P1 P5 P9 Allocate to CPU P1 Add Process P9 P5 Enforcer 6 3. Overrun Concepts System guarantee: A real-time task will receive its reserved resources between each invocation’s start-time and deadline A task which consumes its reserved capacity without completing has overrun Only overrun tasks can miss their deadlines Task continues in overrun state Overrun tasks receive refreshed resources at the start of their next period August 1997 USENIX Windows NT Workshop 7 Scheduling and Overrun Waiting Invocation Completion Invocation’s Start Time Runnable Scheduled Thread Invocation Overrun Overrun Try Overrun Overrun Leave 8 Sample Schedule Process T1 T2 T3 Period Reservation Av. Execution Time first scheduled 100 20 20 ~70 250 110 100 ~70 1000 440 400 ~480 . = 10ms 0 100 200 300 400 Time ID 01234567890123456789012345678901234567890123456789 ---4500 1 .......RC........RC........RC........RC........R1O 4500 2 .......SR2222222C...............R22222R22C........ 4500 3 33333333........R3R333333333R3333........R333333.R 5000 5000 5000 1 .......C.........R1O..RC...R1C.......R1O..C....R1O 2 .......R2222222C................R22222.R22C....... 3 33333333.......R33.R33C.........................SR 5500 5500 5500 1 .......C.........R1O.......C.........R1O.......C.. 2 .......R2222222C................R22222.R22C....... 3 33333333.......R33.R3333333R33333.........R3333R33 Legend:(S)tart(time) (R)un (scheduled) (C)ompleted (O)verrun Multiple 4. Implementation Windows NT 3.51 implementation Minimal impact on: Non-real-time execution Existing operating system code Programming paradigm 10 Win32™ Client Dreams Client Dreams Subsystem Win32 Subsystem OS/2® Client Applications OS/2 Subsystem Protected subsystems (servers) POSIX Client POSIX Subsystem User mode Executive Kernel mode System services Object Manager Security Reference Monitor Process Manager Local Procedure Call Virtual Memory Manager Kernel I/O manager File systems Cache manager Device drivers Network drivers Hardware abstraction layer Message Passing / Shared Memory System Trap 11 Dreams Client Application Memory Space Dreams Subsystem Memory Space Application Process Real-Time Thread Manager Reservation Manager API Call Dreams DLL Create Thread Procedure call via named pipes Dreams DLL Shared Data Area Requests / Process Table Non blocking access Real-Time Thread API Call Periodic Invocation Blocking Access Non blocking communication Shared Memory Non real-time priority Real-time priority Real-Time Scheduler + Enforcer Kernel Call Window NT Kernel Scheduling via NT Priority Control Kernel Mode Dreams 12 Implementation Experience Dreams extensions in a subsystem Meet implementation goals Simpler development, modification, and testing Priority inheritance Useful in all operating systems (not just real-time) Performance improvement Two tiered scheduler (with priority inheritance) Hides scheduling complexities Simpler scheduling Simpler schedulability model Simpler timing and enforcement 13 Summary Background Dreams Model Overrun Implementation August 1997 USENIX Windows NT Workshop 14