Bug 1472561 - Adding memory logic are not consistent while adding memory exceeds host maximum value
Adding memory logic are not consistent while adding memory exceeds host maxim...
Status: CLOSED DUPLICATE of bug 1432332
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.4-Alt
All Unspecified
medium Severity medium
: rc
: ---
Assigned To: Igor Mammedov
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-18 22:46 EDT by Min Deng
Modified: 2017-07-20 04:24 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-07-20 04:24:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Min Deng 2017-07-18 22:46:19 EDT
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 2 Min Deng 2017-07-18 22:47:49 EDT
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 3 Min Deng 2017-07-18 23:00:59 EDT
Description of problem:
Adding memory logic are not consistent while adding memory exceeds host maximum value.

Version-Release number of selected component (if applicable):
Build info,
kernel-4.11.0-10.el7a.ppc64le
qemu-kvm-2.9.0-17.el7a.ppc64le

How reproducible:
1/1

Steps,
1.boot up guest with the following cli and the host has about 32G memory
  /usr/libexec/qemu-kvm -name mdeng -sandbox off -machine pseries-rhel7.4.0 -nodefaults -vga none -chardev socket,id=serial_id_serial0,path=/tmp/tt,server,nowait -device spapr-vty,reg=0x30000000,chardev=serial_id_serial0 -device nec-usb-xhci,id=usb1,bus=pci.0,addr=0x3 -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x4 -drive id=drive_image1,if=none,snapshot=off,aio=native,cache=none,format=qcow2,file=memory.qcow2 -device scsi-hd,id=image1,drive=drive_image1 -device virtio-net-pci,mac=9a:2b:2c:2d:2e:2f,id=id6b5tKj,vectors=4,netdev=idXB7qte,bus=pci.0,addr=0x5 -netdev tap,id=idXB7qte,vhost=on,script=/etc/qemu-ifup,downscript=/etc/qemu-down,id=hostnet1 -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 -vnc :11 -rtc base=utc,clock=host -enable-kvm -monitor stdio -qmp tcp:0:4441,server,nowait -m 4G,slots=256,maxmem=80G -numa node

2.add memory from HMP
(qemu)object_add memory-backend-ram,id=mem1,size=50G (50G+4G > 32G)
      cannot set up guest memory 'mem1': Cannot allocate memory

3.add memory from HMP again but at this time it reduced to 30G for twice
(qemu) object_add memory-backend-ram,id=mem1,size=30G 
(qemu) device_add pc-dimm,id=dimm1,memdev=mem1
(qemu) info memory-devices 
Memory device [dimm]: "dimm1"
  addr: 0x100000000
  slot: 0
  node: 0
  size: 32212254720
  memdev: /objects/mem1
  hotplugged: true
  hotpluggable: true

(qemu) object_add memory-backend-ram,id=mem2,size=30G
(qemu) device_add pc-dimm,id=dimm2,memdev=mem2

Actual results:
The memory of guest became 
[root@localhost home]# free -m
              total        used        free      shared  buff/cache   available
Mem:          63394         315       62788          13         290       62605

For the first time,it was 50G it was forbidden since it cannot allocate memory.(Host memory is only about 32G here)
For the second time and third time,in total they were 60G.The memory still could be added to guest successfully.It's a bit strange.

The logic should be double checked here where adding memory.
Expected results:
The memory should not be added successfully after the second time and third time.
Comment 4 Min Deng 2017-07-18 23:12:41 EDT
QE will update other platform's results as soon as possible.
Comment 5 Min Deng 2017-07-19 02:11:35 EDT
The latest test results born out and the issue also can be reproduced on the following platform&builds
1.P8 + RHEL7.4  
  kernel-3.10.0-689.el7.ppc64le
  qemu-kvm-rhev-2.9.0-14.el7.ppc64le
2.x86 + RHEL7.4
  kernel-3.10.0-690.el7.x86_64
  qemu-kvm-rhev-2.9.0-14.el7.x86_64
3.P8 + Pegas
  kernel-4.11.0-10.el7a.x86_64
  qemu-kvm-2.9.0-16.el7a.x86_64

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