[libvirt] virGetNodeinfo .cpus

virNodeGetInfo() returns .cpus as 2 but the /proc/cpuinfo of the node shows 2 processors with 2 cores each ('cpu cores') . Or maybe the 'core id' is what counts in the /proc/cpuinfo and that one gets vaue 0 , 1 only i.e totally 2 can you clarify ? Here is the output of /proc/cpuinfo: processor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 65 model name : Dual-Core AMD Opteron(tm) Processor 2210 HE stepping : 2 cpu MHz : 1800.034 cache size : 1024 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy bogomips : 3600.06 clflush size : 64 power management: ts fid vid ttp tm stc processor : 1 vendor_id : AuthenticAMD cpu family : 15 model : 65 model name : Dual-Core AMD Opteron(tm) Processor 2210 HE stepping : 2 cpu MHz : 1800.034 cache size : 1024 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 apicid : 1 initial apicid : 1 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy bogomips : 3600.23 clflush size : 64 power management: ts fid vid ttp tm stc Zvi Dubitzky Virtualization and System Architecture Email:dubi@il.ibm.com IBM Haifa Research Laboratory Phone: +972-4-8296182 Haifa, 31905, ISRAEL

Zvi Dubitzky schrieb:
virNodeGetInfo() returns .cpus as 2 but the /proc/cpuinfo of the node shows 2 processors with 2 cores each ('cpu cores') . Or maybe the 'core id' is what counts in the /proc/cpuinfo and that one gets vaue 0 , 1 only i.e totally 2
can you clarify ?
Here is the output of /proc/cpuinfo:
processor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 65 model name : Dual-Core AMD Opteron(tm) Processor 2210 HE stepping : 2 cpu MHz : 1800.034 cache size : 1024 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy bogomips : 3600.06 clflush size : 64 power management: ts fid vid ttp tm stc
processor : 1 vendor_id : AuthenticAMD cpu family : 15 model : 65 model name : Dual-Core AMD Opteron(tm) Processor 2210 HE stepping : 2 cpu MHz : 1800.034 cache size : 1024 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 apicid : 1 initial apicid : 1 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy bogomips : 3600.23 clflush size : 64 power management: ts fid vid ttp tm stc
Zvi Dubitzky Virtualization and System Architecture Email:dubi@il.ibm.com IBM Haifa Research Laboratory Phone: +972-4-8296182 Haifa, 31905, ISRAEL
-- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
An Opteron 2210 HE only has two cores. Yours is a single-CPU. Each core is on Processor, the core-count is of all cores bound together (i.e. in one socket), also called the siblings in /proc/cpuinfo 2x AMD Opteron 2344 => 8 processors, each entry with 4 cores and 4 siblings (2.6.18-92.1.22.el5) 1x Intel Xeon E5405 => 4 processors, each entry with 4 core and 4 sibling (2.6.18-53.el5) 2x Intel Xeon E5450 => 8 processors, each etnry with 4 cores and 4 siblings (2.6.18-53.el5) 1x Intel Core 2 Duo E6550 => 2 processors, each entry with 2 cores and 2 siblings (2.6.18-128.el5) 1x Intel Core 2 Duo 6400 => 2 processors, each entry with 2 cores and 2 siblings (2.6.18-128.1.6.el5) 1x Intel Core 2 Duo T8300 => 2 processors, each entry with 2 cores and 2 siblings (2.6.18-128.el5) Nothing unexpected here. Anyways virNodeGetInfo().cpus returns the correct value in your case and in all mine tested too, it should be obtained iterating over the processor-ids as seen in /proc/cpuinfo. My sole xen-Host returns for his E5405 1 core and 1 sibling for each processor via /proc/cpuinfo.

Gerrit Slomma schrieb:
An Opteron 2210 HE only has two cores. Yours is a single-CPU. Each core is on Processor, the core-count is of all cores bound together (i.e. in one socket), also called the siblings in /proc/cpuinfo
Lots of typos here... To be more specific: An Opteron 2210 HE processor has two cores in one package that could be mounted to one socket. Each core is one processor as reported by /proc/cpuinfo. An Xeon E5405 processor has four cores in one package that could be mounted to one socket. Each core is one processor as reported by /proc/cpuinfo. A CPU is a core.

On Fri, Apr 17, 2009 at 03:43:49PM +0300, Zvi Dubitzky wrote:
virNodeGetInfo() returns .cpus as 2 but the /proc/cpuinfo of the node shows 2 processors with 2 cores each ('cpu cores') . Or maybe the 'core id' is what counts in the /proc/cpuinfo and that one gets vaue 0 , 1 only i.e totally 2
can you clarify ?
What libvirt driver are you using ? QEMU or Xen. The answer can be quite complicated. In essence, for Xen, the /proc/cpuinfo does *not* reflect your actual physical CPU topology. So for Xen we get the real data from the hypervisor directly. For QEMU, libvirt just parses /proc/cpuinfo. Your cpuinfo output below, shows 1 physical CPU with 2 cores
Here is the output of /proc/cpuinfo:
processor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 65 model name : Dual-Core AMD Opteron(tm) Processor 2210 HE stepping : 2 cpu MHz : 1800.034 cache size : 1024 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 apicid : 0 initial apicid : 0 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy bogomips : 3600.06 clflush size : 64 power management: ts fid vid ttp tm stc
processor : 1 vendor_id : AuthenticAMD cpu family : 15 model : 65 model name : Dual-Core AMD Opteron(tm) Processor 2210 HE stepping : 2 cpu MHz : 1800.034 cache size : 1024 KB physical id : 0 siblings : 2 core id : 1 cpu cores : 2 apicid : 1 initial apicid : 1 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy bogomips : 3600.23 clflush size : 64 power management: ts fid vid ttp tm stc
Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Daniel P. Berrange
-
Gerrit Slomma
-
Zvi Dubitzky