Kayvan Sylvan
2008-Jan-23 20:49 UTC
[Xen-users] Looking for clarity about physical cores/cpus and VCPUs
Hi everyone, I''m looking for a clear explanation of how the CPU scheduling works and the correspondence between physical CPUs and VCPUS. The Xen manuals state that there is "up to 32 virtual CPUs per guest virtual machine". So, If I have a server with 64 physical CPUs, and I boot into Xen, with dom0_max_vcpu set to 1, and I have 2 guest domains, like this: Dom0 (1 vcpu) Guest1 (15 vcpu) Guest2 (16 vcpu) What is the actual correspondence between the virtual CPUs and physical CPUs? If there is up to 32 vcpus per guest, can I exceed the number of physical CPUs? For example: Dom0 (4 vcpu) Guest1 (32 vcpu) Guest2 (32 vcpu) Guest3 (32 vcpu) If I do that, how does Xen operate? Thank you very much for your answers. ---Kayvan _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Todd Deshane
2008-Jan-24 02:48 UTC
Re: [Xen-users] Looking for clarity about physical cores/cpus and VCPUs
Hi, Some answers inline. On Jan 23, 2008 3:49 PM, Kayvan Sylvan <kayvan@psiww.com> wrote:> Hi everyone, > > > > I''m looking for a clear explanation of how the CPU scheduling works and > the correspondence between physical CPUs and VCPUS. > > > > The Xen manuals state that there is "up to 32 virtual CPUs per guest > virtual machine". > > > > So, If I have a server with 64 physical CPUs, and I boot into Xen, with > dom0_max_vcpu set to 1, and I have 2 guest domains, like this: > > > > Dom0 (1 vcpu) > > Guest1 (15 vcpu) > > Guest2 (16 vcpu) > > > > What is the actual correspondence between the virtual CPUs and physical > CPUs? > > Xen will schedule based on its scheduling policies. So there would be notdirect correspondence. You can override this behavior with xm vcpu-pin and other xm vcpu* commands. You can even change scheduling policies, priorities etc.> > > If there is up to 32 vcpus per guest, can I exceed the number of physical > CPUs? For example: > > >I am pretty sure you can do this, but I don''t think it makes much sense to do this, since it would simply increase scheduling overhead.> Dom0 (4 vcpu) > > Guest1 (32 vcpu) > > Guest2 (32 vcpu) > > Guest3 (32 vcpu) > > > > If I do that, how does Xen operate? > > >I believe Xen can do the scheduling of more vcpus than physical CPUs, but I can''t think of a good motivation to do so. Best Regards, Todd Thank you very much for your answers.> > > > ---Kayvan >> > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Williamson
2008-Jan-25 00:45 UTC
Re: [Xen-users] Looking for clarity about physical cores/cpus and VCPUs
> I''m looking for a clear explanation of how the CPU scheduling works and the > correspondence between physical CPUs and VCPUS. > > The Xen manuals state that there is "up to 32 virtual CPUs per guest > virtual machine". > > So, If I have a server with 64 physical CPUs, and I boot into Xen, with > dom0_max_vcpu set to 1, and I have 2 guest domains, like this: > > Dom0 (1 vcpu) > Guest1 (15 vcpu) > Guest2 (16 vcpu) > > What is the actual correspondence between the virtual CPUs and physical > CPUs?That depends on whether you restrict some VCPUs to only run on some PCPUs. There''s not normally a fixed mapping between VCPUs and PCPUs and so there''s not a requirement that each VCPU ends up running on a separate PCPU (although I''d expect something close to that to happen in the case you describe, especially if the VCPUs were occupied with something computer intensive).> If there is up to 32 vcpus per guest, can I exceed the number of physical > CPUs? For example: > > Dom0 (4 vcpu) > Guest1 (32 vcpu) > Guest2 (32 vcpu) > Guest3 (32 vcpu) > > If I do that, how does Xen operate?VCPUs are to domains as threads are to a process under Unix. VCPUs are the units that get scheduled. If you have more VCPUs in a domain than there are PCPUs then that''s less efficient because those VCPUs will never be able to run in parallel. But the scheduler can cope with it and it might be useful for some kind of testing, or if you migrate an SMP domain to a smaller host temporarily. Cheers, Mark> Thank you very much for your answers. > > ---Kayvan-- Push Me Pull You - Distributed SCM tool (http://www.cl.cam.ac.uk/~maw48/pmpu/) _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users