Default without qemu-kvm is:

Like:
$ cat /sys/kernel/mm/ksm/run
0

When qemu/kvm is installed (as you correctly described) this changes.
As the default in /etc/default/qemu-kvm is KSM_ENABLED=AUTO

That makes /usr/share/qemu/init/qemu-kvm-init switch KSM on by default.

That is what we want to change.
It shall still be possible to use it by opting in, but the default should no 
more activating this system wide.

But you are right that we also do not want to disable it system wide.
Today the script does:
- If KSM_ENABLED is 1/Auto enable /sys/kernel/mm/ksm/run
- If KSM_ENABLED is 0 disable /sys/kernel/mm/ksm/run

Ideally I'd wish we'd not mess about it by default, there is no way this
script can neither force-on or force-off if a user configures it
elsewhere.

Which would mean I'd want:
- default of KSM_ENABLED changes to 0
- if someone sets KSM_ENABLED to 0, do what it always did
- if someone upgrades, the old default stays
- behavior if KSM_ENABLED is 0 = do nothing (don't enable - but also do not 
disable)

If users enabled it elsewhere, keep it.
But if they didn't (the majority) then our default should not make them have it 
on all the time.

I see two ways actually, adapt it or drop it:

 # A - change the meaning                                                       
  
 # Set to 1 to enable KSM                                                       
  
 # Set 0 to not touch the system setting at all                                 
  
 # Set AUTO to enable it if not in a VM.                                        
  
 # After changing this setting restart the qemu-kvm service.                    
  
 KSM_ENABLED=0                                                                  
  
 SLEEP_MILLISECS=200                                                            
  
                                                                                
  
 # B - drop the config                                                          
  
 # Dropped KSM_ENABLED setting, this is less common and less needed.            
  
 # Write to /sys/kernel/mm/ksm/run to control it

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2033565

Title:
  ksmd should be opt-in rather than opt-out

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2033565/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to