Translated message

A translation of this page exists in English.

Red Hat Enterprise Linux で transparent huge page (THP) を無効にする方法

Solution In Progress - Updated -

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