Bug 1017832 - [RFE] ksmtuned and /sys/kernel/mm/ksm/run do not respect RHEV-M GUI settings
[RFE] ksmtuned and /sys/kernel/mm/ksm/run do not respect RHEV-M GUI settings
Status: CLOSED DUPLICATE of bug 1026980
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-webadmin-portal (Show other bugs)
Unspecified Linux
medium Severity medium
: ---
: ---
Assigned To: Doron Fediuck
Pavel Stehlik
: FutureFeature, Triaged
Depends On:
  Show dependency treegraph
Reported: 2013-10-10 11:13 EDT by Robert McSwain
Modified: 2016-02-10 15:16 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-01-06 10:44:56 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: SLA
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
sherold: Triaged+

Attachments (Terms of Use)
mem-share (21.53 KB, image/png)
2013-11-24 05:39 EST, Doron Fediuck
no flags Details

  None (edit)
Description Robert McSwain 2013-10-10 11:13:02 EDT
Description of problem:
Although the GUI reports "Memory page sharing: inactive", unless ksmtuned is stopped manually with 'service ksmtuned stop', kernel shared memory is still used. In addition, on the RHEV-H there is no easy way to chkconfig the service off so that ksmtuned stays off upon reboot.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Virtualization Hypervisor release 6.4 (20130709.0.el6_4)

How reproducible:
Set Memory page sharing to Inactive and check for ksmtuned running with cat /sys/kernel/mm/ksm/run

Steps to Reproduce:
1. Set Memory page sharing to Inactive
2. ps aux|grep ksmtuned
3. cat /sys/kernel/mm/ksm/run
4. Observe the service is still running

Actual results:
ksmtuned has to be manually stopped and starts up after a reboot of the hypervisor

Expected results:
ksmtuned is disabled and chkconfig'd off

Additional info:
This can be worked around with the following:

1) Add exit 0 to the two following files:

[root@localhost admin]# cat /etc/sysconfig/ksm 
# The maximum number of unswappable kernel pages
# which may be allocated by ksm (0 for unlimited)
# If unset, defaults to half of total memory
exit 0 <-----------------------------------------------------------Added

[root@localhost admin]# cat /etc/ksmtuned.conf 
# Configuration file for ksmtuned.

# How long ksmtuned should sleep between tuning adjustments

# Millisecond sleep between ksm scans for 16Gb server.
# Smaller servers sleep more, bigger sleep less.



# uncomment the following if you want ksmtuned debug info

# LOGFILE=/var/log/ksmtuned
exit 0 <-----------------------------------------------------------Added

2) Persist the files

[root@localhost admin]# persist /etc/ksmtuned.conf 
 File persisted

Successfully persisted /etc/ksmtuned.conf

[root@localhost admin]# persist /etc/sysconfig/ksm 
 File persisted

Successfully persisted /etc/sysconfig/ksm

3) After a restart of the hypervisor you will see that the service is chkconfig'd on but the process will be dead:

[root@localhost admin]# chkconfig --list ksm;chkconfig --list ksmtuned
ksm            	0:off	1:off	2:off	3:on	4:on	5:on	6:off
ksmtuned       	0:off	1:off	2:off	3:on	4:on	5:on	6:off

[root@localhost admin]# /etc/init.d/ksmtuned status
ksmtuned dead but subsys locked

[root@localhost admin]# cat /sys/kernel/mm/ksm/run
Comment 1 Robert McSwain 2013-10-11 11:19:38 EDT
Customer has also confirmed that this is seen on the hypervisor build of Red Hat Enterprise Virtualization Hypervisor release 6.4 (20130912.1.el6_4)
Comment 2 Doron Fediuck 2013-10-31 05:14:40 EDT
Hi Robert,
There's a misunderstanding here I'd like to clarify.

KSM daemon activity is handled by vdsm and the configured thresholds.
RHEV-M only reports KSM activity but does not control it. The current design
is to let KSM always work using this policy.

You can see a related issue here: https://bugzilla.redhat.com/show_bug.cgi?id=854027#c11

The Cluster UI dialog you're referring to, handles the scheduling considerations.
So if, for example, you select server utilization (150%), when running a VM the
scheduler will consider up to 150% of the available memory for the relevant hosts. In your case it will use only the reported available memory disallowing
memory over-commitment.

Can you explain more about your need to disable ksm even if not being considered
by the RHEV-M engine?
Comment 3 Robert McSwain 2013-11-08 09:30:22 EST
Sure thing! I'll confirm the customer's need for this and let you know what he has to say as soon as possible. Thanks!
Comment 4 Robert McSwain 2013-11-21 18:05:34 EST
Here's the information from the customer
We have 1 host cluster with only 1 VM (bigger MS SQL database and we need to separate it). KSM function is not desirable and unnecessary in this scenario, because it consumes system resources.

We are seeing memory sharing is active and 2% of memory is shared in the RHEV-M.

I think that if I set policy of memory page sharing to "None", ksmtuned can be active but it shouldn't share any RAM.
Is the customer mistaken about how the memory page sharing option of "None" works?
Comment 5 Doron Fediuck 2013-11-24 05:39:06 EST
Created attachment 828273 [details]

Attaching the tool tip to show that we're actually explaining that these settings are about the amount of VMs you may run using memory sharing. So if needed you can manually disable ksm in the hosts. Going forward (3.4) we'll add a special setting for it in the UI, based on bug 1026980.

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