numa
Section: Environments, Tables, and Troff Macros (7)
Updated: 2026-02-08
Index
JM Home Page
roff page
名前
numa - 非対称型メモリーアーキテクチャーの概要
説明
非対称型メモリーアクセス (Non-Uniform Memory Access; NUMA) は、
メモリーが複数のメモリーノードに分割されているマルチプロセッサシステム
のことである。メモリーノードへのアクセス時間は、アクセス元の CPU と
アクセス先のノードの相対的な位置関係に依存する
(これに対し、対称型マルチプロセッサシステムでは、どの CPU から
どのメモリーへのアクセス時間も同じである)。
通常は、 NUMA システムの各 CPU にはローカルのメモリーノードがあり、
そのメモリーノードには、他の CPU のローカルノードや全ての CPU で
共有されるバス上のメモリーよりも早くアクセスすることができる。
NUMA システムコール
Linux カーネルには、次に示す NUMA 関連のシステムコールが実装されている:
get_mempolicy(2), mbind(2), migrate_pages(2),
move_pages(2), set_mempolicy(2).
ただし、アプリケーションは通常は libnuma が提供するインターフェース
を使用すべきである。下記の「ライブラリによるサポート」を参照。
/proc/pid/numa_maps (Linux 2.6.14 以降)
このファイルは、プロセスの NUMA メモリーポリシーと割り当てに関する
情報を表示する。
Each line contains information about a memory range used by the process,
displaying---among other information---the effective memory policy for
that memory range and on which nodes the pages have been allocated.
numa_maps is a read-only file. When /proc/pid/numa_maps is read,
the kernel will scan the virtual address space of the process and report how
memory is used. One line is displayed for each unique memory range of the
process.
The first field of each line shows the starting address of the memory
range. This field allows a correlation with the contents of the
/proc/pid/maps file, which contains the end address of the range and
other information, such as the access permissions and sharing.
2 番目のフィールドは、 そのメモリー領域に現在適用されているメモリーポリシーを示す。 適用されているポリシーは、
必ずしもそのプロセスがこのメモリー領域に対して設定したポリシーとは限らない点に注意すること。
特に、
プロセスがその領域に対して「デフォルト」ポリシーを設定した場合、その領域に適用されるポリシーはプロセスのポリシーとなり、それが「デフォルト」ポリシーとなる場合もあればそうでない場合もある。
行の残りの部分には、そのメモリー領域に割り当てられたページに関する情報が入る。以下に詳細を示す。
- N<node>=<nr_pages>
-
<node> に割り当てられているページ数。 <nr_pages> には、
そのプロセスが現在マッピングしているページだけが含まれる。 ページの移動やメモリーの再利用により、 このメモリー領域に関連付けられているが、
一時的にマッピングされていないページが存在する場合がある。 プロセスがそれらのページを参照しようとした後には、 これらのページは再び現れる可能性がある。
メモリー領域が共有メモリーやファイルマッピングの場合には、 そのメモリー領域内に別のページを他のプロセスがマッピングしている場合もある。
- file=<filename>
-
そのメモリー領域に関連付けられているファイル。 ファイルがプライベート (非公開) でマッピングされている場合、 書き込みアクセスがあると、
このメモリー領域に書き込み時コピー (Copy-On-Write) ページが生成されることがある。 これらのページは無名ページ (anonymous
page) として表示される。
- heap
-
ヒープに使用されているメモリー範囲。
- stack
-
スタックに使用されているメモリー範囲。
- huge
-
ヒュージメモリーの範囲。表示されるページ数は、
通常の大きさのページではなく、ヒュージページの数である。
- anon=<pages>
-
メモリー範囲内の無名ページ (anonymous page) の数。
- dirty=<pages>
-
dirty (変更された) ページの数。
- mapped=<pages>
-
マッピングされているページ数。 dirty および anon のページ数と異なる値の場合に表示される。
- mapmax=<count>
-
スキャン中に検出した mapcount (一つのページをマッピングしているプロセス数) の最大値。 この値は、
そのメモリー領域でどの程度の共有が行われているかの指標として使うことができる。
- swapcache=<count>
-
スワップデバイスに対応するエントリーが存在するページ数。
- active=<pages>
-
アクティブリストに入っているページ数。 このフィールドが表示されるのは、
値がこのメモリー領域のページ数と異なる場合だけである。このフィールドが表示されるということは、 このメモリー領域に、まもなくスワッパ (swapper)
によりこの領域から削除される可能性がある inactive なページが存在することを意味する。
- writeback=<pages>
-
現在ディスクに書き出されているページ数。
標準規格
なし。
注意
Linux の NUMA システムコールと /proc インターフェースは、カーネルが
設定オプション CONFIG_NUMA を有効にして作成されている場合のみ、利用
可能である。
ライブラリによるサポート
システムコールの定義を得るには -lnuma でリンクすること。
libnuma と必要なヘッダーファイル <numaif.h> は
numactl パッケージで提供されている。
However, applications should not use these system calls directly. Instead,
the higher level interface provided by the numa(3) functions in the
numactl package is recommended. The numactl package is available at
ftp://oss.sgi.com/www/projects/libnuma/download/.
The package is also included in some Linux distributions. Some
distributions include the development library and header in the separate
numactl-devel package.
関連項目
get_mempolicy(2), mbind(2), move_pages(2), set_mempolicy(2),
numa(3), cpuset(7), numactl(8)
Index
- 名前
-
- 説明
-
- NUMA システムコール
-
- /proc/pid/numa_maps (Linux 2.6.14 以降)
-
- 標準規格
-
- 注意
-
- ライブラリによるサポート
-
- 関連項目
-
This document was created by
man2html,
using the manual pages.