If guest VM is configured with CAP like: xm sched-credit -d capvm --cap=10 xm sched-credit -d capvm Name ID Weight Cap capvm 2 256 10 The result of top command: top - 08:58:09 up 57 min, 3 users, load average: 1.54, 0.73, 0.46 Tasks: 110 total, 2 running, 108 sleeping, 0 stopped, 0 zombie Cpu0 : 0.0%us, 0.0%sy, 0.0%ni, 1.2%id, 3.2%wa, 0.0%hi, 0.0%si, 95.7%st Cpu1 : 0.0%us, 1.8%sy, 0.0%ni, 43.0%id, 5.4%wa, 0.0%hi, 0.0%si, 49.8%st Cpu2 : 0.0%us, 0.7%sy, 0.0%ni, 63.6%id, 6.0%wa, 0.0%hi, 0.0%si, 29.7%st Cpu3 : 0.1%us, 1.6%sy, 0.0%ni, 27.0%id, 40.1%wa, 0.0%hi, 0.0%si, 31.1%st Mem: 1048576k total, 997124k used, 51452k free, 176k buffers Swap: 2104504k total, 212416k used, 1892088k free, 6180k cached ... The guest VM suffers from steel time meaning guest vm can not get cpu cycles. Does this mean other guest vm can obtain cpu cycles or just waste my own cpu cycles? Thanks,
On 02/18/2013 01:34 AM, Andrew Son wrote:> The guest VM suffers from steel time meaning guest vm can not get cpu > cycles. Does this mean other guest vm can obtain cpu cycles or just > waste my own cpu cycles?Hi Andrew, the steal time is here since Linux kernel 2.6.11 [1]. Of course, other guests can obtain cpu cycles from the backing CPU of that vCPU. Read more about Xen credit scheduler (Xen''s default) [2]. [1] http://lwn.net/Articles/108605/ [2] http://wiki.xen.org/wiki/Credit_Scheduler -- Peter Viskup
Hi Peter, Thank for references. My detailed question is: If the host machine is not busy, guest VM can get VCPU (timeslices) in every 30ms. If the CAP value is 50, does guest VM get 15ms? or guest VM can get 30ms, but it can not use 15ms? 2013/2/18 Peter Viskup <skupko.sk@gmail.com>:> On 02/18/2013 01:34 AM, Andrew Son wrote: >> >> The guest VM suffers from steel time meaning guest vm can not get cpu >> cycles. Does this mean other guest vm can obtain cpu cycles or just >> waste my own cpu cycles? > > Hi Andrew, > the steal time is here since Linux kernel 2.6.11 [1]. > Of course, other guests can obtain cpu cycles from the backing CPU of that > vCPU. Read more about Xen credit scheduler (Xen''s default) [2]. > > [1] http://lwn.net/Articles/108605/ > [2] http://wiki.xen.org/wiki/Credit_Scheduler > > -- > Peter Viskup
On 02/18/2013 02:49 AM, Andrew Son wrote:> Hi Peter, > > Thank for references. > My detailed question is: > > If the host machine is not busy, guest VM can get VCPU (timeslices) in > every 30ms. > If the CAP value is 50, does guest VM get 15ms? > or guest VM can get 30ms, but it can not use 15ms? >It''s not about the shortage of timeslices. It''s about how many timeslices the guest will be given. Read the wiki more carefully and especially the Algorithm section and you will find it''s more about credits - if you use the default scheduler. The host machine/hypervisor will assign the CPU time (timeslice) every time the guest has credits or other guest is not asking for that CPU. -- Peter Viskup