Bug 1431939 - The host nodes of memdev is set to 128 default
Summary: The host nodes of memdev is set to 128 default
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.4
Hardware: All
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Markus Armbruster
QA Contact: Yumei Huang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-14 05:45 UTC by Min Deng
Modified: 2017-08-02 03:39 UTC (History)
11 users (show)

Fixed In Version: qemu-kvm-rhev-2.9.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-02 03:39:56 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:2392 normal SHIPPED_LIVE Important: qemu-kvm-rhev security, bug fix, and enhancement update 2017-08-01 20:04:36 UTC

Description Min Deng 2017-03-14 05:45:08 UTC
Description of problem:
The host nodes of memdev is set to 128 default via HMP

Version-Release number of selected component (if applicable):
ppc64le
kernel-3.10.0-600.el7.ppc64le
qemu-kvm-rhev-2.8.0-6.el7.ppc64le
SLOF-20160223-6.gitdbbfda4.el7.noarch
x86
kernel-3.10.0-595.el7.x86_64
qemu-kvm-rhev-2.8.0-6.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot up guest with the similar cli
  /usr/libexec/qemu-kvm -name virt-tests-vm1 -sandbox off -machine pseries-rhel7.4.0 -nodefaults -vga std -chardev socket,id=hmp_id_humanmonitor1,path=/tmp/monitor-humanmonitor1-20151207-185515-CKlGrjUv,server,nowait -mon chardev=hmp_id_humanmonitor1,mode=readline -chardev socket,id=qmp_id_qmp1,path=/tmp/monitor-qmp1-20151207-185515-CKlGrjUv,server,nowait -mon chardev=qmp_id_qmp1,mode=control -chardev socket,id=hmp_id_catch_monitor,path=/tmp/monitor-catch_monitor-20151207-185515-CKlGrjUv,server,nowait -mon chardev=hmp_id_catch_monitor,mode=readline -chardev socket,id=serial_id_serial0,path=/tmp/serial-serial0-20151207-185515-CKlGrjUv,server,nowait -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=03,disable-legacy=off,disable-modern=on -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,format=qcow2,file=rhel74-ppc64le-virtio-scsi-latest.qcow2 -device scsi-hd,id=image1,drive=drive_image1  -m 4G,slots=32,maxmem=40G -numa node -qmp tcp:0:4444,server,nowait -vnc :1 -rtc base=utc,clock=host,driftfix=slew -boot order=cdn,once=c,menu=off,strict=off -enable-kvm -monitor stdio -device pci-ohci,id=usb1 -device usb-kbd,id=input0 -device usb-mouse,id=input1 -device usb-tablet,id=input2 -netdev tap,script=/etc/qemu-ifup,downscript=/etc/qemu-down,id=hostnet1,vhost=on -device virtio-net-pci,netdev=hostnet1,id=net1,mac=00:52:11:36:3f:00
2.Hotplug memory
(qemu) object_add memory-backend-ram,id=mem1,size=1G
(qemu) device_add pc-dimm,id=dimm1,memdev=mem1
3.check those devices
(qemu) info memdev
memory backend: 0
  size:  1073741824
  merge: true
  dump: true
  prealloc: false
  policy: default
  host nodes: 128

(qemu) info memdev
memory backend: 0
  size:  1073741824
  merge: true
  dump: true
  prealloc: false
  policy: default
  host nodes: 128

Actual results:
The host nodes is set to 128 but there isn't such nodes on host
[root@ibm-p8-rhevm-17 home]# numactl --hardware
available: 2 nodes (0-1)
node 0 cpus: 0 8 16 24 32
node 0 size: 32768 MB
node 0 free: 19726 MB
node 1 cpus: 40 48 56 64 72
node 1 size: 0 MB
node 1 free: 0 MB
node distances:
node   0   1 
  0:  10  20 
  1:  20  10 
Expected results:
It should be null since no value is provided.


Additional info:
x86 and ppc64le have the same issue.

Comment 3 Yumei Huang 2017-03-17 02:26:58 UTC
Test on x86 host:

Hit same issue with qemu-kvm-rhev-2.8.0-5.el7. 

# /usr/libexec/qemu-kvm -m 4G,slots=40,maxmem=40G  \

-drive file=rhel73.qcow2,format=qcow2,if=none,cache=none,id=drive0 -device virtio-blk-pci,drive=drive0,id=blk0 \

-netdev tap,id=idinWyYp,vhost=on -device virtio-net-pci,mac=42:ce:b9:d2:4d:d7,id=idlbq7eA,netdev=idinWyYp \

-monitor stdio -vnc :1  -serial unix:/tmp/console,server,nowait 

(qemu) object_add memory-backend-ram,id=mem1,size=1G
(qemu) device_add pc-dimm,id=dimm1,memdev=mem1
(qemu) info memdev
memory backend: 0
  size:  1073741824
  merge: true
  dump: true
  prealloc: false
  policy: default
  host nodes: 128

And couldn't reproduce with qemu-kvm-rhev-2.6.0-28.el7 with same qemu cmdline.

(qemu) object_add memory-backend-ram,id=mem1,size=1G
(qemu) device_add pc-dimm,id=dimm1,memdev=mem1
(qemu) info memdev
memory backend: 0
  size:  1073741824
  merge: true
  dump: true
  prealloc: false
  policy: default
  host nodes: 


So it is a regression. Please correct me if I'm wrong.

Comment 5 Min Deng 2017-03-17 02:34:11 UTC
(In reply to Hai Huang from comment #2)
> Deng Min,
> 
> In the Description section you listed packages for ppc64le and x86:
> Version-Release number of selected component (if applicable):
> ppc64le
> kernel-3.10.0-600.el7.ppc64le
> qemu-kvm-rhev-2.8.0-6.el7.ppc64le
> SLOF-20160223-6.gitdbbfda4.el7.noarch
> x86
> kernel-3.10.0-595.el7.x86_64
> qemu-kvm-rhev-2.8.0-6.el7.x86_64
> 
> 
> and the qemu command line was using ppc64le.
> 
> Would you please confirm whether this problem
> also exists for x86.
> 
> Thanks.

Yes,it is reproducible on x86 as well since I have set Hardware to "All" but I would like to give the detail x86 qemu-kvm command here.
For x86,
kernel-3.10.0-600.el7.x86_64
qemu-kvm-rhev-2.8.0-6.el7.x86_64
cli,
...-device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=03,disable-legacy=off,disable-modern=on -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,format=qcow2,file=rhel74-64-virtio-scsi.qcow2 -device scsi-hd,id=image1,drive=drive_image1 -numa node -qmp tcp:0:4444,server,nowait -vnc :1 -rtc base=utc,clock=host,driftfix=slew -boot order=cdn,once=c,menu=off,strict=off -enable-kvm ... -m 1G,slots=4,maxmem=8G -numa node

Steps,
1.Hotplug memory
  (qemu) object_add memory-backend-ram,id=mem1,size=1G
  (qemu) device_add pc-dimm,id=dimm1,memdev=mem1

2.Check memory
  (qemu) info memdev
  memory backend: 0
  size:  1073741824
  merge: true
  dump: true
  prealloc: false
  policy: default
  host nodes: 128

Actual results, host nodes: 128
Expected results,it should not be 128 here since there is no value provided.

Comment 6 Markus Armbruster 2017-03-20 14:58:20 UTC
Upstream commit 74f24cb broke info memdev.  Commit 1454d33 "improved" it from crash bug to incorrect value.

Comment 8 Yumei Huang 2017-04-24 08:45:19 UTC
Verify:
qemu-kvm-rhev-2.9.0-1.el7
kernel-3.10.0-655.el7.x86_64

1. Boot guest
# /usr/libexec/qemu-kvm -m 4G,slots=40,maxmem=40G \

-drive file=rhel74.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none  -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \

-netdev tap,id=idinWyYp -device virtio-net-pci,mac=42:ce:a9:d2:4d:d7,id=idlbq7eA,netdev=idinWyYp \

-vnc :0 -monitor stdio

2. Hotplug memory with default policy
(qemu) object_add memory-backend-ram,id=mem1,size=1G
(qemu) device_add pc-dimm,id=dimm1,memdev=mem1

3. Hotplug memory with bind policy
(qemu) object_add memory-backend-ram,id=mem2,host-nodes=0,size=2G,policy=bind
(qemu) device_add pc-dimm,id=dimm2,memdev=mem2

4. Check memdev via hmp
(qemu) info memdev 
memory backend: mem1
  size:  1073741824
  merge: true
  dump: true
  prealloc: false
  policy: default
  host nodes: 
memory backend: mem2
  size:  2147483648
  merge: true
  dump: true
  prealloc: false
  policy: bind
  host nodes: 0

The host nodes for mem1 is empty, and for mem2 is 0 just as expected. So the bug is fixed.

Comment 10 errata-xmlrpc 2017-08-02 03:39:56 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/RHSA-2017:2392


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