OSDN Git Service

6e6f15b20f81f950b78a45617e3d07b250d53c95
[linuxjm/LDP_man-pages.git] / draft / man2 / mbind.2
1 .\" Copyright 2003,2004 Andi Kleen, SuSE Labs.
2 .\" and Copyright 2007 Lee Schermerhorn, Hewlett Packard
3 .\"
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.
7 .\"
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.
12 .\"
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.
17 .\"
18 .\" Formatted or processed versions of this manual, if unaccompanied by
19 .\" the source, must acknowledge the copyright and authors of this work.
20 .\"
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.
24 .\"
25 .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI
26 .\"         all rights reserved.
27 .\" Translated 2006-07-25, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.36
28 .\" Updated 2008-08-21, Akihiro MOTOKI, LDP v3.07
29 .\" Updated 2008-09-19, Akihiro MOTOKI, LDP v3.08
30 .\"
31 .TH MBIND 2 2008-08-15 Linux "Linux Programmer's Manual"
32 .\"O .SH NAME
33 .SH 名前
34 .\"O mbind \- Set memory policy for a memory range
35 mbind \- メモリ領域に対してメモリポリシーを設定する
36 .\"O .SH SYNOPSIS
37 .SH 書式
38 .nf
39 .B "#include <numaif.h>"
40 .sp
41 .BI "int mbind(void *" addr ", unsigned long " len  ", int " mode ,
42 .BI "          unsigned long *" nodemask  ", unsigned long " maxnode ,
43 .BI "          unsigned " flags );
44 .sp
45 .\"O Link with \fI\-lnuma\fP.
46 \fI\-lnuma\fP でリンクする。
47 .fi
48 .\"O .SH DESCRIPTION
49 .SH 説明
50 .\"O .BR mbind ()
51 .\"O sets the NUMA memory policy,
52 .\"O which consists of a policy mode and zero or more nodes,
53 .\"O for the memory range starting with
54 .\"O .I addr
55 .\"O and continuing for
56 .\"O .I len
57 .\"O bytes.
58 .BR mbind ()
59 は、
60 .I addr
61 から始まる長さ
62 .I len
63 バイトの範囲のメモリに NUMA メモリポリシーを設定する。
64 NUMA ポリシーはポリシーモードと 0 個以上のノードから構成される。
65 .\"O The memory policy defines from which node memory is allocated.
66 メモリポリシーはどのノードからメモリを割り当てるかを決定する。
67
68 .\"O If the memory range specified by the
69 .\"O .IR addr " and " len
70 .\"O arguments includes an "anonymous" region of memory\(emthat is
71 .\"O a region of memory created using the
72 .\"O .BR mmap (2)
73 .\"O system call with the
74 .\"O .BR MAP_ANONYMOUS \(emor
75 .\"O a memory mapped file, mapped using the
76 .\"O .BR mmap (2)
77 .\"O system call with the
78 .\"O .B MAP_PRIVATE
79 .\"O flag, pages will only be allocated according to the specified
80 .\"O policy when the application writes [stores] to the page.
81 .I addr
82
83 .I len
84 で指定されたメモリ範囲に、
85 メモリの「無名」領域 \(em
86 .B MAP_ANONYMOUS
87 付きの
88 .BR mmap (2)
89 システムコールを使って作成されたメモリ領域 \(em や
90 .B MAP_PRIVATE
91 付きの
92 .BR mmap (2)
93 を使ってマップされたメモリマップ・ファイルが含まれている場合、
94 ページが指定されたポリシーに基づいて割り当てられるのは、アプリケーション
95 がそのページへの書き込み (データの格納) を行った時だけである。
96 .\"O For anonymous regions, an initial read access will use a shared
97 .\"O page in the kernel containing all zeros.
98 .\"O For a file mapped with
99 .\"O .BR MAP_PRIVATE ,
100 .\"O an initial read access will allocate pages according to the
101 .\"O process policy of the process that causes the page to be allocated.
102 .\"O This may not be the process that called
103 .\"O .BR mbind ().
104 無名領域の場合、最初の読み出しアクセスの際には
105 カーネル内の全データが 0 である共有ページが使用される。
106 .B MAP_PRIVATE
107 でマップされたファイルの場合、最初の読み出しアクセスがあると、
108 ページ割り当てが発生するきっかけとなったプロセスのデフォルトポリシー
109 にしたがってページの割り当てが行われる。
110 ページ割り当てのきっかけとなったプロセスは、
111 .BR mbind ()
112 を呼び出したプロセスと同じとは限らない。
113
114 .\"O The specified policy will be ignored for any
115 .\"O .B MAP_SHARED
116 .\"O mappings in the specified memory range.
117 .\"O Rather the pages will be allocated according to the process policy
118 .\"O of the process that caused the page to be allocated.
119 .\"O Again, this may not be the process that called
120 .\"O .BR mbind ().
121 指定されたメモリ範囲内にある
122 .B MAP_SHARED
123 のマッピングでは指定されたポリシーは無視され、
124 ページ割り当てが発生するきっかけとなったプロセスのデフォルトポリシーに
125 したがってページの割り当てが行われることになる。
126 繰り返しになるが、ページ割り当てのきっかけとなったプロセスは、
127 .BR mbind ()
128 を呼び出したプロセスと同じとは限らない。
129
130 .\"O If the specified memory range includes a shared memory region
131 .\"O created using the
132 .\"O .BR shmget (2)
133 .\"O system call and attached using the
134 .\"O .BR shmat (2)
135 .\"O system call,
136 .\"O pages allocated for the anonymous or shared memory region will
137 .\"O be allocated according to the policy specified, regardless which
138 .\"O process attached to the shared memory segment causes the allocation.
139 .\"Omotoki: 訳に少しだけ自信がない。
140 指定されたメモリ範囲に、
141 .BR shmget (2)
142 システムコールを使って作成されたり、
143 .BR shmat (2)
144 システムコールを使って付加 (attach) されたりした共有メモリ領域が
145 含まれる場合、無名メモリ領域や共有メモリ領域に対するページ割り当ては、
146 共有メモリセグメントへポリシーの設定を行ったプロセスがページ割り当て
147 のきっかけとなったかに関わらず、指定されたポリシーにしたがって割り当て
148 が行われる。
149 .\"O If, however, the shared memory region was created with the
150 .\"O .B SHM_HUGETLB
151 .\"O flag,
152 .\"O the huge pages will be allocated according to the policy specified
153 .\"O only if the page allocation is caused by the process that calls
154 .\"O .BR mbind ()
155 .\"O for that region.
156 しかしながら、共有メモリ領域が
157 .B SHM_HUGETLB
158 フラグを指定して作成された場合には、ヒュージページ (huge page) の割り当てが
159 指定されたポリシーにしたがって行われるのは、その領域に対して
160 .BR mbind ()
161 を呼び出したプロセスがページ割り当てのきっかけとなった場合のみである。
162
163 .\"O By default,
164 .\"O .BR mbind ()
165 .\"O only has an effect for new allocations; if the pages inside
166 .\"O the range have been already touched before setting the policy,
167 .\"O then the policy has no effect.
168 デフォルトでは、
169 .BR mbind ()
170 は新規のメモリ割り当てに対してのみ効果を持つ。
171 ポリシーが設定される前にすでに使用されている範囲内のページに対しては、
172 ポリシーは影響しない。
173 .\"O This default behavior may be overridden by the
174 .\"O .B MPOL_MF_MOVE
175 .\"O and
176 .\"O .B MPOL_MF_MOVE_ALL
177 .\"O flags described below.
178 このデフォルトの動作は、以下で説明するフラグ
179 .B MPOL_MF_MOVE
180
181 .B MPOL_MF_MOVE_ALL
182 により上書きされる可能性がある。
183
184 .\"O The
185 .\"O .I mode
186 .\"O argument must specify one of
187 .\"O .BR MPOL_DEFAULT ,
188 .\"O .BR MPOL_BIND ,
189 .\"O .B MPOL_INTERLEAVE
190 .\"O or
191 .\"O .BR MPOL_PREFERRED .
192 .\"O All policy modes except
193 .\"O .B MPOL_DEFAULT
194 .\"O require the caller to specify via the
195 .\"O .I nodemask
196 .\"O argument,
197 .\"O the node or nodes to which the mode applies.
198 .I mode
199 引き数には、
200 .BR MPOL_DEFAULT ,
201 .BR MPOL_BIND ,
202 .BR MPOL_INTERLEAVE ,
203 .B MPOL_PREFERRED
204 のいずれか一つを指定しなければならない。
205 .B MPOL_DEFAULT
206 以外のポリシーモードの場合、呼び出し元は
207 .I nodemask
208 引き数でそのポリシーモードを適用するノードを指定する必要がある。
209
210 .\"O The
211 .\"O .I mode
212 .\"O argument may also include an optional
213 .\"O .IR "mode flag ".
214 .\"O The supported
215 .\"O .I "mode flags"
216 .\"O are:
217 .I mode
218 引き数には、追加で
219 .I "モードフラグ"
220 を含めることもできる。
221 サポートされている
222 .I "モードフラグ"
223 は以下の通りである。
224 .TP
225 .\"O .BR MPOL_F_STATIC_NODES " (since Linux-2.6.26)"
226 .BR MPOL_F_STATIC_NODES " (Linux-2.6.26 以降)"
227 .\"O A nonempty
228 .\"O .I nodemask
229 .\"O specifies physical node ids.
230 .\"O Linux does not remap the
231 .\"O .I nodemask
232 .\"O when the process moves to a different cpuset context,
233 .\"O nor when the set of nodes allowed by the process's
234 .\"O current cpuset context changes.
235 空でない
236 .I nodemask
237 は、物理ノード ID である。
238 Linux では、そのプロセスが異なる CPU 集合コンテキスト (cpuset context)
239 に移動した場合でも、そのプロセスの現在の CPU 集合コンテキストで
240 許可されているノード集合が変化した場合でも、
241 .I nodemask
242 をマッピングし直すことはない。
243 .TP
244 .\"O .BR MPOL_F_RELATIVE_NODES " (since Linux-2.6.26)"
245 .BR MPOL_F_RELATIVE_NODES " (Linux-2.6.26 以降)"
246 .\"O A nonempty
247 .\"O .I nodemask
248 .\"O specifies node ids that are relative to the set of
249 .\"O node ids allowed by the process's current cpuset.
250 空でない
251 .I nodemask
252 は、そのプロセスの現在の CPU 集合で許可されているノード ID 集合
253 における相対的なノード ID である。
254 .PP
255 .\"O .I nodemask
256 .\"O points to a bitmask of nodes containing up to
257 .\"O .I maxnode
258 .\"O bits.
259 .\"O The bit mask size is rounded to the next multiple of
260 .\"O .IR "sizeof(unsigned long)" ,
261 .\"O but the kernel will only use bits up to
262 .\"O .IR maxnode .
263 .I nodemask
264 は、最大で
265 .I maxnode
266 ビットから構成されるノードのビットマスクを指す。
267 ビットマスクの大きさは、直近の
268 .I sizeof(unsigned long)
269 の倍数に切り上げられるが、カーネルが使用するのは
270 .I maxnode
271 個までのビットだけである。
272 .\"O A NULL value of
273 .\"O .I nodemask
274 .\"O or a
275 .\"O .I maxnode
276 .\"O value of zero specifies the empty set of nodes.
277 .\"O If the value of
278 .\"O .I maxnode
279 .\"O is zero,
280 .\"O the
281 .\"O .I nodemask
282 .\"O argument is ignored.
283 NULL 値の
284 .I nodemask
285 もしくは値が 0 の
286 .I maxnode
287 はノードの空集合を表す。
288 .I maxnode
289 の値が 0 の場合、
290 .I nodemask
291 引き数は無視される。
292 .\"O Where a
293 .\"O .I nodemask
294 .\"O is required, it must contain at least one node that is on-line,
295 .\"O allowed by the process's current cpuset context
296 .\"O [unless the
297 .\"O .B MPOL_F_STATIC_NODES
298 .\"O mode flag is specified],
299 .\"O and contains memory.
300 .I nodemask
301 が必須の場面では、
302 .I nodemask
303 に、オンラインで、そのプロセスの現在の CPU 集合コンテキストで
304 許可されており
305 .RB ( MPOL_F_STATIC_NODES
306 モードフラグが指定されていない場合)、メモリがあるノードが
307 少なくとも一つ入っていなければならない。
308
309 .\"O The
310 .\"O .B MPOL_DEFAULT
311 .\"O mode requests that any nondefault policy be removed,
312 .\"O restoring default behavior.
313 モード
314 .B MPOL_DEFAULT
315 はデフォルトではないプロセスのメモリポリシーを削除し、
316 デフォルトの動作に戻すことを指定するものである。
317 .\"O When applied to a range of memory via
318 .\"O .BR mbind (),
319 .\"O this means to use the process policy,
320 .\"O which may have been set with
321 .\"O .BR set_mempolicy (2).
322 .BR mbind ()
323 経由で、あるメモリ領域に対して
324 .B MPOL_DEFAULT
325 が適用された場合、プロセスのデフォルトポリシーを使用することを意味する。
326 プロセスのデフォルトポリシーは、
327 .BR set_mempolicy (2)
328 で変更されているかもしれない。
329 .\"O If the mode of the process policy is also
330 .\"O .BR MPOL_DEFAULT ,
331 .\"O the system-wide default policy will be used.
332 プロセスのポリシーのモードも
333 .B MPOL_DEFAULT
334 の場合、システム全体のデフォルトポリシーが使用される。
335 .\"O The system-wide default policy allocates
336 .\"O pages on the node of the CPU that triggers the allocation.
337 .\"O For
338 .\"O .BR MPOL_DEFAULT ,
339 .\"O the
340 .\"O .I nodemask
341 .\"O and
342 .\"O .I maxnode
343 .\"O arguments must be specify the empty set of nodes.
344 システム全体のデフォルトポリシーでは、割り当てのきっかけとなった
345 CPU のノードからページの割り当てを行う。
346 .B MPOL_DEFAULT
347 では、引き数
348 .I nodemask
349
350 .I maxnode
351 にノードの空集合を指定しなければならない。
352
353 .\"O The
354 .\"O .B MPOL_BIND
355 .\"O mode specifies a strict policy that restricts memory allocation to
356 .\"O the nodes specified in
357 .\"O .IR nodemask .
358 .\"O If
359 .\"O .I nodemask
360 .\"O specifies more than one node, page allocations will come from
361 .\"O the node with the lowest numeric node ID first, until that node
362 .\"O contains no free memory.
363 .\"O Allocations will then come from the node with the next highest
364 .\"O node ID specified in
365 .\"O .I nodemask
366 .\"O and so forth, until none of the specified nodes contain free memory.
367 .\"O Pages will not be allocated from any node not specified in the
368 .\"O .IR nodemask .
369 .B MPOL_BIND
370 は厳しいポリシーで、メモリ割り当ては
371 .I nodemask
372 に指定されたノードに限定される。
373 他のノードへの割り当ては行われない。
374 .I nodemask
375 に 2 個以上のノードが指定された場合、ページの割り当ては
376 ノード ID が数字として最小のノードから開始され、
377 そのノードに空きメモリがなくなるまでそのノードから
378 ページ割り当てが行われる。そのノードに空きメモリがなくなったら、
379 .\"motoki: the next highest は the next lowest の間違い?
380 次に小さなノード ID を持つノードからページ割り当てが行われる。
381 これを、
382 .I nodemask
383 で指定された全てのノードで空きメモリがなくなるまで繰り返す。
384 .I nodemask
385 で指定された以外のノードからはページの割り当ては行われない。
386
387 .\"O The
388 .\"O .B MPOL_INTERLEAVE
389 .\"O mode specifies that page allocations be interleaved across the
390 .\"O set of nodes specified in
391 .\"O .IR nodemask .
392 .\"O This optimizes for bandwidth instead of latency
393 .\"O by spreading out pages and memory accesses to those pages across
394 .\"O multiple nodes.
395 .\"O To be effective the memory area should be fairly large,
396 .\"O at least 1MB or bigger with a fairly uniform access pattern.
397 .\"O Accesses to a single page of the area will still be limited to
398 .\"O the memory bandwidth of a single node.
399 .B MPOL_INTERLEAVE
400 は、メモリ割り当てが
401 .I nodemask
402 に指定されたノード間で交互に行われることを指定するものである。
403 このポリシーでは、複数のノードにページを広げて配置し、これらのページへの
404 メモリアクセスを分散することで、遅延ではなく、帯域を最適化する。
405 効果を得るには、メモリ領域をある程度大きくすべきであり、
406 メモリアクセスのパターンがかなり均一な場合でも
407 少なくとも 1MB 以上にすべきである。
408 このモードでも、一つのページへのアクセスに関しては
409 一つのノードのメモリ帯域が上限となることは変わりない。
410
411 .\"O .B MPOL_PREFERRED
412 .\"O sets the preferred node for allocation.
413 .\"O The kernel will try to allocate pages from this
414 .\"O node first and fall back to other nodes if the
415 .\"O preferred nodes is low on free memory.
416 .\"O If
417 .\"O .I nodemask
418 .\"O specifies more than one node ID, the first node in the
419 .\"O mask will be selected as the preferred node.
420 .\"O If the
421 .\"O .I nodemask
422 .\"O and
423 .\"O .I maxnode
424 .\"O arguments specify the empty set, then the memory is allocated on
425 .\"O the node of the CPU that triggered the allocation.
426 .\"O This is the only way to specify "local allocation" for a
427 .\"O range of memory via
428 .\"O .BR mbind ().
429 .B MPOL_PREFERRED
430 は、割り当て時に優先されるノードを設定する。
431 カーネルはまず優先ノードにページ割り当てを行おうとし、
432 優先ノードに空きメモリが少ない場合に他のノードに割り当てを行う。
433 .I nodemask
434 に複数のノード ID が指定された場合は、
435 .I nodemask
436 内の最初のノードが優先ノードとして選択される。
437 引き数
438 .IR nodemask ,
439 .I maxnode
440 で空集合が指定された場合は、割り当てのきっかけとなった CPU のノードに
441 メモリ割り当てが行われる。
442 .BR mbind (2)
443 で、あるメモリ領域に対して「ローカルからの割り当て (local allocation)」を
444 指定する方法はこれしかない。
445
446 .\"O If
447 .\"O .B MPOL_MF_STRICT
448 .\"O is passed in
449 .\"O .I flags
450 .\"O and
451 .\"O .I mode
452 .\"O is not
453 .\"O .BR MPOL_DEFAULT ,
454 .\"O then the call will fail with the error
455 .\"O .B EIO
456 .\"O if the existing pages in the memory range don't follow the policy.
457 .I flags
458
459 .B MPOL_MF_STRICT
460
461 指定され、
462 .I mode
463
464 .B MPOL_DEFAULT
465 でない場合、
466 指定されたポリシーに従っていないメモリ領域にページが存在すると、
467 .BR mbind ()
468 はエラー
469 .B EIO
470 で失敗する。
471 .\" According to the kernel code, the following is not true
472 .\" --Lee Schermerhorn
473 .\" .\"O In 2.6.16 or later the kernel will also try to move pages
474 .\" .\"O to the requested node with this flag.
475 .\" 2.6.16 以降のカーネルでは、このフラグで要求されたノードに
476 .\" ページを移動しようとする。
477
478 .\"O If
479 .\"O .B MPOL_MF_MOVE
480 .\"O is specified in
481 .\"O .IR flags ,
482 .\"O then the kernel will attempt to move all the existing pages
483 .\"O in the memory range so that they follow the policy.
484 .\"O Pages that are shared with other processes will not be moved.
485 .\"O If
486 .\"O .B MPOL_MF_STRICT
487 .\"O is also specified, then the call will fail with the error
488 .\"O .B EIO
489 .\"O if some pages could not be moved.
490 .I flags
491
492 .B MPOL_MF_MOVE
493 が指定されると、カーネルはそのメモリ領域内の既存の全てのページを移動し、
494 指定されたポリシーに従うようにしようとする。
495 他のプロセスと共有されているページは移動されない。
496 .B MPOL_MF_STRICT
497 も指定された場合、移動できなかったページがあると、
498 .BR mbind ()
499 はエラー
500 .B EIO
501 で失敗する。
502
503 .\"O If
504 .\"O .B MPOL_MF_MOVE_ALL
505 .\"O is passed in
506 .\"O .IR flags ,
507 .\"O then the kernel will attempt to move all existing pages in the memory range
508 .\"O regardless of whether other processes use the pages.
509 .\"O The calling process must be privileged
510 .\"O .RB ( CAP_SYS_NICE )
511 .\"O to use this flag.
512 .\"O If
513 .\"O .B MPOL_MF_STRICT
514 .\"O is also specified, then the call will fail with the error
515 .\"O .B EIO
516 .\"O if some pages could not be moved.
517 .I flags
518
519 .B MPOL_MF_MOVE_ALL
520 が指定されると、カーネルはそのメモリ領域内の既存の全てのページを、
521 他のプロセスがページを使用しているかどうかに関わらず移動する。
522 このフラグを使用するには、呼び出し元のプロセスは特権
523 .RB ( CAP_SYS_NICE )
524 を持っていなければならない。
525 .B MPOL_MF_STRICT
526 も指定された場合、移動できなかったページがあると、
527 .BR mbind ()
528 はエラー
529 .B EIO
530 で失敗する。
531 .\" ---------------------------------------------------------------
532 .\"O .SH RETURN VALUE
533 .SH 返り値
534 .\"O On success,
535 .\"O .BR mbind ()
536 .\"O returns 0;
537 .\"O on error, \-1 is returned and
538 .\"O .I errno
539 .\"O is set to indicate the error.
540 成功すると、
541 .BR mbind ()
542 は 0 を返す。エラーの場合、\-1 を返し、
543 .I errno
544 にエラーを示す値を設定する。
545 .\" ---------------------------------------------------------------
546 .\"O .SH ERRORS
547 .SH エラー
548 .\"  I think I got all of the error returns.  --Lee Schermerhorn
549 .TP
550 .B EFAULT
551 .\"O Part or all of the memory range specified by
552 .\"O .I nodemask
553 .\"O and
554 .\"O .I maxnode
555 .\"O points outside your accessible address space.
556 .\"O Or, there was an unmapped hole in the specified memory range.
557 .I nodemask
558
559 .I maxnode
560 で指定されたメモリ領域の一部または全部が、
561 呼び出し元がアクセス可能なアドレス空間外を指している。
562 もしくは指定されたメモリ領域にマップされていない部分 (unmapped hole)
563 があった、
564 .TP
565 .B EINVAL
566 .\"O An invalid value was specified for
567 .\"O .I flags
568 .\"O or
569 .\"O .IR mode ;
570 .I flags
571
572 .I mode
573 に不正な値が指定された。
574 .\"O or
575 .\"O .I addr + len
576 .\"O was less than
577 .\"O .IR addr ;
578 .I addr + len
579
580 .I addr
581 より小さい。
582 .\"O or
583 .\"O .I addr
584 .\"O is not a multiple of the system page size.
585 .\"O Or,
586 .\"O .I mode
587 .\"O is
588 .\"O .B MPOL_DEFAULT
589 .\"O and
590 .\"O .I nodemask
591 .\"O specified a nonempty set;
592 .I addr
593 がシステムのページサイズの倍数になっていない。
594 または
595 .I mode
596
597 .B MPOL_DEFAULT
598
599 .I nodemask
600 に空でない集合が指定された。
601 .\"O or
602 .\"O .I mode
603 .\"O is
604 .\"O .B MPOL_BIND
605 .\"O or
606 .\"O .B MPOL_INTERLEAVE
607 .\"O and
608 .\"O .I nodemask
609 .\"O is empty.
610 .I mode
611
612 .B MPOL_BIND
613
614 .B MPOL_INTERLEAVE
615
616 .I nodemask
617 が空であった。
618 .\"O Or,
619 .\"O .I maxnode
620 .\"O exceeds a kernel-imposed limit.
621 .I maxnode
622 がカーネルに適用された上限を超えている。
623 .\" As at 2.6.23, this limit is "a page worth of bits", e.g.,
624 .\" 8 * 4096 bits, assuming a 4kB page size.
625 .\"O Or,
626 .\"O .I nodemask
627 .\"O specifies one or more node IDs that are
628 .\"O greater than the maximum supported node ID.
629 .I nodemask
630 に、サポートされている最大ノード ID より大きいノードが指定された。
631 .\"O Or, none of the node IDs specified by
632 .\"O .I nodemask
633 .\"O are on-line and allowed by the process's current cpuset context,
634 .\"O or none of the specified nodes contain memory.
635 .I nodemask
636 に、オンラインで、かつそのプロセスの現在の CPU 集合コンテキストで
637 許可されているノードが一つも含まれていないか、
638 メモリを含むノードが一つも指定されていない。
639 .\"O Or, the
640 .\"O .I mode
641 .\"O argument specified both
642 .\"O .B MPOL_F_STATIC_NODES
643 .\"O and
644 .\"O .BR MPOL_F_RELATIVE_NODES .
645 .I mode
646 引き数に
647 .B MPOL_F_STATIC_NODES
648
649 .B MPOL_F_RELATIVE_NODES
650 の両方が指定された。
651 .TP
652 .B EIO
653 .\"O .B MPOL_MF_STRICT
654 .\"O was specified and an existing page was already on a node
655 .\"O that does not follow the policy;
656 .B MPOL_MF_STRICT
657 が指定されたが、このポリシーに従っていないノードに
658 すでにページが存在していた。
659 .\"O or
660 .\"O .B MPOL_MF_MOVE
661 .\"O or
662 .\"O .B MPOL_MF_MOVE_ALL
663 .\"O was specified and the kernel was unable to move all existing
664 .\"O pages in the range.
665 もしくは
666 .B MPOL_MF_MOVE
667
668 .B MPOL_MF_MOVE_ALL
669 が指定されたが、カーネルが指定された領域内の既存の全てのページを
670 移動することができなかった。
671 .TP
672 .B ENOMEM
673 .\"O Insufficient kernel memory was available.
674 利用可能なカーネルメモリが十分なかった。
675 .TP
676 .B EPERM
677 .\"O The
678 .\"O .I flags
679 .\"O argument included the
680 .\"O .B MPOL_MF_MOVE_ALL
681 .\"O flag and the caller does not have the
682 .\"O .B CAP_SYS_NICE
683 .\"O privilege.
684 .I flags
685 引き数に
686 .B MPOL_MF_MOVE_ALL
687 フラグが含まれているが、呼び出し元が
688 .B CAP_SYS_NICE
689 特権を持たない。
690 .\" ---------------------------------------------------------------
691 .\"O .SH VERSIONS
692 .SH バージョン
693 .\"O The
694 .\"O .BR mbind ()
695 .\"O system call was added to the Linux kernel in version 2.6.7.
696 .BR mbind ()
697 システムコールはバージョン 2.6.7 で Linux カーネルに追加された。
698 .\"O .SH CONFORMING TO
699 .SH 準拠
700 .\"O This system call is Linux-specific.
701 このシステムコールは Linux 独自である。
702 .\"O .SH NOTES
703 .SH 注意
704 .\"O For information on library support, see
705 .\"O .BR numa (7).
706 ライブラリによるサポートについては
707 .BR numa (7)
708 を参照。
709
710 .\"O NUMA policy is not supported on a memory mapped file range
711 .\"O that was mapped with the
712 .\"O .B MAP_SHARED
713 .\"O flag.
714 NUMA ポリシーは、
715 .B MAP_SHARED
716 フラグが指定されてマップされたメモリマップ・ファイルの領域では
717 サポートされていない。
718
719 .\"O The
720 .\"O .B MPOL_DEFAULT
721 .\"O mode can have different effects for
722 .\"O .BR mbind ()
723 .\"O and
724 .\"O .BR set_mempolicy (2).
725 .B MPOL_DEFAULT
726 モードは、
727 .BR mbind ()
728
729 .BR set_mempolicy (2)
730 で異なる効果を持つことができる。
731 .\"O When
732 .\"O .B MPOL_DEFAULT
733 .\"O is specified for
734 .\"O .BR set_mempolicy (2),
735 .\"O the process's policy reverts to system default policy
736 .\"O or local allocation.
737 .BR set_mempolicy (2)
738
739 .B MPOL_DEFAULT
740 が指定された場合、そのプロセスのポリシーはシステムの
741 デフォルトポリシー、すなわちローカルからの割り当て、に戻る。
742 .\"O When
743 .\"O .B MPOL_DEFAULT
744 .\"O is specified for a range of memory using
745 .\"O .BR mbind (),
746 .\"O any pages subsequently allocated for that range will use
747 .\"O the process's policy, as set by
748 .\"O .BR set_mempolicy (2).
749 .BR mbind ()
750 を使ってメモリのある領域に
751 .B MPOL_DEFAULT
752 が指定された場合、その範囲に対してそれ以降に行われるページの割り当てでは、
753 .BR set_mempolicy (2)
754 で設定したのと同じように、そのプロセスのポリシーが適用される。
755 .\"O This effectively removes the explicit policy from the
756 .\"O specified range, "falling back" to a possibly nondefault
757 .\"O policy.
758 .\"0motoki: possibly nondefault policy は default policy の間違い?
759 これにより、特定のメモリ領域についてだけ明示的なポリシーを削除し、
760 デフォルトのポリシーに「戻す」ことができる。
761 .\"O To select explicit "local allocation" for a memory range,
762 .\"O specify a
763 .\"O .I mode
764 .\"O of
765 .\"O .B MPOL_PREFERRED
766 .\"O with an empty set of nodes.
767 .\"O This method will work for
768 .\"O .BR set_mempolicy (2),
769 .\"O as well.
770 あるメモリ領域に対して「ローカルからの割り当て」を明示的に設定するには、
771 .I mode
772
773 .B MPOL_PREFERRED
774 を指定し、
775 .I nodemask
776 に空集合のノードを指定すればよい。
777 この方法は
778 .BR set_mempolicy (2)
779 でも通用する。
780
781 .\"O Support for huge page policy was added with 2.6.16.
782 .\"O For interleave policy to be effective on huge page mappings the
783 .\"O policied memory needs to be tens of megabytes or larger.
784 2.6.16 でヒュージページ・ポリシーへの対応が追加された。
785 インターリーブ・ポリシーがヒュージページのマッピングで効果を持つには、
786 ポリシーが適用されるメモリが数十メガバイト以上である必要がある。
787
788 .\"O .B MPOL_MF_STRICT
789 .\"O is ignored on huge page mappings.
790 .B MPOL_MF_STRICT
791 はヒュージページのマッピングでは無視される。
792
793 .\"O .B MPOL_MF_MOVE
794 .\"O and
795 .\"O .B MPOL_MF_MOVE_ALL
796 .\"O are only available on Linux 2.6.16 and later.
797 .B MPOL_MF_MOVE
798
799 .B MPOL_MF_MOVE_ALL
800 は Linux 2.6.16 以降でのみ利用可能である。
801 .\"O .SH SEE ALSO
802 .SH 関連項目
803 .BR get_mempolicy (2),
804 .BR getcpu (2),
805 .BR mmap (2),
806 .BR set_mempolicy (2),
807 .BR shmat (2),
808 .BR shmget (2),
809 .BR numa (3),
810 .BR cpuset (7),
811 .BR numa (7),
812 .BR numactl (8)