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 635419 (LibvirtKSMOff)

Summary: RFE: Allow enable/disable ksm per VM
Product: Red Hat Enterprise Linux 6 Reporter: Itamar Heim <iheim>
Component: libvirtAssignee: Osier Yang <jyang>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: berrange, bsarathy, dallan, dyuan, eblake, gcosta, jdenemar, mjenner, mzhan, xen-maint, yoyzhang
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.8.7-5.el6 Doc Type: Enhancement
Doc Text:
Users can now disable memory merging (KSM) on guest machines. Note however that this requires support for the underlying qemu-kvm "-redhat-disable-KSM" flag.
Story Points: ---
Clone Of:
: 1008500 (view as bug list) Environment:
Last Closed: 2011-05-19 13:21:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 635418, 769021, 950968    
Bug Blocks: 635417, 644849, 655920, 1008500    

Description Itamar Heim 2010-09-19 16:14:19 UTC
- at create command
- via monitor command

Comment 3 Dave Allan 2010-11-23 23:11:46 UTC
Itamar, can you provide additional detail as to what is required from libvirt?

Comment 4 Itamar Heim 2010-11-23 23:13:34 UTC
(In reply to comment #3)
> Itamar, can you provide additional detail as to what is required from libvirt?

to allow setting the enable (or disable) ksm per VM per the blocking BZ on KVM
(same for THP in another BZ)

Comment 5 Osier Yang 2010-11-24 07:38:15 UTC
I will write poposal to upstream libvir-list first, then patches.

- Osier

Comment 6 Osier Yang 2010-11-24 11:38:28 UTC
with detection, and confirmed with Dor and danpb, it should be "command line argument" instead of "qemu monitor command", and it's still not implemented in qemu-kvm yet.

- Osier

Comment 7 Osier Yang 2011-01-10 09:31:05 UTC
http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-January/msg00322.html

patch posted to rhvirt-patches

Comment 11 Osier Yang 2011-02-05 13:33:38 UTC
the final patch sent internally:

http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-February/msg00660.html

Comment 12 zhanghaiyan 2011-02-15 02:44:13 UTC
Verified pass on libvirt-0.8.7-6.el6.x86_64
- kernel-2.6.32-113.el6.x86_64

------ Positive testing ------
- qemu-kvm-0.12.1.2-2.144.el6.x86_64

1. Add the following xml info into guest 
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
2. Start the guest
# virsh start rhel6
3. # ps aux|grep kvm | grep ksm -i
qemu      8063  9.0  4.7 1330152 376908 ?      Sl   21:11   0:38 /usr/libexec/qemu-kvm -S -M rhel6.1.0 -enable-kvm -m 1024 
-redhat-disable-KSM 
-smp 1,sockets=1,cores=1,threads=1 -name rhel6 -uuid 092dcbfe-ec20-9ff6-9a34-4c516c233e33 -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/rhel6.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -boot c -drive file=/var/lib/libvirt/images/rhel6.img,if=none,id=drive-virtio-disk0,format=raw,cache=none -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,fd=25,id=hostnet0,vhost=on,vhostfd=26 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:3f:c4:20,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:0 -vga cirrus -device AC97,id=sound0,bus=pci.0,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6

Comment 13 zhanghaiyan 2011-02-15 06:09:19 UTC
Verified pass on libvirt-0.8.7-6.el6.x86_64
- kernel-2.6.32-71.el6.x86_64

------ Negative testing ------
- qemu-kvm-0.12.1.2-2.113.el6.x86_64

1. Add the following xml info into guest 
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
2. Start the guest
# virsh start rhel6
error: Failed to start domain rhel6
error: internal error '-redhat-disable-KSM' is not supported by '/usr/libexec/qemu-kvm'

Comment 14 Osier Yang 2011-05-03 07:21:26 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
This update allows user disable memory merging (KSM) of guest, (by default, qemu-kvm enables KSM for guest), NB, it needs underly qemu-kvm supports "-redhat-disable-KSM" flag.

Comment 17 Laura Bailey 2011-05-04 06:58:08 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-This update allows user disable memory merging (KSM) of guest, (by default, qemu-kvm enables KSM for guest), NB, it needs underly qemu-kvm supports "-redhat-disable-KSM" flag.+Users can now disable memory merging (KSM) on guest machines. Note however that this requires support for the underlying qemu-kvm "-redhat-disable-KSM" flag.

Comment 18 errata-xmlrpc 2011-05-19 13:21:45 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0596.html