[pve-devel] [PATCH ksm-control-daemon 1/1] Allow to disable ksm merge_across_nodes

Alexandre DERUMIER aderumier at odiso.com
Mon Oct 9 10:08:59 CEST 2017


>>you can just do the same using "systemctl edit ksmtuned", and adding 
>>just the following snippet (setting your desired value): 
>>
>>[Service] 
>>ExecStartpre=... 
>>
>>as an extension to the existing unit. 

Yes, sure, I just want to add something easy for users. 
(Personnaly, I think we should disable it by default, but I didn't want to break current behaviour)


>>it would probably make more sense to just set the sysctl value 
>>persistently though? 

AFAIK, it's not possible to setup it through sysctl, only through sysfs


>>in any case, this is IMHO not something that belongs into packaging, but 
>>is a local configuration issue. 

I think It could be great to have something in proxmox to manage this tunning values,
(transparent hugepage,disk readahead,...  for example too).
Redhat have the "tuned" daemon for example to manage them for example. 



----- Mail original -----
De: "Fabian Grünbichler" <f.gruenbichler at proxmox.com>
À: "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Lundi 9 Octobre 2017 09:58:15
Objet: Re: [pve-devel] [PATCH ksm-control-daemon 1/1] Allow to disable ksm merge_across_nodes

On Mon, Oct 09, 2017 at 09:19:21AM +0200, Alexandre Derumier wrote: 
> This allow to disable /sys/kernel/mm/ksm/merge_across_nodes. 
> (keep defaults to 1, to not change current behaviour). 
> 
> By default, ksm can merge pages across nodes, which can impact latency. 
> (moving pages from node1 to node0 for example, and kvm thread still running on node1). 
> 
> This need to be setup before ksm is running. 
> 
> redhat reference: 
> https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/virtualization_tuning_and_optimization_guide/chap-ksm 

you can just do the same using "systemctl edit ksmtuned", and adding 
just the following snippet (setting your desired value): 

[Service] 
ExecStartpre=... 

as an extension to the existing unit. 

it would probably make more sense to just set the sysctl value 
persistently though? 

in any case, this is IMHO not something that belongs into packaging, but 
is a local configuration issue. 

> --- 
> debian/defaults | 2 ++ 
> debian/ksmtuned.service | 5 ++++- 
> 2 files changed, 6 insertions(+), 1 deletion(-) 
> 
> diff --git a/debian/defaults b/debian/defaults 
> index e4a92db..a821b30 100644 
> --- a/debian/defaults 
> +++ b/debian/defaults 
> @@ -10,3 +10,5 @@ 
> # start ksmtuned at boot [yes|no] 
> START=yes 
> 
> +# disable ksm merge across numa nodes 
> +# MERGE_ACROSS_NODES=0 
> diff --git a/debian/ksmtuned.service b/debian/ksmtuned.service 
> index ffdaee1..1d14e71 100644 
> --- a/debian/ksmtuned.service 
> +++ b/debian/ksmtuned.service 
> @@ -2,9 +2,12 @@ 
> Description=Kernel Samepage Merging (KSM) Tuning Daemon 
> 
> [Service] 
> +Environment="MERGE_ACROSS_NODES=1" 
> +EnvironmentFile=/etc/default/ksmtuned 
> +ExecStartPre=/bin/bash -c '/bin/echo ${MERGE_ACROSS_NODES} > /sys/kernel/mm/ksm/merge_across_nodes' 
> ExecStart=/usr/sbin/ksmtuned 
> ExecReload=/bin/kill -USR1 $MAINPID 
> Type=forking 
> 
> [Install] 
> -WantedBy=multi-user.target 
> \ No newline at end of file 
> +WantedBy=multi-user.target 
> -- 
> 2.11.0 
> 
> _______________________________________________ 
> pve-devel mailing list 
> pve-devel at pve.proxmox.com 
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 

_______________________________________________ 
pve-devel mailing list 
pve-devel at pve.proxmox.com 
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 



More information about the pve-devel mailing list