Bug 1006027
Summary: | -mem-prealloc option behaviour is opposite to expected | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Volodymyr G. Lukiianyk <volodymyrgl> | ||||
Component: | qemu-kvm | Assignee: | Andrea Arcangeli <aarcange> | ||||
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | ||||
Severity: | low | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 6.5 | CC: | aarcange, bsarathy, chayang, coli, juzhang, michen, mkenneth, qzhang, rbalakri, tlavigne, virt-maint, xfu, ypu | ||||
Target Milestone: | rc | ||||||
Target Release: | --- | ||||||
Hardware: | x86_64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | qemu-kvm-0.12.1.2-2.442.el6 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2014-10-14 06:50:44 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
Volodymyr G. Lukiianyk
2013-09-09 19:54:20 UTC
Volodymyr, thanks for taking the time to enter a bug report with us and for all the references and patches. We appreciate the feedback and look to use reports such as this to guide our efforts at improving our products. That being said, we're not able to guarantee the timeliness or suitability of a resolution for issues entered here because this is not a mechanism for requesting support. If this issue is critical or in any way time sensitive, please raise a ticket through your regular Red Hat support channels to make certain it receives the proper attention and prioritization to assure a timely resolution. For information on how to contact the Red Hat production support team, please visit: https://www.redhat.com/support/process/production/#howto If I understand correctly all that is required is to initialize mem_prealloc = 0. Upstream qemu doesn't use MAP_POPULATE anymore, but it preallocates only if -mem-prealloc is passed. vl.c:int mem_prealloc = 0; /* force preallocation of physical target memory */ exec.c: if (mem_prealloc) { exec.c: os_mem_prealloc(fd, area, memory); vl.c: case QEMU_OPTION_mem_prealloc: vl.c: mem_prealloc = 1; (they forgot to update the comment) I attached a patch that should fix the problem, can you test it? Otherwise I can provide an RPM next Monday (holyday here tomorrow). Created attachment 926919 [details]
fix -mem-prealloc to match upstream semantics
Fix included in qemu-kvm-0.12.1.2-2.442.el6 Verified the bug on qemu-kvm-0.12.1.2-2.442.el6: 0) On host: # mount -t hugetlbfs none /mnt/kvm_hugepage # echo 2048 > /proc/sys/vm/nr_hugepages # cat /proc/meminfo | grep -i hugepage HugePages_Total: 2048 HugePages_Free: 2048 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB 1) Boot up a guest with "-mem-prealloc" /usr/libexec/qemu-kvm -M rhel6.6.0 -cpu SandyBridge -mem-prealloc -mem-path /mnt/kvm_hugepage -m 2G -smp 2,sockets=1,cores=2,threads=1,maxcpus=16 -enable-kvm -name rhel6.6 -uuid 990ea161-6b67-47b2-b803-19fb01d30d12 -smbios type=1,manufacturer='Red Hat',product='RHEV Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-e63fcdb67170 -k en-us -rtc base=localtime,clock=host,driftfix=slew -nodefaults -monitor stdio -qmp tcp:0:6666,server,nowait -boot menu=on -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -monitor unix:/tmp/monitor-unix,nowait,server -drive file=/root/RHEL-Server-6.6-64-virtio.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=threads -device virtio-blk-pci,scsi=off,bus=pci.0,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:1a:4a:2e:28:1c,bus=pci.0,addr=0x4 -vga std -vnc :10 -usb -device usb-tablet Check on host: # cat /proc/meminfo | grep -i hugepage HugePages_Total: 2048 HugePages_Free: 1016 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB 2) Shutdown guest and boot up guest without "-mem-prealloc": (Similar CLI as above, just remove the -mem-prealloc parameter) Check on host: # cat /proc/meminfo | grep -i hugepage HugePages_Total: 2048 HugePages_Free: 2045 HugePages_Rsvd: 1029 HugePages_Surp: 0 Hugepagesize: 2048 kB Based on above, the bug is fixed. 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. http://rhn.redhat.com/errata/RHBA-2014-1490.html |