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.
Regards,
- Christy