RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1456793 - virsh nodecpumap shows wrong cpus present output
Summary: virsh nodecpumap shows wrong cpus present output
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.4
Hardware: All
OS: Linux
high
low
Target Milestone: rc
: 7.4
Assignee: Peter Krempa
QA Contact: Luyao Huang
URL:
Whiteboard:
: 1459050 (view as bug list)
Depends On:
Blocks: 1446211
TreeView+ depends on / blocked
 
Reported: 2017-05-30 11:41 UTC by Peter Krempa
Modified: 2017-08-02 01:34 UTC (History)
11 users (show)

Fixed In Version: libvirt-3.2.0-7.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-02 01:34:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1846 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2017-08-01 18:02:50 UTC

Description Peter Krempa 2017-05-30 11:41:15 UTC
+++ This bug was initially created as a clone of Bug #1455284 +++

Description of problem:
virsh nodecpumap ignores the last cores offline cpus and shows wrong value for cpus present and map field

Actual:
# virsh nodecpumap
CPUs present:   153
CPUs online:    20
CPU map:        y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y

Expected:
CPUs present:   160
CPUs online:    20
CPU map:        y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------

# lscpu
Architecture:          ppc64le
Byte Order:            Little Endian
CPU(s):                160
On-line CPU(s) list:   0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120,128,136,144,152
Off-line CPU(s) list:  1-7,9-15,17-23,25-31,33-39,41-47,49-55,57-63,65-71,73-79,81-87,89-95,97-103,105-111,113-119,121-127,129-135,137-143,145-151,153-159
Thread(s) per core:    1
Core(s) per socket:    5
Socket(s):             4
NUMA node(s):          4
Model:                 2.1 (pvr 004b 0201)
Model name:            POWER8E (raw), altivec supported
L1d cache:             64K
L1i cache:             32K
L2 cache:              512K
L3 cache:              8192K
NUMA node0 CPU(s):     0,8,16,24,32
NUMA node1 CPU(s):     40,48,56,64,72
NUMA node16 CPU(s):    80,88,96,104,112
NUMA node17 CPU(s):    120,128,136,144,152


Version-Release number of selected component (if applicable):
# virsh version
Compiled against library: libvirt 3.4.0
Using library: libvirt 3.4.0
Using API: QEMU 3.4.0
Running hypervisor: QEMU 2.9.50


How reproducible:
Always

Steps to Reproduce:
1.# virsh nodecpumap

Actual results:
CPUs present:   153
CPUs online:    20
CPU map:        y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y


Expected results:
CPUs present:   160
CPUs online:    20
CPU map:        y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------y-------


Additional info:

--- Additional comment from Peter Krempa on 2017-05-30 10:43:53 CEST ---

Fixed upstream:

commit 4ae0f65669a6672a408e08698678ed2958a77fde
Author: Nitesh Konkar <niteshkonkar.libvirt>
Date:   Thu May 25 15:47:43 2017 +0530

    util: hostcpu: Correctly report total number of vcpus in virHostCPUGetMap
    
    Callers expect the return value to be the total number of vcpus in the
    host (including offline vcpus). The refactor in c67e04e25fa58104e0fae41
    broke this assumption by using virHostCPUGetOnlineBitmap which only
    creates a bitmap long enough to hold the last online vcpu.
    
    Report the full number of host vcpus by returning value from
    virHostCPUGetCount().

Comment 4 Luyao Huang 2017-06-01 09:18:34 UTC
I can reproduce this issue on libvirt-3.2.0-6.el7.x86_64:

# virsh nodecpumap
CPUs present:   16
CPUs online:    16
CPU map:        yyyyyyyyyyyyyyyy

# echo 0 > /sys/devices/system/cpu/cpu15/online

# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                16
On-line CPU(s) list:   0-14
Off-line CPU(s) list:  15
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             2
NUMA node(s):          4
Vendor ID:             AuthenticAMD
CPU family:            21
Model:                 2
Model name:            AMD Opteron(tm) Processor 6320
Stepping:              0
CPU MHz:               2800.000
CPU max MHz:           2800.0000
CPU min MHz:           1400.0000
BogoMIPS:              5586.17
Virtualization:        AMD-V
L1d cache:             16K
L1i cache:             64K
L2 cache:              2048K
L3 cache:              6144K
NUMA node0 CPU(s):     0,2,4,6
NUMA node1 CPU(s):     8,10,12,14
NUMA node2 CPU(s):     1,3,5,7
NUMA node3 CPU(s):     9,11,13

# virsh nodecpumap
CPUs present:   15
CPUs online:    15
CPU map:        yyyyyyyyyyyyyyy


And verify this issue on libvirt-3.2.0-7.el7.x86_64:

1. # echo 0 > /sys/devices/system/cpu/cpu15/online 

2. # virsh nodecpumap
CPUs present:   16
CPUs online:    15
CPU map:        yyyyyyyyyyyyyyy-

Comment 5 Peter Krempa 2017-06-06 07:54:04 UTC
*** Bug 1459050 has been marked as a duplicate of this bug. ***

Comment 6 IBM Bug Proxy 2017-07-14 04:40:23 UTC
------- Comment From satheera.com 2017-07-14 00:39 EDT-------
Verified on libvirt-3.2.0-15.el7a.ppc64le
and working fine.
Closing.

# virsh nodecpumap --pretty
CPUs online:    16
CPU map:        0-15

[root@ltc-boston8 ~]# virsh nodecpumap --pretty
CPUs present:   16
CPU map:        0-14

#echo 1 > /sys/devices/system/cpu/cpu15/online
# virsh nodecpumap --pretty
CPUs present:   16
CPUs online:    16
CPU map:        0-15

# rpm -qa|grep libvirt-[0-9]
libvirt-3.2.0-15.el7a.ppc64le

Comment 7 errata-xmlrpc 2017-08-02 01:34:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:1846


Note You need to log in before you can comment on or make changes to this bug.