kvm-ksm

kvm-ksm Commit Details


Date:2013-07-20 21:50:00 (11 years 5 months ago)
Author:Natalie Adams
Branch:default
Commit:83495d1e1f6c
Message:initial commit

Changes:
Aksm (full)

File differences

ksm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
#
# Author: Marin Atanasov Nikolov <dnaeon@gmail.com>
#
### BEGIN INIT INFO
# Provides: ksm
# Required-Start:
# Required-Stop:
# X-Start-Before:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Enable and disable KVM KSM
# Description: Enables and disables the KVM Kernel Samepage Merging
# feature of the kernel
### END INIT INFO
set -e
. /lib/lsb/init-functions
do_start() {
echo 1 > /sys/kernel/mm/ksm/run
log_success_msg "Enabling Kernel Samepage Merging"
}
do_stop() {
echo 0 > /sys/kernel/mm/ksm/run
log_success_msg "Disabling Kernel Samepage Merging"
}
do_status() {
local ksm_status
ksm_status=$( cat /sys/kernel/mm/ksm/run )
if [ ${ksm_status} -eq 1 ]; then
log_success_msg "Kernel Samepage Merging is enabled"
else
log_success_msg "Kernel Samepage Merging is disabled"
fi
}
case "${1}" in
start)
do_start
;;
reset|stop)
do_stop
;;
status)
do_status
;;
reload|restart|force-reload)
do_stop
do_start
;;
*)
log_success_msg "usage: ${0} {start|stop|status|reload|restart|force-reload|reset}" >&2
;;
esac

Archive Download the corresponding diff file

Branches

Tags

Page rendered in 0.41249s using 14 queries.