10 likes | 158 Views
Accurate and Efficient Process Scheduling among Virtual Machines Hidekazu Tadokoro * Kenichi Kourai ** Shigeru Chiba * * Tokyo Institute of Technology ** Kyushu Institute of Technology , JST CREST. System Architecture. Why system-wide process scheduling?.
E N D
Accurate and Efficient Process Scheduling among Virtual MachinesHidekazu Tadokoro* Kenichi Kourai** Shigeru Chiba* * Tokyo Institute of Technology ** Kyushu Institute of Technology, JST CREST System Architecture Why system-wide process scheduling? • A process scheduler should consider all processes in all VMs • Each process competes with the other processes • E.g. Low-importance processes should not runif high-importance processes are running in other VMs • However, a guest OS is not aware of the other OSes • The VMM is not aware of processes Domain 0 Domain U Monarch Scheduler process2 process1 process process run queue Monarch Scheduler … running • A process scheduler among VMs • Achieves a custom scheduling policy in the whole system • Monitors the execution of processes • Using virtual machine Introspection (VMI) • Changes the scheduling behavior of each guest Oses • Using direct kernel object manipulation (DKOM) • Supported guest OSes are Linux and Windows Vista (x64) Xen VMM Process state transition Directly modifiesthe kernel memory Domain U ready blocked How to change scheduling policies in guest OSes Challenging issues: Accuracy and Efficiency Track CPU times based on CR3 Associate the CR3 to a process • To suspend a process • The Monarch scheduler removes it from a run queueif it is ready • The Monarch scheduler changes the process stateif it is waiting for an event or currently running • The process stops spontaneously • To resume a suspended process • The Monarch scheduler changes the process state and inserts it into a run queue • Process CPU times accounted in guest OSes are inaccurate • CPU times account depends on timer interrupts • Timer interrupts are not always triggered regularly in VMs • Because of virtualization • Accessing the memory from Domain 0 is inefficient • The Monarch scheduler needs to map many memory pages in Domain U • With modifying a page table and flushing a TLB CR3 process1: 100 msec process2: 560 msec … Xen VMM Monarch Scheduler run queue Processes waiting for CPU Running on CPU Re-design for accuracy and efficiency • The VMM accounts process times for accuracy • Using VMI with a technique called Antfarm. • Antfarm enables recognizing the context switches of processes based on the CR3 register • VMI enables associating the value of CR3 register to a specific process • The Monarch scheduler is implemented in the VMM for efficiency • The VMM does not need to map memory pages of Domain U • It can directly access the memory pages • Provides API of strongly typed languages • To prevent the whole system being crashed Policy example: Idle-time scheduling • Runs the indexing service only if the whole system is idle voidinit() { d_all = get_domain_by_name(“.*”); p_all = get_task_by_name(d_all, “.*”); p_si= get_task_by_name(d_all, “SearchIndexer”); set_period(P); } voidscheduler() { t_all = get_time(p_all, P); t_si = get_time(p_si, P); if (t_all – t_si > 0) suspend(p_si); else resume(p_si); }