1 .\" Copyright 2003,2004 Andi Kleen, SuSE Labs.
2 .\" and Copyright 2007 Lee Schermerhorn, Hewlett Packard
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.
18 .\" Formatted or processed versions of this manual, if unaccompanied by
19 .\" the source, must acknowledge the copyright and authors of this work.
21 .\" 2006-02-03, mtk, substantial wording changes and other improvements
22 .\" 2007-08-27, Lee Schermerhorn <Lee.Schermerhorn@hp.com>
23 .\" more precise specification of behavior.
25 .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI
26 .\" all rights reserved.
27 .\" Translated 2006-08-14, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.39
28 .\" Updated 2008-02-13, Akihiro MOTOKI, LDP v2.77
29 .\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05
30 .\" Updated 2008-08-21, Akihiro MOTOKI, LDP v3.07
31 .\" Updated 2008-11-19, Akihiro MOTOKI, LDP v3.13
33 .TH GET_MEMPOLICY 2 2008-08-15 Linux "Linux Programmer's Manual"
35 get_mempolicy \- プロセスの NUMA メモリのポリシーを取得する
38 .B "#include <numaif.h>"
40 .BI "int get_mempolicy(int *" mode ", unsigned long *" nodemask ,
41 .BI " unsigned long " maxnode ", unsigned long " addr ,
42 .BI " unsigned long " flags );
48 は、呼び出し元プロセスもしくは指定されたメモリアドレスの
53 NUMA (非対称メモリアクセス) マシンでは、CPU により
54 メモリコントローラが異なり、距離も異なっている。
55 メモリポリシーは、どのノードからメモリをそのプロセスに
60 .RB ( set_mempolicy (2)
62 呼び出し元プロセスのデフォルトポリシーに関する情報を返す。
75 .B MPOL_F_MEMS_ALLOWED
76 (Linux 2.6.24 以降で利用可能) を指定すると、
85 が指定されていない場合に ] 指定できるノード (メモリ) の集合が
88 .B MPOL_F_MEMS_ALLOWED
100 で指定されたメモリアドレスに適用されているポリシーに関する情報を返す。
106 を含むメモリ領域に対するポリシーが設定されていた場合には、
107 返されるポリシーはプロセスのデフォルトポリシーと違うことがある。
112 は要求された NUMA ポリシーのモードと追加の
118 が NULL 以外の場合、そのポリシーに対応するノードマスクを
123 に格納できるノード ID の数、つまり最大ノード ID に 1 を足した値を指定する。
126 .I sizeof(unsigned long)
138 が割り当てられているノードのノード ID を
141 指定されたアドレスにどのページもまだ割り当てられていない場合、
143 は、あたかもそのプロセスがそのアドレスに対して読み込みアクセスを
144 実行したかのようにページの割り当てを行い、ページが割り当てられた
157 は、そのプロセスに対して割り当てられたカーネルの内部ページで
158 次にインターリーブ用に使用されるノードのノード ID を、
162 .\" Note: code returns next interleave node via 'mode' argument -Lee Schermerhorn
172 したメモリ領域の、メモリマップされたファイルに対するページも
173 上記のプロセスに対して割り当てられたページに含まれる。
178 .BR set_mempolicy (2)
183 は 0 を返す。エラーの場合、\-1 を返し、
189 .\"motoki: Part of all of the memory は Part or all .. の間違い?
193 で指定されたメモリ領域の一部または全部が、
194 呼び出し元がアクセス可能なアドレス空間外を指している。
198 で指定された値がシステムがサポートするノード ID の数よりも少ない。
233 .B MPOL_F_MEMS_ALLOWED
244 システムコールはバージョン 2.6.7 で Linux カーネルに追加された。
246 このシステムコールは Linux 固有である。
255 .BR set_mempolicy (2),