Red Hat Enterprise Linux で transparent huge page (THP) を無効にする方法
Environment
- Red Hat Enterprise Linux 7 以降のメジャーバージョン
- transparent hugepages (THP)
- tuned
Issue
- Red Hat Enterprise Linux 7 以降で transparent huge pages (THP) を無効にする方法は?
- Red Hat Enterprise Linux 7 で transparent huge page (THP) を無効にしても効果がありません。
Resolution
以下の手順を実行します。
-
カーネルコマンドラインに
transparent_hugepage=neverを追加します。# grubby --args="transparent_hugepage=never" --update-kernel=ALL -
カーネルコマンドラインで上記の変更を行った後、
s390xアーキテクチャーシステムに対してziplコマンドを実行して、これらの変更を有効にします。その後、以下の残りの手順を実行します。 -
変更を適用するにはシステムを再起動する必要があります。
# systemctl reboot -
再起動後、いくつかの方法で変更を確認できます。
# cat /proc/cmdline ( the transparent_hugepage=never argument should appear ) # cat /sys/kernel/mm/transparent_hugepage/enabled always madvice [never] # grep AnonHugePages: /proc/meminfo AnonHugePages: 0 kB # grep nr_anon_transparent_hugepages /proc/vmstat nr_anon_transparent_hugepages 0
Transparent Huge Pages (THP) がまだ無効になっていない場合は、以下の いずれか のオプションを実行します。
-
オプション 1: (推奨) THP を無効にしてカスタマイズされた
tunedプロファイルを作成する- この解決策により、現在実行中のプロファイルのカスタマイズされたバージョンが作成されます。カスタマイズされたバージョンでは THP が無効になります。
-
アクティブなプロファイルを見つけて、コピーを作成します。次の例では、
throughput-performanceプロファイルを使用しています。# tuned-adm active Current active profile: throughput-performance -
カスタマイズされたプロファイルを作成するには、
/etc/tunedディレクトリーに任意のプロファイル名で新しいディレクトリーを作成します。# mkdir /etc/tuned/myprofile-nothp -
次に、myprofile-nothp 用の新しい
tuned.confファイルを作成し、新しいチューニング情報を挿入します。# cat /etc/tuned/myprofile-nothp/tuned.conf [main] include=throughput-performance [vm] transparent_hugepages=never -
スクリプトを実行可能にします。
# chmod +x /etc/tuned/myprofile-nothp/tuned.conf -
次のように myprofile を有効にします。
# tuned-adm profile myprofile-nothp -
この変更はすぐに有効になり、再起動しても維持されます。
-
THP が無効になっているか確認するには、以下のコマンドを実行します。
# cat /sys/kernel/mm/transparent_hugepage/enabled
-
オプション 2: (代替)
tunedサービスを無効にする-
この解決策により、
tunedサービスが無効になります。# systemctl stop tuned # systemctl disable tuned -
または
# tuned-adm off -
上記の手順 1 - 3 で説明したように、grub2 設定ファイルに "transparent_hugepage=never" カーネルパラメーターを追加します。
- 変更を有効にするには、サーバーを再起動します。
-
注記: transparent huge page (THP) を有効にするには、このプロセスを逆の順番で実行します。以下を使用します。
# grubby --remove-args=transparent_hugepage --update-kernel=ALL
# systemctl reboot
Root Cause
Diagnostic Steps
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments