Project 1 requires that we write a CPU scheduler and memory coordinator. Right now, I’m focusing my attention on the former and the objective for this part of the project is write some C code that pins virtual CPUs to physical CPUs based off of the utilization statistics gathered with the libvrt library (I was able to clear up some of my own confusion by doodling the bitmap data structure passed in as a pointer). We then launch our executable binary and its job is to maximize the utilization across all the physical cores.
But before launching the scheduler, I want to see what the current scheduler (or lack thereof) is doing in terms of spreading load across the physical CPUs. At a glance, looks like a very naive scheduler (or no scheduler) runs, given that all the virtual guest operating systems are pinned to a single physical CPU:
0 - usage: 102.0 | mapping ['aos_vm1', 'aos_vm8', 'aos_vm4', 'aos_vm6', 'aos_vm5', 'aos_vm2', 'aos_vm3', 'aos_vm7'] 1 - usage: 0.0 | mapping [] 2 - usage: 0.0 | mapping [] 3 - usage: 0.0 | mapping [] -------------------------------------------------- 0 - usage: 100.0 | mapping ['aos_vm1', 'aos_vm8', 'aos_vm4', 'aos_vm6', 'aos_vm5', 'aos_vm2', 'aos_vm3', 'aos_vm7'] 1 - usage: 0.0 | mapping [] 2 - usage: 0.0 | mapping [] 3 - usage: 0.0 | mapping [] -------------------------------------------------- 0 - usage: 101.0 | mapping ['aos_vm1', 'aos_vm8', 'aos_vm4', 'aos_vm6', 'aos_vm5', 'aos_vm2', 'aos_vm3', 'aos_vm7'] 1 - usage: 0.0 | mapping [] 2 - usage: 0.0 | mapping [] 3 - usage: 0.0 | mapping [] -------------------------------------------------- 0 - usage: 101.0 | mapping ['aos_vm1', 'aos_vm8', 'aos_vm4', 'aos_vm6', 'aos_vm5', 'aos_vm2', 'aos_vm3', 'aos_vm7'] 1 - usage: 0.0 | mapping [] 2 - usage: 0.0 | mapping [] 3 - usage: 0.0 | mapping [] -------------------------------------------------- 0 - usage: 102.0 | mapping ['aos_vm1', 'aos_vm8', 'aos_vm4', 'aos_vm6', 'aos_vm5', 'aos_vm2', 'aos_vm3', 'aos_vm7'] 1 - usage: 0.0 | mapping [] 2 - usage: 0.0 | mapping [] 3 - usage: 0.0 | mapping [] -------------------------------------------------- 0 - usage: 100.0 | mapping ['aos_vm1', 'aos_vm8', 'aos_vm4', 'aos_vm6', 'aos_vm5', 'aos_vm2', 'aos_vm3', 'aos_vm7'] 1 - usage: 0.0 | mapping [] 2 - usage: 0.0 | mapping [] 3 - usage: 0.0 | mapping [