If the CPUs are "floating" as opposed to "pinned", it''s possible for a busy VM to use all the available processors if the other VMs are idle, right? E.G., if I have 4 CPUs and 3 VMs and none of my CPUs are pinned, and one of my VMs is compiling a kernel while the other two are idle, the busy kernel-compiling VM will use all 4 CPUs, right? It won''t be limted to only 2 or something, right? I''m curious because I''ve noticed a few people and documents mention pinning one cpu to each VM. I assume is is because they don''t want a situation where a low-priority but high-processor-usage task on one VM causes another VM with a sporadic but high-priority job to hang out waiting for the low-prioroty job to finish. Ok, now that I''ve read my own question, I guess my real question is, can someone point me to a good document that descibes how Xen allocates available processors..? If there isn''t such a document, please take a shot at the question above... Thanks! -Dylan _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> If the CPUs are "floating" as opposed to "pinned", it''s possible for a > busy VM to use all the available processors if the other VMs are idle, > right?Not necessarily...> E.G., if I have 4 CPUs and 3 VMs and none of my CPUs are pinned, and > one of my VMs is compiling a kernel while the other two are idle, the > busy kernel-compiling VM will use all 4 CPUs, right? It won''t be > limted to only 2 or something, right?Depends if you limited it ;-) There are really two parameters here: how many VCPUs you give a guest, and how you distribute those over PCPUs (real CPUs). If you have 4 PCPUs and you want a guest to be able to use the full processor bandwidth of the machine (peak) then you need to give it 4 VCPUs and set the scheduler parameters appropriately so that its CPU time is not capped.> I''m curious because I''ve noticed a few people and documents mention > pinning one cpu to each VM.Pinning really refers to setting the mapping of VCPUs to PCPUs manually rather than letting the scheduler migrate VCPUs around. You might want to do it e.g. to guarantee a domain exclusive use of one processor, or you might want to pin two groups of domains to share disjoint sets of processors.> I assume is is because they don''t want a situation where a > low-priority but high-processor-usage task on one VM causes another VM > with a sporadic but high-priority job to hang out waiting for the > low-prioroty job to finish. > > Ok, now that I''ve read my own question, I guess my real question is, > can someone point me to a good document that descibes how Xen allocates > available processors..? If there isn''t such a document, please take a > shot at the question above...The credit scheduler does it, within the constraints you provide by pinning using either xm or the domain''s config file.... Side note: VCPU hotplug is doable (for PV domains, anyhow). So you could hotplug VCPUs into a guest to let it use more PCPUs in the machine, then hot-remove them later when you want it to be more limited. AFAIK the crazy cool SMP alternatives patch will automatically patch locking sites so that you don''t get (very much) penalty for running an SMP-aware kernel with only one VCPU. Cool stuff :-) Cheers, Mark -- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Wed, 18 Apr 2007, Dylan Martin wrote:> If the CPUs are "floating" as opposed to "pinned", it''s possible for a > busy VM to use all the available processors if the other VMs are idle, > right?No. this "sharing all cpu" you describe is only possible if all physical cpus are mapped into all domains: e.g. on a 4CPU box, on each DomU, you need to add vcpus=4 to your Dom0 config file.> E.G., if I have 4 CPUs and 3 VMs and none of my CPUs are pinned, and > one of my VMs is compiling a kernel while the other two are idle, the > busy kernel-compiling VM will use all 4 CPUs, right? It won''t be > limted to only 2 or something, right?depends on the vcpus= value in your xm config file; by default each domain is limited to 1 vcpu (which is mapped to 1 and only 1 physical cpu) this means if you have one busy domain and 8 idle domains on a 8 core box, one cpu will be pegged, and the other 7 will be idle.> I''m curious because I''ve noticed a few people and documents mention > pinning one cpu to each VM. > > I assume is is because they don''t want a situation where a > low-priority but high-processor-usage task on one VM causes another VM > with a sporadic but high-priority job to hang out waiting for the > low-prioroty job to finish.That problem can be solved by weighting; I believe the point of pinning one cpu to one and only one DomU is to minimize context switching; obviously, when one DomU is done with a cpu and the next is scheduled to run, the registers and such need to be saved and restored to the state that the next domain expects. this costs time, and is not required if you have a 1:1 pcpu:vcpu ratio. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users