Welcome!
Important information
-- Spectre and Meltdown vulnerabilities

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-18 Final release info here
-- Migration Information to MX-18 here
-- antiX-17.3 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

KSM and MX Linux

Post Reply
User avatar
postcd
Forum Novice
Forum  Novice
Posts: 69
Joined: Mon Oct 29, 2018 2:02 pm

KSM and MX Linux

#1

Post by postcd » Thu Nov 08, 2018 5:22 pm

Apparently MX Linux has KSM disabled by default, when i enabled it:
echo 1 >/sys/kernel/mm/ksm/run
echo 1000 >/sys/kernel/mm/ksm/sleep_millisecs
i saved around 10MB of memory using this memory deduplication mechanism.
OS: MXLinux GPU: AMD Radeon RX 560 ; full HW specs. as of 1/2019

xinomilo
Forum Novice
Forum  Novice
Posts: 8
Joined: Tue Dec 18, 2018 10:02 am

Re: KSM and MX Linux

#2

Post by xinomilo » Mon Dec 24, 2018 4:10 pm

init script for enabling ksm init script on boot : https://dnaeon.github.io/enable-ksm-dur ... -on-linux/

User avatar
anticapitalista
Forum Veteran
Forum Veteran
Posts: 5945
Joined: Sat Jul 15, 2006 10:40 am

Re: KSM and MX Linux

#3

Post by anticapitalista » Mon Dec 24, 2018 4:27 pm

xinomilo wrote:
Mon Dec 24, 2018 4:10 pm
init script for enabling ksm init script on boot : https://dnaeon.github.io/enable-ksm-dur ... -on-linux/
"Written on November 23, 2012"

So, is it still needed in 2018?
anticapitalista
Reg. linux user #395339.

Philosophers have interpreted the world in many ways; the point is to change it.

antiX-17 "Heather Heyer" - lean and mean.
https://antixlinux.com

User avatar
BitJam
Forum Guide
Forum Guide
Posts: 2684
Joined: Sat Aug 22, 2009 11:36 pm

Re: KSM and MX Linux

#4

Post by BitJam » Mon Dec 24, 2018 11:21 pm

anticapitalista wrote:
Mon Dec 24, 2018 4:27 pm
"Written on November 23, 2012"

So, is it still needed in 2018?
KSM is enabled in the 4.9.126-antix.1 kernel. You could try turning it on and see if there is any savings:

Code: Select all

free -m
echo 1 | sudo tee /sys/kernel/mm/ksm/run
echo 1000 | sudo tee /sys/kernel/mm/ksm/sleep_millisecs
free -m
sleep 1
free -m
You can test if it is enabled with:

Code: Select all

cat /sys/kernel/mm/ksm/run
and you can see how many memory pages are being shared with:

Code: Select all

cat /sys/kernel/mm/ksm/pages_sharing
If you are running multiple virtual machines there will probably be significant savings. I don't expect a lot of savings on simple desktop systems.
Will I cry when it's all over?
When I die will I see Heaven?

xinomilo
Forum Novice
Forum  Novice
Posts: 8
Joined: Tue Dec 18, 2018 10:02 am

Re: KSM and MX Linux

#5

Post by xinomilo » Tue Dec 25, 2018 1:41 pm

anticapitalista wrote:
Mon Dec 24, 2018 4:27 pm
"Written on November 23, 2012"

So, is it still needed in 2018?
without systemd, howtos from 2012 for sysv still apply.. :)
as init script for enabling KSM on boot...

kvm page about KSM is a bit older (2010, revised 2015): https://www.linux-kvm.org/page/KSM , but still valid to this day.

i agree with BitJam though, savings come for virtualization (local virtual machines), not much in desktop apps. from what i understand only a few local apps with multiple instances might see differences, but maybe i'm mistaken there, not so sure about that. using KSM in KVM hosts only, and yes, i've seen savings there.

User avatar
BitJam
Forum Guide
Forum Guide
Posts: 2684
Joined: Sat Aug 22, 2009 11:36 pm

Re: KSM and MX Linux

#6

Post by BitJam » Tue Dec 25, 2018 6:54 pm

I created an antiX-17.2 live-usb and tried my KSM instructions above. There were zero saving and zero shared pages both before and after starting X. Maybe you will get some savings if there are more programs or windows open. ISTM it is not worthwhile to have this installed or enabled by default. OTOH there are some circumstances where it would be extremely useful so it is good we have it enabled in the kernel.
Will I cry when it's all over?
When I die will I see Heaven?

Post Reply

Return to “Chat”