Bug 1819058 - virsh capabilities can't display the real-time number for hugepages
Summary: virsh capabilities can't display the real-time number for hugepages
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.2
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: 8.2
Assignee: Michal Privoznik
QA Contact: Jing Qi
URL:
Whiteboard:
Depends On:
Blocks: 1897025
TreeView+ depends on / blocked
 
Reported: 2020-03-31 06:25 UTC by Jing Qi
Modified: 2021-05-25 06:42 UTC (History)
10 users (show)

Fixed In Version: libvirt-7.0.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-25 06:42:08 UTC
Type: Bug
Target Upstream Version: 7.0.0
Embargoed:


Attachments (Terms of Use)

Description Jing Qi 2020-03-31 06:25:49 UTC
Description of problem:
virsh capabilities can't display the real-time number for hugepages 

Version-Release number of selected component (if applicable):
libvirt-daemon-6.0.0-5.virtcov.el8.x86_64
qemu-kvm-common-4.2.0-10.module+el8.2.0+5740+c3dff59e.x86_64

How reproducible:
Always

Steps to Reproduce:
1.# virsh capabilities |grep 2048
<pages unit='KiB' size='2048'/>
<pages unit='KiB' size='2048'>0</pages>

2.# virsh allocpages 2048 3 

3.
#virsh freepages --all
Node 0:
4KiB: 3988186
2048KiB: 3
1048576KiB: 0

# virsh capabilities |grep 2048
<pages unit='KiB' size='2048'/>
<pages unit='KiB' size='2048'>0</pages>

  
Actual results:

Virsh capabilities can't display the real-time number for the hugepages


Expected results:

Virsh capabilities can display the real-time number for the hugepages

Additional info:

The number can be displayed with libvirtd restarted.
# systemctl restart libvirtd
# virsh capabilities |grep 2048
<pages unit='KiB' size='2048'/>
<pages unit='KiB' size='2048'>3</pages>

The issue is not exist in rhel8.0.1:

libvirt-daemon-5.0.0-12.module+el8.0.1+3755+6782b0ed.x86_64
qemu-kvm-3.1.0-30.module+el8.0.1+4607+7ea9baa9.2.x86_64

Comment 2 Michal Privoznik 2020-12-01 12:29:40 UTC
I think this is the regression caused by us caching host side capabilities (e.g. NUMA) since v6.0.0-rc1~439 and friends. Let me see if I can fix it.

Comment 3 Michal Privoznik 2020-12-01 12:55:06 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2020-December/msg00023.html

Comment 5 Michal Privoznik 2020-12-07 10:35:45 UTC
Merged upstream:

40a162f83e qemu: Don't cache NUMA caps

v6.10.0-114-g40a162f83e

Comment 6 Jing Qi 2020-12-15 05:45:19 UTC
Verified with libvirt upstream version : v6.10.0-206-gbff2ad5d6b
S1:
steps:
1. Check the number of pages of size='2048'. 
# virsh capbilities
Part of output is as following-
<topology>
      <cells num='1'>
        <cell id='0'>
          <memory unit='KiB'>3832548</memory>
          <pages unit='KiB' size='4'>958137</pages>
          <pages unit='KiB' size='2048'>0</pages>
          <pages unit='KiB' size='1048576'>0</pages>
          <distances>
            <sibling id='0' value='10'/>
          </distances>
          <cpus num='2'>
            <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
            <cpu id='1' socket_id='1' die_id='0' core_id='0' siblings='1'/>
          </cpus>
        </cell>
      </cells>
    </topology>

2. echo 200 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages

3. Check the number of pages of size='2048' again.
# virsh capbilities

The number of pages of size='2048' changed to "200". 
<topology>
      <cells num='1'>
        <cell id='0'>
          <memory unit='KiB'>3832548</memory>
          <pages unit='KiB' size='4'>855737</pages>
          <pages unit='KiB' size='2048'>200</pages>
          <pages unit='KiB' size='1048576'>0</pages>
          <distances>
            <sibling id='0' value='10'/>
          </distances>
          <cpus num='2'>
            <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
            <cpu id='1' socket_id='1' die_id='0' core_id='0' siblings='1'/>
          </cpus>
        </cell>
      </cells>
    </topology>

4. # virsh freepages --all
Node 0:
4KiB: 51359
2048KiB: 200
1048576KiB: 0

Comment 10 Jing Qi 2021-01-18 09:35:51 UTC
Verified with version: 
libvirt-daemon-7.0.0-1.module+el8.4.0+9464+3e71831a.x86_64
qemu-kvm-5.2.0-2.module+el8.4.0+9186+ec44380f.x86_64

S1. Check the pages number in the output of "virsh capabilities" can be changed at once

steps:
1. Check the number of pages of size='2048'. 
# virsh capbilities
Part of output is as following-
<topology>
      <cells num='1'>
        <cell id='0'>
          <memory unit='KiB'>3832548</memory>
          <pages unit='KiB' size='4'>958137</pages>
          <pages unit='KiB' size='2048'>0</pages>
          <pages unit='KiB' size='1048576'>0</pages>
          <distances>
            <sibling id='0' value='10'/>
          </distances>
          <cpus num='2'>
            <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
            <cpu id='1' socket_id='1' die_id='0' core_id='0' siblings='1'/>
          </cpus>
        </cell>
      </cells>
    </topology>

2. echo 200 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages

3. Check the number of pages of size='2048' again.
# virsh capbilities

The number of pages of size='2048' changed to "200". 
<topology>
      <cells num='1'>
        <cell id='0'>
          <memory unit='KiB'>3832548</memory>
          <pages unit='KiB' size='4'>855737</pages>
          <pages unit='KiB' size='2048'>200</pages>
          <pages unit='KiB' size='1048576'>0</pages>
          <distances>
            <sibling id='0' value='10'/>
          </distances>
          <cpus num='2'>
            <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
            <cpu id='1' socket_id='1' die_id='0' core_id='0' siblings='1'/>
          </cpus>
        </cell>
      </cells>
    </topology>

4. # virsh freepages --all
Node 0:
4KiB: 51359
2048KiB: 200
1048576KiB: 0

Comment 12 errata-xmlrpc 2021-05-25 06:42:08 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 (virt:av bug fix and enhancement update), 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/RHBA-2021:2098


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