Bug 1008500

Summary: [TestOnly] Allow enable/disable ksm per VM
Product: Red Hat Enterprise Linux 7 Reporter: Paolo Bonzini <pbonzini>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 7.0CC: acathrow, berrange, bsarathy, dallan, dyuan, eblake, gcosta, gsun, honzhang, iheim, jdenemar, mjenner, mzhan, xen-maint, yoyzhang
Target Milestone: rcKeywords: TestOnly
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: LibvirtKSMOff Environment:
Last Closed: 2014-06-13 10:52:15 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, 635419, 769021, 950968    
Bug Blocks: 635417, 644849, 655920    

Comment 1 Wayne Sun 2013-11-19 11:24:59 UTC
pkgs:
libvirt-1.1.1-12.el7.x86_64
qemu-kvm-rhev-1.5.3-10.el7.x86_64
kernel-3.10.0-9.el7.x86_64

steps:
1. Add the following xml info into guest 
...
  <memoryBacking>
    <nosharepages/>
  </memoryBacking>
...
2. Start the guest
# virsh start r7q
Domain r7q started

# ps aux|grep r7q
qemu     17219 95.8  0.0 1477604 61088 ?       Sl   19:04   0:05 /usr/libexec/qemu-kvm -name r7q -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off,mem-merge=off -m 977 -realtime mlock=off -smp 2,maxcpus=4,sockets=4,cores=1,threads=1 -uuid f8de2e07-3fdc-5425-6c72-30d400fb0679 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/r7q.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/libvirt/images/r7q-mjc.img,if=none,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=23,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:37:28:f5,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -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=0x5

the mem-merge=off is added to qemu command line. 

remove the adding xml and restart, no mem-merge added to command line which is default to mem-merge=on

After enable ksm on 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

check with steps with comments #7 in bug 769021, also works as expected.

Comment 3 Ludek Smid 2014-06-13 10:52:15 UTC
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.