Skip to content

Commit

Permalink
Merge pull request #57 from angelabriel/master
Browse files Browse the repository at this point in the history
change THP from 'never' to 'madvise' (bsc#1232373)
  • Loading branch information
angelabriel authored Nov 6, 2024
2 parents d13fb63 + d2fa2d3 commit 93c7294
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
16 changes: 16 additions & 0 deletions lib/sc_hooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,31 @@ lc_add() {
sed -i 's/^# Set to 65536/# Set to 1048576 (as recommended by revision 6 of the SAP Note)/' "$SN"
}

thp_change() {
osvers=$(grep ^VERSION= /etc/os-release | awk -F \" '{ print $2 }')
case "$osvers" in
15-SP[567])
sed -i 's/^THP=never/THP=madvise/g' "$SN"
sed -i "s/^# set to 'never'/# set to 'madvise'/g" "$SN"
sed -i '/^# Disable transparent hugepages/i\
# '\''madvise'\'' will enter direct reclaim like '\''always'\'' but only for regions that\
# are have used madvise(MADV_HUGEPAGE). This is the default behaviour.' "$SN"
sed -i 's/^# Disable transparent hugepages/# Configure transparent hugepages/' "$SN"
;;
esac
}

case "$hook_opt" in
add)
add_ignore
lc_add
thp_change
;;
del)
del_ignore
;;
nothing)
lc_add
thp_change
;;
esac
11 changes: 7 additions & 4 deletions man/sapconf.5
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
.\" * GNU General Public License for more details.
.\" */
.\"
.TH sapconf 5 "April 2023" "sapconf configuration file"
.TH sapconf 5 "November 2024" "sapconf configuration file"
.SH NAME
sapconf \- central configuration file of sapconf

Expand Down Expand Up @@ -188,10 +188,13 @@ SAP Note 2684254
.RE
.PP
.TP 4
.BI THP=never
Disable transparent hugepages.
.BI THP=madvise
Configure transparent hugepages.
.br
Set to 'never' to disable or to 'always' to enable.
Set to 'never' to disable or to 'always' to enable or 'madvise'.
.br
\fBmadvise\fP will enter direct reclaim like 'always' but only for regions that
are have used madvise(MADV_HUGEPAGE). This is the default behaviour.
.PP
.RS 4
Set in \fB/sys/kernel/mm/transparent_hugepage/enabled\fP during the SAP tuning part of the scripting
Expand Down
8 changes: 5 additions & 3 deletions sysconfig/sapconf
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,14 @@ NUMA_BALANCING=0
# /sys/kernel/mm/transparent_hugepage/enabled
#
# 'never' to disable, 'always' to enable
# Disable transparent hugepages
# set to 'never'
# 'madvise' will enter direct reclaim like 'always' but only for regions that
# are have used madvise(MADV_HUGEPAGE). This is the default behaviour.
# Configure transparent hugepages
# set to 'madvise'
#
# SAP Note 2131662, 2684254, 2031375
#
THP=never
THP=madvise

# Energy Performance Bias EPB (applies to Intel-based systems only)
#
Expand Down

0 comments on commit 93c7294

Please sign in to comment.