-
Notifications
You must be signed in to change notification settings - Fork 2
/
disablethp-rhel-centos.shh
30 lines (30 loc) · 1.38 KB
/
disablethp-rhel-centos.shh
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
#!/bin/bash
#disable thp on RHEL or CentOs.
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 "#"