Bug 769021 - Allow enable/disable ksm per VM
Allow enable/disable ksm per VM
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Luiz Capitulino
Virtualization Bugs
: Regression
Depends On:
Blocks: 655920 580954 635417 LibvirtKSMOff 950968 1008500
  Show dependency treegraph
Reported: 2011-12-19 12:06 EST by Daniel Berrange
Modified: 2014-06-17 23:14 EDT (History)
15 users (show)

See Also:
Fixed In Version: qemu 1.3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 635418
: 950968 (view as bug list)
Last Closed: 2014-06-13 06:36:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Comment 4 Luiz Capitulino 2012-06-26 09:06:13 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.
Comment 5 Luiz Capitulino 2012-09-11 08:51:18 EDT
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).
Comment 6 Luiz Capitulino 2012-09-17 15:18:10 EDT
This has finally been merged upstream (commit 8490fc78).
Comment 7 FuXiangChun 2013-11-03 22:07:46 EST
Verify this bug with qemu-kvm-1.5.3-10.el7.x86_64 and 3.10.0-37.el7.x86_64

Test Scenario-1

In host
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" 

In guest
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)
cat /sys/kernel/mm/ksm/pages_sharing

Test Scenario-2
Use the same test steps as Scenario1.
If booting two guests with -machine mem-merge=off.

This pages_sharing is constant(no change)
cat /sys/kernel/mm/ksm/pages_sharing

Test scanrio-3
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.
cat /sys/kernel/mm/ksm/pages_sharing

This pages_sharing continues to rise(1444~59363) when booting the second guest.
cat /sys/kernel/mm/ksm/pages_sharing 
Base on test result above, qemu-kvm option "-machine mem-merge=on/off" can enable/disable ksm per guest. So this bug is fixed.
Comment 8 juzhang 2013-11-03 23:12:36 EST
According to comment7, set this issue as verified.
Comment 9 Ludek Smid 2014-06-13 06:36:38 EDT
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.

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