OSDN Git Service

LDP: Address fuzzy changes (numa)
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / move_pages.2
1 .\" This manpage is Copyright (C) 2006 Silicon Graphics, Inc.
2 .\"                               Christoph Lameter
3 .\"
4 .\" %%%LICENSE_START(VERBATIM_TWO_PARA)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\" %%%LICENSE_END
14 .\"
15 .\" FIXME Should programs normally be using move_pages() directly, or should
16 .\" they rather be using interfaces in the numactl package?
17 .\" (e.g., compare with recommendation in mbind(2)).
18 .\" Does this page need to give advice on this topic?
19 .\"
20 .\"*******************************************************************
21 .\"
22 .\" This file was generated with po4a. Translate the source file.
23 .\"
24 .\"*******************************************************************
25 .\"
26 .\" Japanese Version Copyright (c) 2008  Akihiro MOTOKI
27 .\"         all rights reserved.
28 .\" Translated 2008-10-26, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
29 .\"
30 .TH MOVE_PAGES 2 2020\-06\-09 Linux "Linux Programmer's Manual"
31 .SH 名前
32 move_pages \- あるプロセスの個々のページを別のノードに移動する
33 .SH 書式
34 .nf
35 \fB#include <numaif.h>\fP
36 .PP
37 \fBlong move_pages(int \fP\fIpid\fP\fB, unsigned long count, void **\fP\fIpages\fP\fB,\fP
38 \fB                const int *\fP\fInodes\fP\fB, int *\fP\fIstatus\fP\fB, int \fP\fIflags\fP\fB);\fP
39 .fi
40 .PP
41 \fI\-lnuma\fP とリンクする。
42 .SH 説明
43 \fBmove_pages\fP()  は、プロセス \fIpid\fP の指定されたページ \fIpages\fP を \fInodes\fP
44 で指定されたメモリーノードに移動する。 移動の結果は \fIstatus\fP に反映される。 \fIflags\fP では移動されるページに関する制約を指定する。
45 .PP
46 \fIpid\fP is the ID of the process in which pages are to be moved.  If \fIpid\fP
47 is 0, then \fBmove_pages\fP()  moves pages of the calling process.
48 .PP
49 To move pages in another process requires the following privileges:
50 .IP * 3
51 Linux 4.12 以前のカーネルでは、呼び出し元が特権 (\fBCAP_SYS_NICE\fP)  を持っているか、呼び出したプロセスの実ユーザー ID
52 か実効ユーザー ID が ページ移動対象のプロセスの実ユーザー ID か保存 set\-user\-ID のどちらかと一致しなければならない。
53 .IP *
54 .\" commit 197e7e521384a23b9e585178f3f11c9fa08274b9
55 The older rules allowed the caller to discover various virtual address
56 choices made by the kernel that could lead to the defeat of
57 address\-space\-layout randomization for a process owned by the same UID as
58 the caller, the rules were changed starting with Linux 4.13.  Since Linux
59 4.13, permission is governed by a ptrace access mode
60 \fBPTRACE_MODE_READ_REALCREDS\fP check with respect to the target process; see
61 \fBptrace\fP(2).
62 .PP
63 \fIcount\fP は移動するページ数である。 \fIcount\fP により \fIpages\fP, \fInodes\fP, \fIstatus\fP の 3
64 つの配列の大きさが定義される。
65 .PP
66 .\" FIXME Describe the result if pointers in the 'pages' array are
67 .\" not aligned to page boundaries
68 \fIpages\fP は、移動すべきページへのポインターの配列であり、 各ポインターはページ境界に揃えた値を指定すべきである。 \fIpid\fP
69 で指定されたプロセスで見えるアドレスを指定する。
70 .PP
71 \fInodes\fP は、各ページの希望の移動場所を示す整数値の配列であり、 配列の各要素はノード番号である。 \fInodes\fP には NULL
72 を指定することもでき、この場合には \fBmove_pages\fP()  はどのページも移動しないが、各ページが現在配置されているノードを配列
73 \fIstatus\fP に格納して返す。どのページを移動する必要があるかを判断するために、 各ページの状態の取得が必要な場合もある。
74 .PP
75 \fIstatus\fP is an array of integers that return the status of each page.  The
76 array contains valid values only if \fBmove_pages\fP()  did not return an
77 error.  Preinitialization of the array to a value which cannot represent a
78 real numa node or valid error of status array could help to identify pages
79 that have been migrated.
80 .PP
81 \fIflags\fP には、どの種類のページを移動するかを指定する。 \fBMPOL_MF_MOVE\fP
82 は、そのプロセスが排他的に使用しているページだけを移動することを意味する。 \fBMPOL_MF_MOVE_ALL\fP
83 は、複数のプロセス間で共有されているページも移動できることを意味する。 \fBMPOL_MF_MOVE_ALL\fP を使用するためには、そのプロセスが特権
84 (\fBCAP_SYS_NICE\fP)  を持っていなければならない。
85 .SS "status 配列に格納されるページ状態"
86 \fIstatus\fP 配列の各要素として、以下の値が返される。
87 .TP 
88 \fB0..MAX_NUMNODES\fP
89 そのページが配置されているノードを示す。
90 .TP 
91 \fB\-EACCES\fP
92 そのページは複数のプロセスによりマップされており、 \fBMPOL_MF_MOVE_ALL\fP が指定された場合にのみ移動できる。
93 .TP 
94 \fB\-EBUSY\fP
95 そのページが現在ビジーであり、移動できない。後でもう一度試すこと。 この状況は、ページが I/O の実行中であったり、カーネルの他のサブシステム
96 がそのページへの参照を保持している場合に発生する。
97 .TP 
98 \fB\-EFAULT\fP
99 そのページが zero page であるか、そのメモリー領域はそのプロセスにより マップされていない。
100 .TP 
101 \fB\-EIO\fP
102 ページを書き戻す (write back) ことができない。 ページが dirty で、ファイルシステムが dirty なページを移動できるような
103 移動機能を提供していないため、そのページを移動するためにはページを 書き戻さなければならない。
104 .TP 
105 \fB\-EINVAL\fP
106 dirty なページを移動できない。 ファイルシステムが dirty なページを移動するための機能を提供しておらず、 ページを書き戻す能力もない。
107 .TP 
108 \fB\-ENOENT\fP
109 ページが存在しない。
110 .TP 
111 \fB\-ENOMEM\fP
112 移動先のノードでメモリーを確保することができない。
113 .SH 返り値
114 .\" FIXME . Is the following quite true: does the wrapper in numactl
115 .\" do the right thing?
116 On success \fBmove_pages\fP()  returns zero.  On error, it returns \-1, and sets
117 \fIerrno\fP to indicate the error.  If positive value is returned, it is the
118 number of nonmigrated pages.
119 .SH エラー
120 .TP 
121 \fBPositive value\fP
122 .\" commit a49bd4d7163707de377aee062f17befef6da891b
123 .\" commit 3140a2273009c01c27d316f35ab76a37e105fdd8
124 The number of nonmigrated pages if they were the result of nonfatal reasons
125 (since Linux 4.17).  \fBE2BIG\fP Too many pages to move.  Since Linux 2.6.29,
126 the kernel no longer generates this error.
127 .TP 
128 \fBEACCES\fP
129 .\" FIXME Clarify "current cpuset" in the description of the EACCES error.
130 .\" Is that the cpuset of the caller or the target?
131 移動先のノードのいずれかが現在の CPU 集合では許可されていない。
132 .TP 
133 \fBEFAULT\fP
134 パラメーター配列にアクセスできなかった。
135 .TP 
136 \fBEINVAL\fP
137 \fIflags\fP に \fBMPOL_MF_MOVE\fP でも \fBMPOL_MF_MOVE_ALL\fP
138 でもない値が指定されたか、カーネルスレッドのページを移動させようとした。
139 .TP 
140 \fBENODEV\fP
141 移動先のノードのいずれかがオンラインでない。
142 .TP 
143 \fBEPERM\fP
144 呼び出し元は \fBMPOL_MF_MOVE_ALL\fP を指定したが、十分な特権 (\fBCAP_SYS_NICE\fP)  を持っていない。
145 または、呼び出し元が他のユーザーに属するプロセスのページを移動しようとしたが、 それを行えるだけの特権 (\fBCAP_SYS_NICE\fP)
146 を持っていなかった。
147 .TP 
148 \fBESRCH\fP
149 プロセスが存在しない。
150 .SH バージョン
151 \fBmove_pages\fP()  は、バージョン 2.6.18 で初めて Linux に登場した。
152 .SH 準拠
153 このシステムコールは Linux 固有である。
154 .SH 注意
155 ライブラリによるサポートについては \fBnuma\fP(7)  を参照。
156 .PP
157 .\" FIXME Clarify "current cpuset".  Is that the cpuset of the caller
158 .\" or the target?
159 現在の CPU 集合で許可されているノードの集合を取得するには、フラグ \fBMPOL_F_MEMS_ALLOWED\fP を指定して
160 \fBget_mempolicy\fP(2)  を使用すればよい。 取得した情報は、CPU 集合の手動または自動での再構成により
161 いつ何時変化してしまうか分からない。
162 .PP
163 この関数を使用すると、ページの位置 (ノード) が 指定されたアドレスに対して設定されたメモリーポリシー (\fBmbind\fP(2)  参照)
164 や指定されたプロセスに対して設定されたメモリーポリシー (\fBset_mempolicy\fP(2)  参照) に違反してしまう可能性がある。
165 つまり、メモリーポリシーは \fBmove_pages\fP()  で使われる移動先ノードを制限しないということである。
166 .PP
167 ヘッダーファイル \fI<numaif.h>\fP は glibc には含まれておらず、 \fIlibnuma\-devel\fP
168 か同様のパッケージをインストールする必要がある。
169 .SH 関連項目
170 \fBget_mempolicy\fP(2), \fBmbind\fP(2), \fBset_mempolicy\fP(2), \fBnuma\fP(3),
171 \fBnuma_maps\fP(5), \fBcpuset\fP(7), \fBnuma\fP(7), \fBmigratepages\fP(8),
172 \fBnumastat\fP(8)
173 .SH この文書について
174 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は
175 \%https://www.kernel.org/doc/man\-pages/ に書かれている。