[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCHv2 4/5] S390: Fixed core identification for s390



On Fri, Jun 22, 2012 at 01:50:13PM +0200, Viktor Mihajlovski wrote:
> For the s390x architecture the sysfs core_id alone is not unique. As a
> result it can happen that libvirt thinks there are less host CPUs available
> than really present.
> Currently, a logical CPU is equivalent to a core for s390x. We therefore
> produce a fake core id from the CPU number.
> 
> Signed-off-by: Viktor Mihajlovski <mihajlov linux vnet ibm com>
> ---
>  src/nodeinfo.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/src/nodeinfo.c b/src/nodeinfo.c
> index 7eb5ae5..819f954 100644
> --- a/src/nodeinfo.c
> +++ b/src/nodeinfo.c
> @@ -355,7 +355,13 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo,
>          nodeinfo->cpus++;
>  
>          /* Parse core */
> +# if defined(__s390__) || \
> +    defined(__s390x__)
> +    /* logical cpu is equivalent to a core on s390 */
> +        core = cpu;
> +# else
>          core = virNodeGetCpuValue(sysfs_cpudir, cpu, "topology/core_id", false);
> +# endif
>          if (!CPU_ISSET(core, &core_mask)) {
>              CPU_SET(core, &core_mask);
>              nodeinfo->cores++;

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]