OSDN Git Service

(split) Apply minor changes from v3.32 to v3.35 in the upstream.
[linuxjm/LDP_man-pages.git] / draft / man2 / set_mempolicy.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 .\" Translated 2006-08-14, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.39
26 .\" Updated 2007-01-07, Akihiro MOTOKI, LDP v2.43
27 .\" Updated 2008-02-13, Akihiro MOTOKI, LDP v2.77
28 .\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05
29 .\" Updated 2008-08-21, Akihiro MOTOKI, LDP v3.07
30 .\" Updated 2008-09-02, Akihiro MOTOKI, LDP v3.08
31 .\" Updated 2008-11-19, Akihiro MOTOKI, LDP v3.13
32 .\"
33 .\"WORD:        anonymous memory        ÌµÌ¾¥á¥â¥ê
34 .\"
35 .TH SET_MEMPOLICY 2 2008-08-15 Linux "Linux Programmer's Manual"
36 .\"O .SH NAME
37 .SH Ì¾Á°
38 .\"O set_mempolicy \- set default NUMA memory policy for a process and its children
39 set_mempolicy \- ¥×¥í¥»¥¹¤È¤½¤Î»Ò¥×¥í¥»¥¹¤Î NUMA ¥á¥â¥ê¤Î
40 ¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤òÀßÄꤹ¤ë
41 .\"O .SH SYNOPSIS
42 .SH ½ñ¼°
43 .nf
44 .B "#include <numaif.h>"
45 .sp
46 .BI "int set_mempolicy(int " mode ", unsigned long *" nodemask ,
47 .BI "                  unsigned long " maxnode );
48 .sp
49 .\"O Link with \fI\-lnuma\fP.
50 \fI\-lnuma\fP ¤Ç¥ê¥ó¥¯¤¹¤ë¡£
51 .fi
52 .\"O .SH DESCRIPTION
53 .SH ÀâÌÀ
54 .\"O .BR set_mempolicy ()
55 .\"O sets the NUMA memory policy of the calling process,
56 .\"O which consists of a policy mode and zero or more nodes,
57 .\"O to the values specified by the
58 .\"O .IR mode ,
59 .\"O .I nodemask
60 .\"O and
61 .\"O .I maxnode
62 .\"O arguments.
63 .BR set_mempolicy ()
64 ¤Ï¡¢¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î NUMA ¥Ý¥ê¥·¡¼¤ò
65 .I policy
66 ¤ËÀßÄꤹ¤ë¡£
67 NUMA ¥Ý¥ê¥·¡¼¤Ï¥Ý¥ê¥·¡¼¥â¡¼¥É¤È 0 ¸Ä°Ê¾å¤Î¥Î¡¼¥É¤«¤é¹½À®¤µ¤ì¡¢
68 ÀßÄêÆâÍƤϰú¤­¿ô
69 .IR mode ,
70 .IR nodemask ,
71 .I maxnode
72 ¤Ë¤è¤ê»ØÄꤵ¤ì¤ë¡£
73
74 .\"O A NUMA machine has different
75 .\"O memory controllers with different distances to specific CPUs.
76 .\"O The memory policy defines from which node memory is allocated for
77 .\"O the process.
78 NUMA (ÈóÂоΥá¥â¥ê¥¢¥¯¥»¥¹) ¥Þ¥·¥ó¤Ç¤Ï¡¢CPU ¤Ë¤è¤ê
79 ¥á¥â¥ê¥³¥ó¥È¥í¡¼¥é¤¬°Û¤Ê¤ê¡¢µ÷Î¥¤â°Û¤Ê¤Ã¤Æ¤¤¤ë¡£
80 ¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï¡¢¤É¤Î¥Î¡¼¥É¤«¤é¥á¥â¥ê¤ò¤½¤Î¥×¥í¥»¥¹¤Ë
81 ³ä¤êÅö¤Æ¤é¤ì¤ë¤«¤òÄê¤á¤ë¤â¤Î¤Ç¤¢¤ë¡£
82
83 .\"O This system call defines the default policy for the process.
84 .\"O The process policy governs allocation of pages in the process's
85 .\"O address space outside of memory ranges
86 .\"O controlled by a more specific policy set by
87 .\"O .BR mbind (2).
88 .BR set_mempolicy ()
89 ¤Ï¡¢¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤òÄê¤á¤ë¡£
90 ¥×¥í¥»¥¹¤Î¥Ý¥ê¥·¡¼¤Ï¡¢
91 .BR mbind (2)
92 ¤ÇÀßÄꤵ¤ì¤ëÆÃÄê¤Î¥Ý¥ê¥·¡¼¤Ë¤è¤êÀ©¸æ¤µ¤ì¤ë¥á¥â¥êÎΰè°Ê³°¤Î
93 ¥×¥í¥»¥¹¤Î¥¢¥É¥ì¥¹¶õ´Ö¤Ë¤ª¤±¤ë¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤ËŬÍѤµ¤ì¤ë¡£
94 .\"O The process default policy also controls allocation of any pages for
95 .\"O memory mapped files mapped using the
96 .\"O .BR mmap (2)
97 .\"O call with the
98 .\"O .B MAP_PRIVATE
99 .\"O flag and that are only read [loaded] from by the process
100 .\"O and of memory mapped files mapped using the
101 .\"O .BR mmap (2)
102 .\"O call with the
103 .\"O .B MAP_SHARED
104 .\"O flag, regardless of the access type.
105 ¥×¥í¥»¥¹¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ï¡¢
106 .B MAP_PRIVATE
107 ¥Õ¥é¥°¤ò»ØÄꤷ¤¿
108 .BR mmap (2)
109 ¤ò»È¤Ã¤Æ¥Þ¥Ã¥×¤µ¤ì¤¿¥á¥â¥ê¥Þ¥Ã¥×¡¦¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ëÆɤ߽Ф·ÀìÍÑ
110 (¥í¡¼¥É¤µ¤ì¤ë¤À¤±) ¤Î¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ë¤âŬÍѤµ¤ì¤ë¡£
111 ¤Þ¤¿¡¢
112 .B MAP_SHARED
113 ¥Õ¥é¥°¤ò»ØÄꤷ¤¿
114 .BR mmap (2)
115 ¤ò»È¤Ã¤Æ¥Þ¥Ã¥×¤µ¤ì¤¿¥á¥â¥ê¥Þ¥Ã¥×¡¦¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ë¤â
116 ŬÍѤµ¤ì¤ë (¤³¤Î¾ì¹ç¤Ï¥Ú¡¼¥¸¤Î¥¢¥¯¥»¥¹¼ïÊ̤˴ؤï¤é¤ºÅ¬ÍѤµ¤ì¤ë) ¡£
117 .\"O The policy is only applied when a new page is allocated
118 .\"O for the process.
119 .\"O For anonymous memory this is when the page is first
120 .\"O touched by the application.
121 ÀßÄꤷ¤¿¥Ý¥ê¥·¡¼¤Ï¡¢¥×¥í¥»¥¹¤Ë¿·µ¬¤Î¥Ú¡¼¥¸¤¬³ä¤êÅö¤Æ¤é¤ì¤ë¤È¤­¤Ë¤Î¤ß
122 ŬÍѤµ¤ì¤ë¡£ÌµÌ¾¥á¥â¥ê (anonymous memory) ¤Î¾ì¹ç¡¢¿·µ¬¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ï
123 ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬½é¤á¤Æ¥Ú¡¼¥¸¤Ë¥¢¥¯¥»¥¹¤·¤¿ºÝ¤Ë¹Ô¤ï¤ì¤ë¡£
124
125 .\"O The
126 .\"O .I mode
127 .\"O argument must specify one of
128 .\"O .BR MPOL_DEFAULT ,
129 .\"O .BR MPOL_BIND ,
130 .\"O .B MPOL_INTERLEAVE
131 .\"O or
132 .\"O .BR MPOL_PREFERRED .
133 .\"O All modes except
134 .\"O .B MPOL_DEFAULT
135 .\"O require the caller to specify via the
136 .\"O .I nodemask
137 .\"O argument one or more nodes.
138 .I mode
139 °ú¤­¿ô¤Ë¤Ï
140 .BR MPOL_DEFAULT ,
141 .BR MPOL_BIND ,
142 .BR MPOL_INTERLEAVE ,
143 .B MPOL_PREFERRED
144 ¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄꤷ¤Æ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
145 .B MPOL_DEFAULT
146 °Ê³°¤Î¥Ý¥ê¥·¡¼¤Î¾ì¹ç¡¢¸Æ¤Ó½Ð¤·¸µ¤Ï
147 .I nodemask
148 °ú¤­¿ô¤Ç°ì¤Ä°Ê¾å¤Î¥Î¡¼¥É¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£
149
150 .\"O The
151 .\"O .I mode
152 .\"O argument may also include an optional
153 .\"O .IR "mode flag" .
154 .\"O The supported
155 .\"O .I "mode flags"
156 .\"O are:
157 .I mode
158 °ú¤­¿ô¤Ë¤Ï¡¢ÄɲäÇ
159 .I "¥â¡¼¥É¥Õ¥é¥°"
160 ¤ò´Þ¤á¤ë¤³¤È¤â¤Ç¤­¤ë¡£
161 ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë
162 .I "¥â¡¼¥É¥Õ¥é¥°"
163 ¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¢¤ë¡£
164 .TP
165 .\"O .BR MPOL_F_STATIC_NODES " (since Linux 2.6.26)"
166 .BR MPOL_F_STATIC_NODES " (Linux 2.6.26 °Ê¹ß)"
167 .\"O A nonempty
168 .\"O .I nodemask
169 .\"O specifies physical node ids.
170 .\"O Linux does will not remap the
171 .\"O .I nodemask
172 .\"O when the process moves to a different cpuset context,
173 .\"O nor when the set of nodes allowed by the process's
174 .\"O current cpuset context changes.
175 ¶õ¤Ç¤Ê¤¤
176 .I nodemask
177 ¤Ï¡¢ÊªÍý¥Î¡¼¥É ID ¤Ç¤¢¤ë¡£
178 Linux ¤Ç¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤¬°Û¤Ê¤ë CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È (cpuset context)
179 ¤Ë°ÜÆ°¤·¤¿¾ì¹ç¤Ç¤â¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç
180 µö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É½¸¹ç¤¬ÊѲ½¤·¤¿¾ì¹ç¤Ç¤â¡¢
181 .I nodemask
182 ¤ò¥Þ¥Ã¥Ô¥ó¥°¤·Ä¾¤¹¤³¤È¤Ï¤Ê¤¤¡£
183 .TP
184 .\"O .BR MPOL_F_RELATIVE_NODES " (since Linux 2.6.26)"
185 .BR MPOL_F_RELATIVE_NODES " (Linux 2.6.26 °Ê¹ß)"
186 .\"O A nonempty
187 .\"O .I nodemask
188 .\"O specifies node ids that are relative to the set of
189 .\"O node ids allowed by the process's current cpuset.
190 ¶õ¤Ç¤Ê¤¤
191 .I nodemask
192 ¤Ï¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¤Çµö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É ID ½¸¹ç
193 ¤Ë¤ª¤±¤ëÁêÂÐŪ¤Ê¥Î¡¼¥É ID ¤Ç¤¢¤ë¡£
194 .PP
195 .\"O .I nodemask
196 .\"O points to a bit mask of node IDs that contains up to
197 .\"O .I maxnode
198 .\"O bits.
199 .\"O The bit mask size is rounded to the next multiple of
200 .\"O .IR "sizeof(unsigned long)" ,
201 .\"O but the kernel will only use bits up to
202 .\"O .IR maxnode .
203 .I nodemask
204 ¤Ï¡¢ºÇÂç¤Ç
205 .I maxnode
206 ¥Ó¥Ã¥È¤«¤é¹½À®¤µ¤ì¤ë¥Î¡¼¥É ID ¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤ò»Ø¤¹¡£
207 ¥Ó¥Ã¥È¥Þ¥¹¥¯¤ÎÂ礭¤µ¤Ï¡¢Ä¾¶á¤Î
208 .I sizeof(unsigned long)
209 ¤ÎÇÜ¿ô¤ËÀÚ¤ê¾å¤²¤é¤ì¤ë¤¬¡¢¥«¡¼¥Í¥ë¤¬»ÈÍѤ¹¤ë¤Î¤Ï
210 .I maxnode
211 ¸Ä¤Þ¤Ç¤Î¥Ó¥Ã¥È¤À¤±¤Ç¤¢¤ë¡£
212 .\"O A NULL value of
213 .\"O .I nodemask
214 .\"O or a
215 .\"O .I maxnode
216 .\"O value of zero specifies the empty set of nodes.
217 .\"O If the value of
218 .\"O .I maxnode
219 .\"O is zero,
220 .\"O the
221 .\"O .I nodemask
222 .\"O argument is ignored.
223 NULL ÃͤÎ
224 .I nodemask
225 ¤â¤·¤¯¤ÏÃͤ¬ 0 ¤Î
226 .I maxnode
227 ¤Ï¥Î¡¼¥É¤Î¶õ½¸¹ç¤òɽ¤¹¡£
228 .I maxnode
229 ¤ÎÃͤ¬ 0 ¤Î¾ì¹ç¡¢
230 .I nodemask
231 °ú¤­¿ô¤Ï̵»ë¤µ¤ì¤ë¡£
232
233 .\"O Where a
234 .\"O .I nodemask
235 .\"O is required, it must contain at least one node that is on-line,
236 .\"O allowed by the process's current cpuset context,
237 .\"O [unless the
238 .\"O .B MPOL_F_STATIC_NODES
239 .\"O mode flag is specified],
240 .\"O and contains memory.
241 .I nodemask
242 ¤¬É¬¿Ü¤Î¾ìÌ̤Ǥϡ¢
243 .I nodemask
244 ¤Ë¡¢¥ª¥ó¥é¥¤¥ó¤Ç¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç
245 µö²Ä¤µ¤ì¤Æ¤ª¤ê
246 .RB ( MPOL_F_STATIC_NODES
247 ¥â¡¼¥É¥Õ¥é¥°¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç)¡¢¥á¥â¥ê¤¬¤¢¤ë¥Î¡¼¥É¤¬
248 ¾¯¤Ê¤¯¤È¤â°ì¤ÄÆþ¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
249 .\"O If the
250 .\"O .B MPOL_F_STATIC_NODES
251 .\"O is set in
252 .\"O .I mode
253 .\"O and a required
254 .\"O .I nodemask
255 .\"O contains no nodes that are allowed by the process's current cpuset context,
256 .\"O the memory policy reverts to
257 .\"O .IR "local allocation" .
258 .\"O This effectively overrides the specified policy until the process's
259 .\"O cpuset context includes one or more of the nodes specified by
260 .\"O .IR nodemask .
261 .I mode
262 ¤Ë
263 .B MPOL_F_STATIC_NODES
264 ¤¬¥»¥Ã¥È¤µ¤ì¡¢
265 .I nodemask
266 ¤¬É¬¿Ü¤Î¾ìÌ̤ǡ¢
267 .I nodemask
268 ¤Ë¡¢¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Çµö²Ä¤µ¤ì¤¿¥Î¡¼¥É¤¬
269 °ì¤Ä¤â´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥á¥â¥ê¤Î¥Ý¥ê¥·¡¼¤È¤·¤Æ¥Ç¥Õ¥©¥ë¥È¤Î
270 ¡Ö¥í¡¼¥«¥ë¤«¤é³ä¤êÅö¤Æ (local allocation)¡×¤¬Å¬ÍѤµ¤ì¤ë¡£
271 ¤½¤Î¥×¥í¥»¥¹¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤¬
272 .I nodemask
273 ¤Ç»ØÄꤵ¤ì¤¿¥Î¡¼¥É¤ò¾¯¤Ê¤¯¤È¤â°ì¤Ä´Þ¤à¤è¤¦¤Ë¤Ê¤ë¤Þ¤Ç¤Ï¡¢
274 ·ë²ÌŪ¤Ë»ØÄꤵ¤ì¤¿Æ°ºî¤¬¾å½ñ¤­¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£
275
276 .\"O The
277 .\"O .B MPOL_DEFAULT
278 .\"O mode specifies that any nondefault process memory policy be removed,
279 .\"O so that the memory policy "falls back" to the system default policy.
280 .\"O The system default policy is "local allocation"--
281 .\"O i.e., allocate memory on the node of the CPU that triggered the allocation.
282 .\"O .I nodemask
283 .\"O must be specified as NULL.
284 .\"O If the "local node" contains no free memory, the system will
285 .\"O attempt to allocate memory from a "near by" node.
286 .B MPOL_DEFAULT
287 ¥â¡¼¥É¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¤Ê¤¤¥×¥í¥»¥¹¤Î¥á¥â¥ê¥Ý¥ê¥·¡¼¤òºï½ü¤¹¤ë¤³¤È¤ò
288 »ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£¤³¤ì¤Ë¤è¤ê¡¢¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï¥·¥¹¥Æ¥à¤Î
289 ¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ë¡ÖÌá¤ë¡×¤³¤È¤Ë¤Ê¤ë¡£
290 ¥·¥¹¥Æ¥à¤Î¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤Ï¡Ö¥í¡¼¥«¥ë¤«¤é¤Î³ä¤êÅö¤Æ (local allocation)¡×¡¢
291 ¤Ä¤Þ¤ê¥á¥â¥ê³ä¤êÅö¤Æ¤Î¤­¤Ã¤«¤±¤È¤Ê¤Ã¤¿ CPU ¤Î¥Î¡¼¥É¤Î¥á¥â¥ê¤¬³ä¤êÅö¤Æ¤é¤ì¤ë¡£
292 .I nodemask
293 ¤Ë¤Ï NULL ¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
294 ¡Ö¼«¥Î¡¼¥É (local node)¡×¤Ë¶õ¤­¥á¥â¥ê¤¬Á´¤¯¤Ê¤¤¾ì¹ç¡¢¥·¥¹¥Æ¥à¤Ï
295 ¡Ö¶á¤¯¤Î (near by) ¥Î¡¼¥É¡×¤«¤é¥á¥â¥ê¤ò³ä¤êÅö¤Æ¤è¤¦¤È»î¤ß¤ë¡£
296
297 .\"O The
298 .\"O .B MPOL_BIND
299 .\"O mode defines a strict policy that restricts memory allocation to the
300 .\"O nodes specified in
301 .\"O .IR nodemask .
302 .\"O If
303 .\"O .I nodemask
304 .\"O specifies more than one node, page allocations will come from
305 .\"O the node with the lowest numeric node ID first, until that node
306 .\"O contains no free memory.
307 .\"O Allocations will then come from the node with the next highest
308 .\"O node ID specified in
309 .\"O .I nodemask
310 .\"O and so forth, until none of the specified nodes contain free memory.
311 .\"O Pages will not be allocated from any node not specified in the
312 .\"O .IR nodemask .
313 .B MPOL_BIND
314 ¥â¡¼¥É¤Ï¸·Ì©¤Ê¥Ý¥ê¥·¡¼¤Ç¡¢¥á¥â¥ê³ä¤êÅö¤Æ¤Ï
315 .I nodemask
316 ¤Ë»ØÄꤵ¤ì¤¿¥Î¡¼¥É¤Ë¸ÂÄꤵ¤ì¤ë¡£
317 .I nodemask
318 ¤Ë 2 ¸Ä°Ê¾å¤Î¥Î¡¼¥É¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ï
319 ¥Î¡¼¥É ID ¤¬¿ô»ú¤È¤·¤ÆºÇ¾®¤Î¥Î¡¼¥É¤«¤é³«»Ï¤µ¤ì¡¢
320 ¤½¤Î¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç¤½¤Î¥Î¡¼¥É¤«¤é
321 ¥Ú¡¼¥¸³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¡£¤½¤Î¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤Ã¤¿¤é¡¢
322 .\"motoki: the next highest ¤Ï the next lowest ¤Î´Ö°ã¤¤¡©
323 ¼¡¤Ë¾®¤µ¤Ê¥Î¡¼¥É ID ¤ò»ý¤Ä¥Î¡¼¥É¤«¤é¥Ú¡¼¥¸³ä¤êÅö¤Æ¤¬¹Ô¤ï¤ì¤ë¡£
324 ¤³¤ì¤ò¡¢
325 .I nodemask
326 ¤Ç»ØÄꤵ¤ì¤¿Á´¤Æ¤Î¥Î¡¼¥É¤Ç¶õ¤­¥á¥â¥ê¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç·«¤êÊÖ¤¹¡£
327 .I nodemask
328 ¤Ç»ØÄꤵ¤ì¤¿°Ê³°¤Î¥Î¡¼¥É¤«¤é¤Ï¥Ú¡¼¥¸¤Î³ä¤êÅö¤Æ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£
329
330 .\"O .B MPOL_INTERLEAVE
331 .\"O interleaves page allocations across the nodes specified in
332 .\"O .I nodemask
333 .\"O in numeric node ID order.
334 .\"O This optimizes for bandwidth instead of latency
335 .\"O by spreading out pages and memory accesses to those pages across
336 .\"O multiple nodes.
337 .\"O However, accesses to a single page will still be limited to
338 .\"O the memory bandwidth of a single node.
339 .B MPOL_INTERLEAVE
340 ¤Ç¤Ï¡¢¥Ú¡¼¥¸³ä¤êÅö¤Æ¤ò
341 .I nodemask
342 ¤Ë»ØÄꤵ¤ì¤¿¥Î¡¼¥É¤Î´Ö¤Ç¥Î¡¼¥É ID ¤Î¿ô»ú½ç¤Ç¸ò¸ß¤Ë¹Ô¤¦¡£
343 ¤³¤Î¥Ý¥ê¥·¡¼¤Ç¤Ï¡¢Ê£¿ô¤Î¥Î¡¼¥É¤Ë¥Ú¡¼¥¸¤ò¹­¤²¤ÆÇÛÃÖ¤·¡¢¤³¤ì¤é¤Î¥Ú¡¼¥¸¤Ø¤Î¥á¥â¥ê
344 ¥¢¥¯¥»¥¹¤òʬ»¶¤¹¤ë¤³¤È¤Ç¡¢ÃÙ±ä¤Ç¤Ï¤Ê¤¯¡¢ÂÓ°è¤òºÇŬ²½¤¹¤ë¡£
345 ¤¿¤À¤·¡¢°ì¤Ä¤Î¥Ú¡¼¥¸¤Ø¤Î¥¢¥¯¥»¥¹¤Ë´Ø¤·¤Æ¤Ï°ÍÁ³¤È¤·¤Æ°ì¤Ä¤Î¥Î¡¼¥É¤Î¥á¥â¥êÂÓ°è
346 ¤¬¾å¸Â¤È¤Ê¤ë¡£
347 .\" NOTE:  the following sentence doesn't make sense in the context
348 .\" of set_mempolicy() -- no memory area specified.
349 .\" To be effective the memory area should be fairly large,
350 .\" at least 1MB or bigger.
351
352 .\"O .B MPOL_PREFERRED
353 .\"O sets the preferred node for allocation.
354 .\"O The kernel will try to allocate pages from this node first
355 .\"O and fall back to "near by" nodes if the preferred node is low on free
356 .\"O memory.
357 .\"O If
358 .\"O .I nodemask
359 .\"O specifies more than one node ID, the first node in the
360 .\"O mask will be selected as the preferred node.
361 .\"O If the
362 .\"O .I nodemask
363 .\"O and
364 .\"O .I maxnode
365 .\"O arguments specify the empty set, then the policy
366 .\"O specifies "local allocation"
367 .\"O (like the system default policy discussed above).
368 .B MPOL_PREFERRED
369 ¤Ï¡¢³ä¤êÅö¤Æ»þ¤ËÍ¥À褵¤ì¤ë¥Î¡¼¥É (preferred node) ¤òÀßÄꤹ¤ë¡£
370 ¥«¡¼¥Í¥ë¤Ï¤Þ¤ºÍ¥Àè¥Î¡¼¥É¤«¤é¥Ú¡¼¥¸³ä¤êÅö¤Æ¤ò¹Ô¤ª¤¦¤È¤·¡¢
371 Í¥Àè¥Î¡¼¥É¤Ë¶õ¤­¥á¥â¥ê¤¬¾¯¤Ê¤¤¾ì¹ç¤Ë¡Ö¶á¤¯¤Î (near by)¡×¥Î¡¼¥É¤«¤é
372 ³ä¤êÅö¤Æ¤ò¹Ô¤¦¡£
373 .I nodemask
374 ¤ËÊ£¿ô¤Î¥Î¡¼¥É ID ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢
375 .I nodemask
376 Æâ¤ÎºÇ½é¤Î¥Î¡¼¥É¤¬Í¥Àè¥Î¡¼¥É¤È¤·¤ÆÁªÂò¤µ¤ì¤ë¡£
377 °ú¤­¿ô
378 .IR nodemask ,
379 .I maxnode
380 ¤Ç¶õ½¸¹ç¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢¥Ý¥ê¥·¡¼¤Ï (¾å½Ò¤Î¥·¥¹¥Æ¥à¤Î
381 ¥Ç¥Õ¥©¥ë¥È¥Ý¥ê¥·¡¼¤ÈƱÍͤË) ¡Ö¥í¡¼¥«¥ë¤«¤é¤Î³ä¤êÅö¤Æ¡×¤È¤Ê¤ë¡£
382
383 .\"O The process memory policy is preserved across an
384 .\"O .BR execve (2),
385 .\"O and is inherited by child processes created using
386 .\"O .BR fork (2)
387 .\"O or
388 .\"O .BR clone (2).
389 ¥×¥í¥»¥¹¤Î¥á¥â¥ê¥Ý¥ê¥·¡¼¤Ï
390 .BR execve (2)
391 ¤ÎÁ°¸å¤ÇÊÝ»ý¤µ¤ì¡¢
392 .BR fork (2)
393 ¤ä
394 .BR clone (2)
395 ¤ò»È¤Ã¤ÆºîÀ®¤µ¤ì¤¿»Ò¥×¥í¥»¥¹¤Ë·Ñ¾µ¤µ¤ì¤ë¡£
396 .\"O .SH RETURN VALUE
397 .SH ÊÖ¤êÃÍ
398 .\"O On success,
399 .\"O .BR set_mempolicy ()
400 .\"O returns 0;
401 .\"O on error, \-1 is returned and
402 .\"O .I errno
403 .\"O is set to indicate the error.
404 À®¸ù¤¹¤ë¤È¡¢
405 .BR set_mempolicy ()
406 ¤Ï 0 ¤òÊÖ¤¹¡£¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
407 .I errno
408 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
409 .\"O .SH ERRORS
410 .SH ¥¨¥é¡¼
411 .TP
412 .B EFAULT
413 .\"O Part of all of the memory range specified by
414 .\"O .I nodemask
415 .\"O and
416 .\"O .I maxnode
417 .\"O points outside your accessible address space.
418 .\"motoki: Part of all of the memory ¤Ï Part or all .. ¤Î´Ö°ã¤¤¡©
419 .I nodemask
420 ¤È
421 .I maxnode
422 ¤Ç»ØÄꤵ¤ì¤¿¥á¥â¥êÎΰè¤Î°ìÉô¤Þ¤¿¤ÏÁ´Éô¤¬¡¢
423 ¸Æ¤Ó½Ð¤·¸µ¤¬¥¢¥¯¥»¥¹²Äǽ¤Ê¥¢¥É¥ì¥¹¶õ´Ö³°¤ò»Ø¤·¤Æ¤¤¤ë¡£
424 .TP
425 .B EINVAL
426 .\"O .I mode
427 .\"O is invalid.
428 .I mode
429 ¤¬ÉÔÀµ¤Ç¤¢¤ë¡£
430 .\"O Or,
431 .\"O .I mode
432 .\"O is
433 .\"O .B MPOL_DEFAULT
434 .\"O and
435 .\"O .I nodemask
436 .\"O is nonempty,
437 .I mode
438 ¤¬
439 .B MPOL_DEFAULT
440 ¤Ç¡¢
441 .I nodemask
442 ¤¬¶õ¤Ç¤Ï¤Ê¤¤¡£
443 .\"O or
444 .\"O .I mode
445 .\"O is
446 .\"O .B MPOL_BIND
447 .\"O or
448 .\"O .B MPOL_INTERLEAVE
449 .\"O and
450 .\"O .I nodemask
451 .\"O is empty.
452 .I mode
453 ¤¬
454 .B MPOL_BIND
455 ¤«
456 .B MPOL_INTERLEAVE
457 ¤Ç¡¢
458 .I nodemask
459 ¤¬¶õ¤Ç¤¢¤ë¡£
460 .\"O Or,
461 .\"O .I maxnode
462 .\"O specifies more than a page worth of bits.
463 .I maxnode
464 ¤Ç¼ÂºÝ¤Ë°ÕÌ£¤¬¤¢¤ë¥Ó¥Ã¥È¿ô¤è¤ê¿¤¯¤Î¥Ó¥Ã¥È¿ô¤¬»ØÄꤵ¤ì¤¿¡£
465 .\"O Or,
466 .\"O .I nodemask
467 .\"O specifies one or more node IDs that are
468 .\"O greater than the maximum supported node ID.
469 .I nodemask
470 ¤Ë¡¢¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ëºÇÂç¥Î¡¼¥É ID ¤è¤êÂ礭¤¤¥Î¡¼¥É¤¬»ØÄꤵ¤ì¤¿¡£
471 .\"O Or, none of the node IDs specified by
472 .\"O .I nodemask
473 .\"O are on-line and allowed by the process's current cpuset context,
474 .\"O or none of the specified nodes contain memory.
475 .I nodemask
476 ¤Ë¡¢¥ª¥ó¥é¥¤¥ó¤Ç¡¢¤«¤Ä¤½¤Î¥×¥í¥»¥¹¤Î¸½ºß¤Î CPU ½¸¹ç¥³¥ó¥Æ¥­¥¹¥È¤Ç
477 µö²Ä¤µ¤ì¤Æ¤¤¤ë¥Î¡¼¥É¤¬°ì¤Ä¤â´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢
478 ¥á¥â¥ê¤ò´Þ¤à¥Î¡¼¥É¤¬°ì¤Ä¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¡£
479 .\"O Or, the
480 .\"O .I mode
481 .\"O argument specified both
482 .\"O .B MPOL_F_STATIC_NODES
483 .\"O and
484 .\"O .BR MPOL_F_RELATIVE_NODES .
485 .I mode
486 °ú¤­¿ô¤Ë
487 .B MPOL_F_STATIC_NODES
488 ¤È
489 .B MPOL_F_RELATIVE_NODES
490 ¤ÎξÊý¤¬»ØÄꤵ¤ì¤¿¡£
491 .TP
492 .B ENOMEM
493 .\"O Insufficient kernel memory was available.
494 ÍøÍѲÄǽ¤Ê¥«¡¼¥Í¥ë¥á¥â¥ê¤¬½½Ê¬¤Ç¤Ê¤«¤Ã¤¿¡£
495 .\"O .SH VERSIONS
496 .SH ¥Ð¡¼¥¸¥ç¥ó
497 .\"O The
498 .\"O .BR set_mempolicy (),
499 .\"O system call was added to the Linux kernel in version 2.6.7.
500 .BR set_mempolicy ()
501 ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥Ð¡¼¥¸¥ç¥ó 2.6.7 ¤Ç Linux ¥«¡¼¥Í¥ë¤ËÄɲ䵤줿¡£
502 .\"O .SH CONFORMING TO
503 .SH ½àµò
504 .\"O This system call is Linux-specific.
505 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£
506 .\"O .SH NOTES
507 .SH Ãí°Õ
508 .\"O Process policy is not remembered if the page is swapped out.
509 ¥Ú¡¼¥¸¤¬¥¹¥ï¥Ã¥×¡¦¥¢¥¦¥È¤µ¤ì¤ë¾ì¹ç¤Ë¤Ï¡¢
510 ¥×¥í¥»¥¹¥Ý¥ê¥·¡¼¤ÎÀßÄê¤Ï¿ä¾©¤µ¤ì¤Ê¤¤¡£
511 .\"O When such a page is paged back in, it will use the policy of
512 .\"O the process or memory range that is in effect at the time the
513 .\"O page is allocated.
514 ¥¹¥ï¥Ã¥×¡¦¥¢¥¦¥È¤µ¤ì¤¿¥Ú¡¼¥¸¤¬¥Ú¡¼¥¸¡¦¥¤¥ó¤¹¤ëºÝ¤Ë¤â¡¢
515 ¥Ú¡¼¥¸³ä¤êÅö¤Æ»þ¤ËŬÍѤµ¤ì¤ë¥×¥í¥»¥¹¥Ý¥ê¥·¡¼¤ä¥á¥â¥êÎΰè¥Ý¥ê¥·¡¼¤¬
516 »ÈÍѤµ¤ì¤ë¡£
517
518 .\"O For information on library support, see
519 .\"O .BR numa (7).
520 ¥é¥¤¥Ö¥é¥ê¤Ë¤è¤ë¥µ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¤Ï
521 .BR numa (7)
522 ¤ò»²¾È¡£
523 .\"O .SH SEE ALSO
524 .SH ´ØÏ¢¹àÌÜ
525 .BR get_mempolicy (2),
526 .BR getcpu (2),
527 .BR mbind (2),
528 .BR mmap (2),
529 .BR numa (3),
530 .BR cpuset (7),
531 .BR numa (7),
532 .BR numactl (8)