[Kimchi-devel] CPU discussion (RE: psutil.NUM_CPUS)

Ramon Medeiros ramonn at linux.vnet.ibm.com
Thu Jan 29 13:52:13 UTC 2015


On 11/11/2014 07:31 PM, Christy Perez wrote:
> After my confusion on Paulo's patch a few weeks ago, I thought I had
> just gotten confused, and so I put psutil.NUM_CPUS in my SMT/HT patch.
> However, testing now on x86, I'm noticing a difference in the way Power
> and x86 report CPUS.
>
> On my laptop:
>
>   <cpu>
>     <arch>x86_64</arch>
>     <model>SandyBridge</model>
>     <vendor>Intel</vendor>
>     <topology sockets='1' cores='2' threads='2'/>
>
> psutil.NUM_CPUS returns 4
>
> On a Power7 system with 16 cores, 4 threads/core (so 64 total threads),
> psutil.NUM_CPUS returns 16.
>
> And this is, it turns out, because (and this sounds odd) for *guests* to
> be able to do SMT on Power, SMT has to be disabled. So, psutil.NUM_CPUS
> will not report the number of vCPUs that are available to guests. The
> same change would happen on x86 if you disabled HT, I assume.
>
> So, revisiting this difference that I noticed but wasn't able to
> articulate very well last time, do we want to make a change to the host
> code to use ppc64_cpu if the arch is Power, instead of psutil.NUM_CPUS?
> SMT *is* off, so, technically this isn't correct, but I think we should
> provide this information with guests in mind since we are a
> virtualization platform.
why not use cpuinfo to determine the cpus? we are duplicating code today
>
> Regards,
>
> - Christy
>
> _______________________________________________
> Kimchi-devel mailing list
> Kimchi-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/kimchi-devel
>


-- 
Ramon Nunes Medeiros
Kimchi Developer
Software Engineer - Linux Technology Center Brazil
IBM Systems & Technology Group
Phone : +55 19 2132 7878
ramonn at br.ibm.com




More information about the Kimchi-devel mailing list