Red Hat Bugzilla – Bug 769021
Allow enable/disable ksm per VM
Last modified: 2014-06-17 23:14:10 EDT
RFC series has been posted upstream:
Discussion is going on, but there's general agreement on the feature. Except for the QMP command, which we've decided to drop because of lack of use-cases.
Posted v5 a few days ago:
This is very likely to be the final version. It's also important to note that the QMP command from the RFC series (comment 4) has been dropped. We're only going to have command-line support for this (-machine mem-merge=on|off).
This has finally been merged upstream (commit 8490fc78).
Verify this bug with qemu-kvm-1.5.3-10.el7.x86_64 and 3.10.0-37.el7.x86_64
1.echo 1 > /sys/kernel/mm/ksm/run
2.echo 50 > /sys/kernel/mm/ksm/sleep_millisecs
3.echo 5000 > /sys/kernel/mm/ksm/pages_to_scan
4.Boot two RHEL7.0 guests with "-machine mem-merge=on"
1.swapoff -a(disable swap)
2.mount -f tmpfs none /mnt
3. dd if=/dev/zero of=/mnt/zero
This pages_sharing continues to rise(1444~1348592)
Use the same test steps as Scenario1.
If booting two guests with -machine mem-merge=off.
This pages_sharing is constant(no change)
Booting the first guest with -machine mem-merge=off
Booting the second guest with -machine mem-merge=on
This pages_sharing is constant(no change) after booting the first guest and run dd command line in guest.
This pages_sharing continues to rise(1444~59363) when booting the second guest.
Base on test result above, qemu-kvm option "-machine mem-merge=on/off" can enable/disable ksm per guest. So this bug is fixed.
According to comment7, set this issue as verified.
This request was resolved in Red Hat Enterprise Linux 7.0.
Contact your manager or support representative in case you have further questions about the request.