Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1092344

Summary: RHEL7.0 guest os report memory value mismatch with the value reported by qmp query-balloon after evict memory
Product: Red Hat Enterprise Linux 6 Reporter: Xu Tian <xutian>
Component: qemu-kvmAssignee: Luiz Capitulino <lcapitulino>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: acathrow, bsarathy, chayang, juzhang, lcapitulino, michen, mkenneth, qzhang, virt-maint, ypu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-13 17:20:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
monitor.log none

Description Xu Tian 2014-04-29 06:42:49 UTC
Created attachment 890657 [details]
monitor.log

Description of problem:

Boot guest with 2G memory and evict it to 1637M, guest still reported it has 3792M memory but in fact, qemu QMP monitor report it only has 1637M memory.


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


Guest Kernel(RHEL.7.0): Kernel 3.10.0-121.el7.x86_64 on an x86_64
Qemu version: qemu-kvm-rhev-0.12.1.2-2.415.el6_5.8.x86_64
Host kernel version(RHEL.6.6):  kernel-2.6.32-431.el6.x86_64

How reproducible:

less than 40%

Steps to Reproduce:
1. boot rhel7.0 guest with below command:
/usr/bin/qemu-kvm \
    -S  \
    -name 'virt-tests-vm1' \
    -M rhel6.5.0  \
    -nodefaults  \
    -vga cirrus \
    -device AC97,bus=pci.0,addr=03  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/tmp/monitor-qmpmonitor1-20140429-015011-WOPiuDUB,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=serial_id_serial0,path=/tmp/serial-serial0-20140429-015011-WOPiuDUB,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20140429-015011-WOPiuDUB,path=/tmp/seabios-20140429-015011-WOPiuDUB,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20140429-015011-WOPiuDUB,iobase=0x402 \
    -device ich9-usb-uhci1,id=usb1,bus=pci.0,addr=04 \
    -drive id=drive_image1,if=none,cache=none,snapshot=off,aio=native,file=/usr/local/staf/test/RHEV/kvm/autotest-devel/client/tests/virt/shared/data/images/RHEL-Server-7.0-64-virtio.qcow2 \
    -device virtio-blk-pci,id=image1,drive=drive_image1,bootindex=0,bus=pci.0,addr=05 \
    -device virtio-net-pci,mac=9a:38:39:3a:3b:3c,id=id6xqG0A,vectors=4,netdev=idk6eU1g,bus=pci.0,addr=06  \
    -netdev tap,id=idk6eU1g,vhost=on,vhostfd=25,fd=24  \
    -m 2048  \
    -smp 1,maxcpus=1,cores=1,threads=1,sockets=2  \
    -cpu 'Opteron_G3' \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -vnc :0  \
    -rtc base=utc,clock=host,driftfix=slew  \
    -boot order=cdn,once=c,menu=off  \
    -balloon virtio \
    -no-kvm-pit-reinjection \
    -enable-kvm

2. evict guest memory to 1637M by qmp command and monitor memory info in guest and qmp:

  {"execute": "balloon", "arguments": {"value": 1716518912}, "id": "Y7Urc56G"}

query memory info by qmp command:
  {"execute": "query-balloon", "id": "fKdjsrrn"}

query memory info in guest os:
  cat /proc/meminfo |grep MemFree

Actual results:

guest os reported memory value mismatch with the value reported by qmp query-balloon

Expected results:

guest os reported memory value match with the value reported by qmp query-balloon

Additional info:
host memory info:
MemTotal:        3856176 kB
MemFree:         2431332 kB
Buffers:           94884 kB
Cached:          1049796 kB
SwapCached:            0 kB
Active:           655204 kB
Inactive:         551356 kB
Active(anon):      62276 kB
Inactive(anon):        0 kB
Active(file):     592928 kB
Inactive(file):   551356 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:      58720240 kB
SwapFree:       58720240 kB
Dirty:             77724 kB
Writeback:             0 kB
AnonPages:         62040 kB
Mapped:            15724 kB
Shmem:               224 kB
Slab:             123784 kB
SReclaimable:      65812 kB
SUnreclaim:        57972 kB
KernelStack:        1248 kB
PageTables:         4980 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    60648328 kB
Committed_AS:     247540 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      134328 kB
VmallocChunk:   34359599564 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:        6976 kB
DirectMap2M:     2023424 kB
DirectMap1G:     2097152 kB

Comment 1 Xu Tian 2014-04-29 06:44:03 UTC
please refer to another bug#1092226

Comment 3 Luiz Capitulino 2014-05-13 17:20:42 UTC
There are a few reasons for the mismatch. First, what QMP reports will only match with what the guest sees when the balloon operation has completed; if you query those values while the operation is in-flight they will most probably not match. Secondly, you should check MemTotal in the guest and not MemFree.

Comment 9 Xu Tian 2014-05-21 13:55:34 UTC
Sorry to make you confused, it looks I missed copy one step before step1 when fill this bug, let me retest this case.

Thanks,
Xu