[Kimchi-devel] [PATCH] Number of CPUs in Host's Basic Information.
Christy Perez
christy at linux.vnet.ibm.com
Wed Oct 29 15:39:42 UTC 2014
On 10/29/2014 05:53 AM, Paulo Ricardo Paz Vital wrote:
> Christy,
>
> psutil.NUM_CPUS reflect the **online** (as described on commit message
> and documentation) cores. This is the same number that the host OS
> recognize to all operations, that means, the same number of available
> cores on /proc/cpu_info and the same number of the command "ppc64_cpu
> --cores-on".
>
> This patch goal is provide to user the information of how many available
> cores the host system has at runtime. I still support this patch to
> reflect this new information.
Disregard this e-mail. I thought I was getting different numbers on the
system I checked, but, I must have been tired.
This patch is fine.
Regards
- Christy
>
> Regards,
> -- Paulo Ricardo Paz Vital <pvital at linux.vnet.ibm.com> IBM Linux
> Technology Center On Tue, 2014-10-28 at 13:39 -0500, Christy Perez wrote:
>> > On Power, this doesn't seem to reflect the real number of cores.
>> >
>>>>> > >>> print psutil.NUM_CPUS
>> > 14
>> >
>> > So are we going for CPUs (and let the user figure out how many virtual
>> > CPUs he/she can consoume), or cores (which I think is more useful)?
>> >
>> > For SMT/hyperthreading , I'm using ppc64_cpu and virsh capabilities:
>> >
>> > <capabilities>
>> >
>> > <host>
>> > <uuid>412bb869-1795-46e9-9bb3-dfe12f3bb45d</uuid>
>> > <cpu>
>> > <arch>x86_64</arch>
>> > <model>SandyBridge</model>
>> > <vendor>Intel</vendor>
>> > <topology sockets='1' cores='2' threads='2'/>
>> >
>> >
>> > $ ppc64_cpu --cores-on
>> >
>> > On 10/27/2014 03:45 PM, Paulo Vital wrote:
>>> > > Support to provide the information of the number of online CPUs
>>> > > present in the Host system.
>>> > >
>>> > > Also, updated English help page to express the new information.
>>> > >
>>> > > Signed-off-by: Paulo Vital <pvital at linux.vnet.ibm.com>
>>> > > ---
>>> > > src/kimchi/model/host.py | 1 +
>>> > > ui/pages/help/en_US/host.dita | 4 ++--
>>> > > ui/pages/tabs/host.html.tmpl | 4 ++++
>>> > > 3 files changed, 7 insertions(+), 2 deletions(-)
>>> > >
>>> > > diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py
>>> > > index 1bc3ca2..ca197c1 100644
>>> > > --- a/src/kimchi/model/host.py
>>> > > +++ b/src/kimchi/model/host.py
>>> > > @@ -89,6 +89,7 @@ class HostModel(object):
>>> > > res['cpu'] = line.split(':')[1].strip()
>>> > > break
>>> > >
>>> > > + res['num_cpu'] = psutil.NUM_CPUS
>>> > > res['memory'] = psutil.TOTAL_PHYMEM
>>> > >
>>> > > # Include IBM PowerKVM name to supported distro names
>>> > > diff --git a/ui/pages/help/en_US/host.dita b/ui/pages/help/en_US/host.dita
>>> > > index 335c51c..0dcb670 100644
>>> > > --- a/ui/pages/help/en_US/host.dita
>>> > > +++ b/ui/pages/help/en_US/host.dita
>>> > > @@ -24,8 +24,8 @@ to the host system, if it is not already connected.</li>
>>> > > <dlentry>
>>> > > <dt>Basic information</dt>
>>> > > <dd>This section displays the host operating system distribution,
>>> > > -version, and code name, as well as the processor type and amount of
>>> > > -memory in GB.</dd>
>>> > > +version, and code name, as well as the processor type, the number of
>>> > > +online CPUs and amount of memory in GB.</dd>
>>> > > </dlentry><dlentry>
>>> > > <dt>System statistics</dt>
>>> > > <dd>This section displays graphs to show statistics for CPU, memory,
>>> > > diff --git a/ui/pages/tabs/host.html.tmpl b/ui/pages/tabs/host.html.tmpl
>>> > > index 8641962..57c7cee 100644
>>> > > --- a/ui/pages/tabs/host.html.tmpl
>>> > > +++ b/ui/pages/tabs/host.html.tmpl
>>> > > @@ -75,6 +75,10 @@
>>> > > <div class="section-value">{cpu}</div>
>>> > > </div>
>>> > > <div class="section-row">
>>> > > + <div class="section-label">$_("CPU(s)")</div>
>>> > > + <div class="section-value">{num_cpu}</div>
>>> > > + </div>
>>> > > + <div class="section-row">
>>> > > <div class="section-label">$_("Memory")</div>
>>> > > <div class="section-value">{memory}</div>
>>> > > </div>
>>> > >
>> >
>> > _______________________________________________
>> > Kimchi-devel mailing list
>> > Kimchi-devel at ovirt.org
>> > http://lists.ovirt.org/mailman/listinfo/kimchi-devel
>> >
>
More information about the Kimchi-devel
mailing list