Hello, I searched the mail list, but can''t find a solution. I have a machine with 8 cores. I want to set the CPU affinity for dom0. For example, let Dom0 use processor 0-3, let guests use 4-7 For guest domains, I can do this by setting the "cpus" For dom0. there''s no such option. The only one I know is in /etc/xen- config.sxp, which has "dom0-cpus" setting. Someone suggests that " *by setting (com0-cpus n), where n is the *>* number of CPU''s* >* > you want to use. It picks from the low to high numbers, so * >* you if you* >* > set it to 1, it will pick CPU0, if you set it to 3, it will * >* pick CPU0,* >* > CPU1, CPU2, and so on.* However, it seems not working for me. I set (dom0-cpus 4), pin cpu 4 to dom1, cpu 6 to dom2: sudo xm vcpu-list Name ID VCPU CPU State Time(s) CPU Affinity Domain-0 0 0 1 r-- 10.3 any cpu Domain-0 0 1 5 -b- 2.6 any cpu Domain-0 0 2 2 -b- 1.1 any cpu Domain-0 0 3 4 -b- 1.6 any cpu Domain-0 0 4 - --p 0.6 any cpu Domain-0 0 5 - --p 0.6 any cpu Domain-0 0 6 - --p 0.4 any cpu Domain-0 0 7 - --p 0.6 any cpu dom1 1 0 4 -b- 7.7 4 dom2 2 0 6 -b- 7.6 6 So, dom0 is actually using CPU 1,2,4,5 instead of 0,1,2,3 Then I added "maxcpus=4" in the grub file kernel /boot/xen.gz console=vga maxcpus=4 After reboot, sudo xm vcpu-list Name ID VCPU CPU State Time(s) CPU Affinity Domain-0 0 0 0 r-- 8.0 any cpu Domain-0 0 1 3 -b- 2.3 any cpu Domain-0 0 2 1 -b- 1.4 any cpu Domain-0 0 3 2 -b- 1.1 any cpu It looks good. but when I tried to startup the guests, I got error: sudo xm create xm1 Using config file "./xm1". Error: (22, ''Invalid argument'') Any ideas? Thanks, Weiming _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
I found a post http://lists.xensource.com/archives/html/xen-users/2006-02/msg00874.html Following the post, after I moved "maxcpus=4" from the kernel line to the module line in the grub file, still no success. sudo xm vcpu-list Name ID VCPU CPU State Time(s) CPU Affinity Domain-0 0 0 0 r-- 11.8 any cpu Domain-0 0 1 4 -b- 6.2 any cpu Domain-0 0 2 7 -b- 1.4 any cpu Domain-0 0 3 7 -b- 1.8 any cpu Domain-0 0 4 - --p 0.0 any cpu Domain-0 0 5 - --p 0.0 any cpu Domain-0 0 6 - --p 0.0 any cpu Domain-0 0 7 - --p 0.0 any cpu dom1 1 0 4 -b- 26.0 4 dom2 2 0 6 r-- 17.3 6 Sometime, Dom0 and guests still runs on same physical cpu. Somethime, they runs on separate cpus. Is there any way to pin dom0 to specific CPUs? Thanks, Weiming On Fri, Feb 15, 2008 at 11:57 AM, weiming <zephyr.zhao@gmail.com> wrote:> Hello, > > I searched the mail list, but can''t find a solution. > > I have a machine with 8 cores. I want to set the CPU affinity for dom0. > For example, let Dom0 use processor 0-3, let guests use 4-7 > > For guest domains, I can do this by setting the "cpus" > For dom0. there''s no such option. The only one I know is in /etc/xen- > config.sxp, which has "dom0-cpus" setting. Someone suggests that " > > *by setting (com0-cpus n), where n is the * > >* number of CPU''s* > > >* > you want to use. It picks from the low to high numbers, so * > >* you if you* > >* > set it to 1, it will pick CPU0, if you set it to 3, it will * > >* pick CPU0,* > >* > CPU1, CPU2, and so on. > * > However, it seems not working for me. I set (dom0-cpus 4), pin cpu 4 to dom1, cpu 6 to dom2: > sudo xm vcpu-list > Name ID VCPU CPU State Time(s) CPU Affinity > Domain-0 0 0 1 r-- 10.3 any cpu > > Domain-0 0 1 5 -b- 2.6 any cpu > Domain-0 0 2 2 -b- 1.1 any cpu > Domain-0 0 3 4 -b- 1.6 any cpu > > Domain-0 0 4 - --p 0.6 any cpu > Domain-0 0 5 - --p 0.6 any cpu > Domain-0 0 6 - --p 0.4 any cpu > > Domain-0 0 7 - --p 0.6 any cpu > dom1 1 0 4 -b- 7.7 4 > dom2 2 0 6 -b- 7.6 6 > > So, dom0 is actually using CPU 1,2,4,5 instead of 0,1,2,3 > > Then I added "maxcpus=4" in the grub file > kernel /boot/xen.gz console=vga maxcpus=4 > > After reboot, > sudo xm vcpu-list > Name ID VCPU CPU State Time(s) CPU Affinity > > Domain-0 0 0 0 r-- 8.0 any cpu > Domain-0 0 1 3 -b- 2.3 any cpu > Domain-0 0 2 1 -b- 1.4 any cpu > > Domain-0 0 3 2 -b- 1.1 any cpu > > It looks good. but when I tried to startup the guests, I got error: > sudo xm create xm1 > Using config file "./xm1". > Error: (22, ''Invalid argument'') > > Any ideas? > > Thanks, > Weiming > > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Here''s what I did to pin dom0 cpus: virsh vcpupin 0 0 0 virsh vcpupin 0 1 1 Where the first # is the domain, the second is the vcpu inside the domain, and the third is the machine cpu core. I am now going to add cpus=^0-1 to all of my vm configs so they won''t try to use either of those cores. I have not yet tested to see whether this persists after a reboot. If anyone knows, let us all know. Thanks. weiming wrote:> > Hello, > > I searched the mail list, but can''t find a solution. > > I have a machine with 8 cores. I want to set the CPU affinity for dom0. > For > example, let Dom0 use processor 0-3, let guests use 4-7 > > For guest domains, I can do this by setting the "cpus" > For dom0. there''s no such option. The only one I know is in /etc/xen- > config.sxp, which has "dom0-cpus" setting. Someone suggests that " > > *by setting (com0-cpus n), where n is the * >>* number of CPU''s* >>* > you want to use. It picks from the low to high numbers, so * >>* you if you* >>* > set it to 1, it will pick CPU0, if you set it to 3, it will * >>* pick CPU0,* >>* > CPU1, CPU2, and so on. > * > However, it seems not working for me. I set (dom0-cpus 4), pin cpu 4 > to dom1, cpu 6 to dom2: > sudo xm vcpu-list > Name ID VCPU CPU State Time(s) CPU > Affinity > Domain-0 0 0 1 r-- 10.3 any cpu > Domain-0 0 1 5 -b- 2.6 any cpu > Domain-0 0 2 2 -b- 1.1 any cpu > Domain-0 0 3 4 -b- 1.6 any cpu > Domain-0 0 4 - --p 0.6 any cpu > Domain-0 0 5 - --p 0.6 any cpu > Domain-0 0 6 - --p 0.4 any cpu > Domain-0 0 7 - --p 0.6 any cpu > dom1 1 0 4 -b- 7.7 4 > dom2 2 0 6 -b- 7.6 6 > > So, dom0 is actually using CPU 1,2,4,5 instead of 0,1,2,3 > > Then I added "maxcpus=4" in the grub file > kernel /boot/xen.gz console=vga maxcpus=4 > > After reboot, > sudo xm vcpu-list > Name ID VCPU CPU State Time(s) CPU > Affinity > Domain-0 0 0 0 r-- 8.0 any cpu > Domain-0 0 1 3 -b- 2.3 any cpu > Domain-0 0 2 1 -b- 1.4 any cpu > Domain-0 0 3 2 -b- 1.1 any cpu > > It looks good. but when I tried to startup the guests, I got error: > sudo xm create xm1 > Using config file "./xm1". > Error: (22, ''Invalid argument'') > > Any ideas? > > Thanks, > Weiming > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >-- View this message in context: http://www.nabble.com/Pin-CPU-of-dom0-tp15505543p15548079.html Sent from the Xen - User mailing list archive at Nabble.com. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Thanks! is "virsh" the same as "xm"? I tried "xm vcpu-pin". It works until the machine is rebooted. But the effect of vm configs are persist. Thank you, weiming On Mon, Feb 18, 2008 at 2:33 PM, msennott <MSennott@tribune.com> wrote:> > Here''s what I did to pin dom0 cpus: > > virsh vcpupin 0 0 0 > virsh vcpupin 0 1 1 > > Where the first # is the domain, the second is the vcpu inside the domain, > and the third is the machine cpu core. > > I am now going to add cpus=^0-1 to all of my vm configs so they won''t try > to > use either of those cores. > > I have not yet tested to see whether this persists after a reboot. If > anyone > knows, let us all know. > > Thanks. > > > weiming wrote: > > > > Hello, > > > > I searched the mail list, but can''t find a solution. > > > > I have a machine with 8 cores. I want to set the CPU affinity for dom0. > > For > > example, let Dom0 use processor 0-3, let guests use 4-7 > > > > For guest domains, I can do this by setting the "cpus" > > For dom0. there''s no such option. The only one I know is in /etc/xen- > > config.sxp, which has "dom0-cpus" setting. Someone suggests that " > > > > *by setting (com0-cpus n), where n is the * > >>* number of CPU''s* > >>* > you want to use. It picks from the low to high numbers, so * > >>* you if you* > >>* > set it to 1, it will pick CPU0, if you set it to 3, it will * > >>* pick CPU0,* > >>* > CPU1, CPU2, and so on. > > * > > However, it seems not working for me. I set (dom0-cpus 4), pin cpu 4 > > to dom1, cpu 6 to dom2: > > sudo xm vcpu-list > > Name ID VCPU CPU State Time(s) CPU > > Affinity > > Domain-0 0 0 1 r-- 10.3 any > cpu > > Domain-0 0 1 5 -b- 2.6 any > cpu > > Domain-0 0 2 2 -b- 1.1 any > cpu > > Domain-0 0 3 4 -b- 1.6 any > cpu > > Domain-0 0 4 - --p 0.6 any > cpu > > Domain-0 0 5 - --p 0.6 any > cpu > > Domain-0 0 6 - --p 0.4 any > cpu > > Domain-0 0 7 - --p 0.6 any > cpu > > dom1 1 0 4 -b- 7.7 4 > > dom2 2 0 6 -b- 7.6 6 > > > > So, dom0 is actually using CPU 1,2,4,5 instead of 0,1,2,3 > > > > Then I added "maxcpus=4" in the grub file > > kernel /boot/xen.gz console=vga maxcpus=4 > > > > After reboot, > > sudo xm vcpu-list > > Name ID VCPU CPU State Time(s) CPU > > Affinity > > Domain-0 0 0 0 r-- 8.0 any > cpu > > Domain-0 0 1 3 -b- 2.3 any > cpu > > Domain-0 0 2 1 -b- 1.4 any > cpu > > Domain-0 0 3 2 -b- 1.1 any > cpu > > > > It looks good. but when I tried to startup the guests, I got error: > > sudo xm create xm1 > > Using config file "./xm1". > > Error: (22, ''Invalid argument'') > > > > Any ideas? > > > > Thanks, > > Weiming > > > > _______________________________________________ > > Xen-users mailing list > > Xen-users@lists.xensource.com > > http://lists.xensource.com/xen-users > > > > -- > View this message in context: > http://www.nabble.com/Pin-CPU-of-dom0-tp15505543p15548079.html > Sent from the Xen - User mailing list archive at Nabble.com. > > > _______________________________________________ > 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
virsh is the tool provided with lib-virt rpm on RHEL. I know that it talks to xm, but not sure if it is doing other things under the covers. ________________________________ From: weiming [mailto:zephyr.zhao@gmail.com] Sent: Friday, February 22, 2008 9:58 AM To: Sennott, Mark Cc: xen-users@lists.xensource.com Subject: Re: [Xen-users] Pin CPU of dom0 Thanks! is "virsh" the same as "xm"? I tried "xm vcpu-pin". It works until the machine is rebooted. But the effect of vm configs are persist. Thank you, weiming On Mon, Feb 18, 2008 at 2:33 PM, msennott <MSennott@tribune.com> wrote: Here''s what I did to pin dom0 cpus: virsh vcpupin 0 0 0 virsh vcpupin 0 1 1 Where the first # is the domain, the second is the vcpu inside the domain, and the third is the machine cpu core. I am now going to add cpus=^0-1 to all of my vm configs so they won''t try to use either of those cores. I have not yet tested to see whether this persists after a reboot. If anyone knows, let us all know. Thanks. weiming wrote: > > Hello, > > I searched the mail list, but can''t find a solution. > > I have a machine with 8 cores. I want to set the CPU affinity for dom0. > For > example, let Dom0 use processor 0-3, let guests use 4-7 > > For guest domains, I can do this by setting the "cpus" > For dom0. there''s no such option. The only one I know is in /etc/xen- > config.sxp, which has "dom0-cpus" setting. Someone suggests that " > > *by setting (com0-cpus n), where n is the * >>* number of CPU''s* >>* > you want to use. It picks from the low to high numbers, so * >>* you if you* >>* > set it to 1, it will pick CPU0, if you set it to 3, it will * >>* pick CPU0,* >>* > CPU1, CPU2, and so on. > * > However, it seems not working for me. I set (dom0-cpus 4), pin cpu 4 > to dom1, cpu 6 to dom2: > sudo xm vcpu-list > Name ID VCPU CPU State Time(s) CPU > Affinity > Domain-0 0 0 1 r-- 10.3 any cpu > Domain-0 0 1 5 -b- 2.6 any cpu > Domain-0 0 2 2 -b- 1.1 any cpu > Domain-0 0 3 4 -b- 1.6 any cpu > Domain-0 0 4 - --p 0.6 any cpu > Domain-0 0 5 - --p 0.6 any cpu > Domain-0 0 6 - --p 0.4 any cpu > Domain-0 0 7 - --p 0.6 any cpu > dom1 1 0 4 -b- 7.7 4 > dom2 2 0 6 -b- 7.6 6 > > So, dom0 is actually using CPU 1,2,4,5 instead of 0,1,2,3 > > Then I added "maxcpus=4" in the grub file > kernel /boot/xen.gz console=vga maxcpus=4 > > After reboot, > sudo xm vcpu-list > Name ID VCPU CPU State Time(s) CPU > Affinity > Domain-0 0 0 0 r-- 8.0 any cpu > Domain-0 0 1 3 -b- 2.3 any cpu > Domain-0 0 2 1 -b- 1.4 any cpu > Domain-0 0 3 2 -b- 1.1 any cpu > > It looks good. but when I tried to startup the guests, I got error: > sudo xm create xm1 > Using config file "./xm1". > Error: (22, ''Invalid argument'') > > Any ideas? > > Thanks, > Weiming > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > -- View this message in context: http://www.nabble.com/Pin-CPU-of-dom0-tp15505543p15548079.html Sent from the Xen - User mailing list archive at Nabble.com. _______________________________________________ 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