Bug 995420
Summary: | qemu-kvm process do not release memory(RES) after guest do stress test | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Xu Han <xuhan> |
Component: | qemu-kvm | Assignee: | Luiz Capitulino <lcapitulino> |
Status: | CLOSED NOTABUG | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.0 | CC: | acathrow, hhuang, juzhang, michen, virt-maint, xfu, xuhan, xwei |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-08-16 19:07:18 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: |
Description
Xu Han
2013-08-09 09:54:02 UTC
My understanding of what is happening is this: you start QEMU with 5G, then you run a user-space program in the guest that touches say, 1G. This causes the host to actually allocate that 1G, but for the host it was _QEMU_ that touched that memory. So, when the guest user-space program is done, the memory it touched becomes free in the guest but for the host's POV the memory is still in use. IOW, it's not a bug. You can confirm this by ballooning the guest down and up. For example, suppose the stress tool used 1G and then released it, and that's what you wanted to see free in the host. Try this: (qemu) info balloon balloon: actual=5120 (qemu) balloon 4096 (qemu) info balloon balloon: actual=4096 (qemu) balloon 5120 Now you should see that 1G free in host. The automatic ballooning project I'm working on is just about that: http://www.linux-kvm.org/page/Projects/auto-ballooning. I'll wait for you confirmation before closing this as NOTABUG. According to comment2, I re-tested this issue. This is test result: 1.guest boot successfully and don't run stress inside guest. qemu process RES in host: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4664 root 20 0 9.883g 1.024g 7176 S 0.000 30.00 0:33.13 qemu-kvm 2.after stress test inside guest qemu process RES in host: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4664 root 20 0 9978344 3.073g 7176 S 1.332 90.01 2:37.95 qemu-kvm (qemu) info balloon balloon: actual=5120 3.do balloon 4096 in monitor (qemu) balloon 4096 (qemu) info balloon balloon: actual=4096 qemu process RES in host: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4664 root 20 0 9978344 2.077g 7176 S 1.332 60.83 2:39.62 qemu-kvm 4.do balloon 5120 in monitor (qemu) balloon 5120 (qemu) info balloon balloon: actual=5120 qemu process RES in host: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 4664 root 20 0 9978344 2.102g 7176 S 1.332 61.57 2:41.66 qemu-kvm base on this test result above. change memory size via balloon. can see memory is released in host. Currently, In order to host release memory,still need to change manually balloon value, so I think it is still a bug. If I am wrong, please correct me. This is not a bug in the sense that this is caused by a programming error, everything is working just as designed. I agree this is not optimal, but the solution to this are long term projects like automatic ballooning and/or the free page hinting project. |