150 likes | 341 Views
Loadable Scheduler Overview. Loadable schedulers special Windows NT 4.0 driversCoexist with standard Windows NT schedulerApplications can use scheduling algorithms tailored to their needsSystem can provide behaviors not otherwise availableOnly one loadable scheduler loaded at once in this prototype.
E N D
1. Vassal: Loadable Scheduler Support for Multi-Policy Scheduling George M. Candea, Oracle Corporation
Michael B. Jones, Microsoft Research
2. Loadable Scheduler Overview Loadable schedulers special Windows NT 4.0 drivers
Coexist with standard Windows NT scheduler
Applications can use scheduling algorithms tailored to their needs
System can provide behaviors not otherwise available
Only one loadable scheduler loaded at once in this prototype
3. Windows NT Scheduling Threads schedulable unit
Threads in one of several states:
Running, Standby, Ready, Waiting, Terminated
Dispatcher schedules threads based on:
Priority
Processor Affinity
4. Windows NT Priorities 32 priorities in three classes:
Real-Time (16-31)
Variable (1-15)
Idle (0)
Real-Time threads
Use strict priority scheduling
Round-robin within priority
Variable threads
Subject to priority boosts, decays
5. Unscheduled CPU Time Interrupts
Deferred Procedure Calls (DPCs)
Interrupts needing substantial work queue DPCs
6. Deferred Procedure Calls DPCs:
Are preempted by interrupts
Preempt normal threads
May not block
Are run in FIFO order
Typical Uses:
I/O Completion Processing
Background Driver Housekeeping
7. Scheduling Events Reschedules triggered by:
Quantum end
Priority or affinity changes
Blocking
Wakeups
Timers queue DPCs
Which may wake up threads
8. Timer Management Hardware Abstraction Layer (HAL) provides kernel periodic timer
Resolution selectable from 1 to 15ms
Default typically 10ms or 15ms
Not all HALs implement all values
MP HAL provides 1, 2, 4, 8, 16ms
Some HALs just implement 10ms!
9. Windows NT Drivers General kernel extension mechanism
Kernel loaded dynamic link libraries
Drivers implement facilities such as:
Filesystems
Network protocols
Hardware device drivers
Vassal schedulers implemented as Windows NT drivers
10. Loadable Scheduler Infrastructure Four tasks (T1-T4) with two schedulers (A & B)
11. Primitives Added by Vassal RegisterScheduler(scheduler, decision_maker, message_dispatcher)
Used by schedulers to register with system
MessageToScheduler(scheduler, buffer, buflen)
Used by threads to communicate with loaded schedulers
SetSchedulerEvent(scheduler, performance_counter_reading)
Used by schedulers to request that call to decision function be made at specific time
12. Integration of Vassal into Windows NT 4.0
13. Use of Real-Time Scheduler /* Tell system to use the real-time scheduler */
status = MessageToScheduler (rt_sched, {JOIN});
if (status != SUCCESS) {
error (“Could not join R/T scheduling class.”);
}
/* Calculate how long our loop iterations take */
estimate = Calibrate();
/* Start the loop 1 ms from now */
status = MessageToScheduler (rt_sched, {SET, 1000});
if (status != SUCCESS) {
error (“Could not set deadline.”);
}
/* We want one iteration every 300 µs */
while (1) {
status = MessageToScheduler (rt_sched, {SET, 300 – estimate});
…
}
14. Execution of the Sample Code
15. Context Switch Times Measured context switch times on Pentium-133 running original and modified systems (in µs)
16. Periodic Wakeup Times Periodic wakeup times on Pentium-133 using multimedia timers on original system and sample scheduler’s events on modified system (in µs). Desired value is 1000µs.