Skip to content

Commit

Permalink
Merge pull request #58 from angelabriel/master
Browse files Browse the repository at this point in the history
add 'reset' function for the THP entry in the sysconfig file
  • Loading branch information
angelabriel authored Nov 7, 2024
2 parents 93c7294 + de3caeb commit b332f64
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/sc_hooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ lc_add() {
sed -i 's/^# Set to 65536/# Set to 1048576 (as recommended by revision 6 of the SAP Note)/' "$SN"
}

thp_reset() {
osvers=$(grep ^VERSION= /etc/os-release | awk -F \" '{ print $2 }')
case "$osvers" in
15-SP[1234])
sed -i 's/^THP=madvise/THP=never/g' "$SN"
sed -i "s/^# set to 'madvise'/# set to 'never'/g" "$SN"
sed -i "/^# 'madvise' will enter.*/,+1d" "$SN"
sed -i 's/^# Configure transparent hugepages/# Disable transparent hugepages/' "$SN"
;;
esac
}

thp_change() {
osvers=$(grep ^VERSION= /etc/os-release | awk -F \" '{ print $2 }')
case "$osvers" in
Expand Down Expand Up @@ -60,4 +72,7 @@ nothing)
lc_add
thp_change
;;
reset)
thp_reset
;;
esac

0 comments on commit b332f64

Please sign in to comment.