-
Notifications
You must be signed in to change notification settings - Fork 2
/
thp-disable.sh
29 lines (29 loc) · 1.35 KB
/
thp-disable.sh
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
#!/bin/bash
echo "Transparent Huge Page Status: "
cat /sys/kernel/mm/transparent_hugepage/enabled
cat /sys/kernel/mm/transparent_hugepage/defrag
if test -f /sys/kernel/mm/transparent_hugepage/enabled
then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo "echo never > /sys/kernel/mm/transparent_hugepage/enabled" >> /etc/rc.local
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag
then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo "echo never > /sys/kernel/mm/transparent_hugepage/defrag" >> /etc/rc.local
fi
if test -f /sys/kernel/mm/redhat_transparent_hugepage/enabled
then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
echo "echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled" >> /etc/rc.local
fi
if test -f /sys/kernel/mm/redhat_transparent_hugepage/defrag
then
echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag
echo "echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag" >> /etc/rc.local
fi
echo "new status of THP"
cat /sys/kernel/mm/transparent_hugepage/enabled
cat /sys/kernel/mm/transparent_hugepage/defrag
echo "checking /etc/rc.local"
cat /etc/rc.local | grep -v "#"