Show Table of Contents
A.16. taskset
taskset ツールは util-linux パッケージで提供されます。これを使用すると実行中プロセスのプロセッサー親和性を読み出して設定したり、指定プロセッサー親和性でプロセスを起動することができるようになります。
重要
taskset はローカルのメモリー割り当てを保証しません。ローカルメモリー割り当てによりパフォーマンスを向上させる必要がある場合は taskset ではなく numactl を使用することを推奨しています。
実行中のプロセスの CPU 親和性を設定するには、以下のコマンドを実行します。
# taskset -c processors pid
processors をコンマ区切りのプロセッサー一覧または
1,3,5-7 のようにプロセッサーの範囲で置き換えます。pid を再構成するプロセスのプロセス識別子で置き換えます。
特定の親和性のプロセスを開始するには、以下のコマンドを実行します。
# taskset -c processors -- application
processors をコンマ区切りのプロセッサー一覧またはプロセッサーの範囲で置き換えます。application を実行するアプリケーションのコマンド、オプション、引数で置き換えます。
taskset についての詳細情報は、man ページを参照してください。
$ man taskset

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.