OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / draft / man2 / ioprio_set.2
1 .\" This is _*_ nroff _*_ source. Emacs, gimme all those colors :)
2 .\"
3 .\" Copyright (c) International Business Machines orp., 2006
4 .\"
5 .\" This program is free software; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" This program is distributed in the hope that it will be useful,
11 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
12 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
13 .\" the GNU General Public License for more details.
14 .\"
15 .\" You should have received a copy of the GNU General Public License
16 .\" along with this program; if not, write to the Free Software
17 .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 .\" MA 02111-1307 USA
19 .\"
20 .\" HISTORY:
21 .\" 2006-04-27, created by Eduardo M. Fleury <efleury@br.ibm.com>
22 .\" with various additions by Michael Kerrisk <mtk.manpages@gmail.com>
23 .\"
24 .\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI
25 .\"         all rights reserved.
26 .\" Translated 2007-01-09, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.43
27 .\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05
28 .\"
29 .TH IOPRIO_SET 2 2008-07-09 "Linux" "Linux Programmer's Manual"
30 .\"O .SH NAME
31 .SH Ì¾Á°
32 .\"O ioprio_get, ioprio_set \- get/set I/O scheduling class and priority
33 ioprio_get, ioprio_set \- I/O ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤ÈÍ¥ÀèÅÙ¤ÎÀßÄê/¼èÆÀ
34 .\"O .SH SYNOPSIS
35 .SH ½ñ¼°
36 .nf
37 .BI "int ioprio_get(int " which ", int " who );
38 .BI "int ioprio_set(int " which ", int " who ", int " ioprio );
39 .fi
40 .\"O .SH DESCRIPTION
41 .SH ÀâÌÀ
42 .\"O The
43 .\"O .BR ioprio_get ()
44 .\"O and
45 .\"O .BR ioprio_set ()
46 .\"O system calls respectively get and set the I/O scheduling class and
47 .\"O priority of one or more processes.
48 ¥·¥¹¥Æ¥à¥³¡¼¥ë
49 .BR ioprio_get ()
50 /
51 .BR ioprio_set ()
52 ¤Ï¡¢(1¤Ä°Ê¾å¤Î) ¥×¥í¥»¥¹¤Î I/O ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤È
53 Í¥ÀèÅ٤μèÆÀ/ÀßÄê¤ò¹Ô¤¦¡£
54
55 .\"O The
56 .\"O .I which
57 .\"O and
58 .\"O .I who
59 .\"O arguments identify the process(es) on which the system
60 .\"O calls operate.
61 .\"O The
62 .\"O .I which
63 .\"O argument determines how
64 .\"O .I who
65 .\"O is interpreted, and has one of the following values:
66 .I which
67 ¤È
68 .I who
69 °ú¤­¿ô¤Ç¥·¥¹¥Æ¥à¥³¡¼¥ë¤ÎÁàºîÂоݤȤʤë¥×¥í¥»¥¹¤ò»Ø¼¨¤¹¤ë¡£
70 .I which
71 °ú¤­¿ô¤Ï¡¢
72 .I who
73 ¤ò¤É¤Î¤è¤¦¤Ë²ò¼á¤¹¤ë¤«¤ò·è¤á¤ë¤â¤Î¤Ç¡¢°Ê²¼¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò»ØÄꤹ¤ë¡£
74 .TP
75 .B IOPRIO_WHO_PROCESS
76 .\"O .I who
77 .\"O is a process ID identifying a single process.
78 .I who
79 ¤Ï¥×¥í¥»¥¹ID ¤Ç¤¢¤ê¡¢»ØÄꤵ¤ì¤¿ 1 ¥×¥í¥»¥¹¤¬ÂоݤȤʤ롣
80 .TP
81 .B IOPRIO_WHO_PGRP
82 .\"O .I who
83 .\"O is a process group ID identifying all the members of a process group.
84 .I who
85 ¤Ï¥×¥í¥»¥¹¥°¥ë¡¼¥×ID ¤Ç¤¢¤ê¡¢¥×¥í¥»¥¹¥°¥ë¡¼¥×¤ÎÁ´¥á¥ó¥Ð¤¬ÂоݤȤʤ롣
86 .TP
87 .B IOPRIO_WHO_USER
88 .\"O .I who
89 .\"O is a user ID identifying all of the processes that
90 .\"O have a matching real UID.
91 .I who
92 ¤Ï¥æ¡¼¥¶ID ¤Ç¤¢¤ê¡¢¼Â UID ¤Ë°ìÃפ¹¤ëÁ´¥×¥í¥»¥¹¤¬ÂоݤȤʤ롣
93 .PP
94 .\"O If
95 .\"O .I which
96 .\"O is specified as
97 .\"O .B IOPRIO_WHO_PGRP
98 .\"O or
99 .\"O .B IOPRIO_WHO_USER
100 .\"O when calling
101 .\"O .BR ioprio_get (),
102 .\"O and more than one process matches
103 .\"O .IR who ,
104 .\"O then the returned priority will be the highest one found among
105 .\"O all of the matching processes.
106 .\"O One priority is said to be
107 .\"O higher than another one if it belongs to a higher priority
108 .\"O class
109 .\"O .RB ( IOPRIO_CLASS_RT
110 .\"O is the highest priority class;
111 .\"O .B IOPRIO_CLASS_IDLE
112 .\"O is the lowest)
113 .\"O or if it belongs to the same priority class as the other process but
114 .\"O has a higher priority level (a lower priority number means a
115 .\"O higher priority level).
116 .BR ioprio_get ()
117 ¤Î¸Æ¤Ó½Ð¤·»þ¤Ë
118 .I which
119 ¤Ë
120 .B IOPRIO_WHO_PGRP
121 ¤«
122 .B IOPRIO_WHO_USER
123 ¤¬»ØÄꤵ¤ì¡¢
124 .I who
125 ¤Ë°ìÃפ¹¤ë¥×¥í¥»¥¹¤¬Ê£¿ô¤¢¤Ã¤¿¾ì¹ç¡¢
126 °ìÃפ¹¤ë¥×¥í¥»¥¹Á´ÂΤÎÃæ¤ÇºÇ¤â¹â¤¤Í¥ÀèÅÙ¤¬ÊÖ¤µ¤ì¤ë¡£
127 Í¥ÀèÅÙ¤¬¹â¤¤¤È¤Ï¡¢¤è¤ê¹â¤¤Í¥ÀèÅÙ¥¯¥é¥¹¤Ë°¤·¤Æ¤¤¤ë
128 .RB ( IOPRIO_CLASS_RT
129 ¤¬ºÇ¤â¹â¤¤Í¥ÀèÅÙ¥¯¥é¥¹¤Ç¡¢
130 .B IOPRIO_CLASS_IDLE
131 ¤¬ºÇ¤âÄ㤤)¡¢¤â¤·¤¯¤Ï
132 Ʊ¤¸Í¥ÀèÅÙ¥¯¥é¥¹¤Ë°¤·¤Æ¤¤¤ë¤¬Í¥ÀèÅÙ¥ì¥Ù¥ë¤¬¹â¤¤
133 (Í¥ÀèÅÙÈֹ椬¾®¤µ¤¤Êý¤¬Í¥ÀèÅÙ¥ì¥Ù¥ë¤¬¹â¤¤¤³¤È¤ò°ÕÌ£¤¹¤ë)¡¢
134 ¤È¤¤¤¦¤³¤È¤Ç¤¢¤ë¡£
135
136 .\"O The
137 .\"O .I ioprio
138 .\"O argument given to
139 .\"O .BR ioprio_set ()
140 .\"O is a bit mask that specifies both the scheduling class and the
141 .\"O priority to be assigned to the target process(es).
142 .\"O The following macros are used for assembling and dissecting
143 .\"O .I ioprio
144 .\"O values:
145 .BR ioprio_set ()
146 ¤ËÅϤ¹
147 .I ioprio
148 °ú¤­¿ô¤Ï¡¢ÂоݤȤʤë¥×¥í¥»¥¹¤Ë³ä¤êÅö¤Æ¤ë¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤È
149 Í¥ÀèÅÙ¤ÎξÊý¤ò»ØÄꤹ¤ë¥Ó¥Ã¥È¥Þ¥¹¥¯¤Ç¤¢¤ë¡£
150 .I ioprio
151 ¤ÎÃͤòÁȤßΩ¤Æ¤¿¤ê²ò¼á¤¹¤ë¤Î¤Ë¡¢°Ê²¼¤Î¥Þ¥¯¥í¤¬ÍøÍѤǤ­¤ë¡£
152 .TP
153 .BI IOPRIO_PRIO_VALUE( class ", " data )
154 .\"O Given a scheduling
155 .\"O .I class
156 .\"O and priority
157 .\"O .RI ( data ),
158 .\"O this macro combines the two values to produce an
159 .\"O .I ioprio
160 .\"O value, which is returned as the result of the macro.
161 ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹
162 .I class
163 ¤ÈÍ¥ÀèÅÙ
164 .RI ( data )
165 ¤òÍ¿¤¨¤ë¤È¡¢¤³¤Î¥Þ¥¯¥í¤Ï 2¤Ä¤ÎÃͤòÁȤ߹ç¤ï¤»¤Æ¡¢
166 .I ioprio
167 ÃͤòÀ¸À®¤·¡¢¥Þ¥¯¥í¤Î·ë²Ì¤È¤·¤ÆÊÖ¤¹¡£
168 .TP
169 .BI IOPRIO_PRIO_CLASS( mask )
170 .\"O Given
171 .\"O .I mask
172 .\"O (an
173 .\"O .I ioprio
174 .\"O value), this macro returns its I/O class component, that is,
175 .\"O one of the values
176 .\"O .BR IOPRIO_CLASS_RT ,
177 .\"O .BR IOPRIO_CLASS_BE ,
178 .\"O or
179 .\"O .BR IOPRIO_CLASS_IDLE .
180 .I mask
181 .RI ( ioprio
182 ÃÍ) ¤òÍ¿¤¨¤ë¤È¡¢¤³¤Î¥Þ¥¯¥í¤Ï I/O ¥¯¥é¥¹Í×ÁÇ¡¢¤Ä¤Þ¤ê
183 .BR IOPRIO_CLASS_RT ,
184 .BR IOPRIO_CLASS_BE ,
185 .B IOPRIO_CLASS_IDLE
186 ¤Î¤¤¤º¤ì¤«°ì¤Ä¤ÎÃͤòÊÖ¤¹¡£
187 .TP
188 .BI IOPRIO_PRIO_DATA( mask )
189 .\"O Given
190 .\"O .I mask
191 .\"O (an
192 .\"O .I ioprio
193 .\"O value), this macro returns its priority
194 .\"O .RI ( data )
195 .\"O component.
196 .I mask
197 .RI ( ioprio
198 ÃÍ) ¤òÍ¿¤¨¤ë¤È¡¢¤³¤Î¥Þ¥¯¥í¤ÏÍ¥ÀèÅÙ
199 .RI ( data )
200 Í×ÁǤòÊÖ¤¹¡£
201 .PP
202 .\"O See the NOTES section for more
203 .\"O information on scheduling classes and priorities.
204 ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤ÈÍ¥ÀèÅ٤˴ؤ¹¤ë¾Ü¤·¤¤¾ðÊó¤Ï¡¢
205 ¡ÖÈ÷¹Í¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£
206
207 .\"O I/O priorities are supported for reads and for synchronous
208 .\"O .RB ( O_DIRECT ,
209 .\"O .BR O_SYNC )
210 .\"O writes.
211 .\"O I/O priorities are not supported for asynchronous
212 .\"O writes because they are issued outside the context of the program
213 .\"O dirtying the memory, and thus program-specific priorities do not apply.
214 I/O Í¥ÀèÅÙ¤ÏÆɤ߽Ф·¤ÈƱ´ü½ñ¤­¹þ¤ß
215 .RB ( O_DIRECT ,
216 .BR O_SYNC )
217 ¤ËÂбþ¤·¤Æ¤¤¤ë¡£
218 I/O Í¥ÀèÅÙ¤ÏÈóƱ´ü½ñ¤­¹þ¤ß¤Ë¤ÏÂбþ¤·¤Æ¤¤¤Ê¤¤¡£¤Ê¤¼¤Ê¤é¡¢
219 ÈóƱ´ü½ñ¤­¹þ¤ß¤Ï¥á¥â¥ê½ñ¤­´¹¤¨¤ò¹Ô¤¦¥×¥í¥°¥é¥à¤ÎÆ°ºî (context) ¤È¤Ï
220 ´Ø·¸¤Ê¤¯È¯¹Ô¤µ¤ì¡¢¤½¤Î¤¿¤á¥×¥í¥°¥é¥àñ°Ì¤ÎÍ¥ÀèÅÙ¤ÏŬÍѤµ¤ì¤Ê¤¤¤«¤é
221 ¤Ç¤¢¤ë¡£
222 .\"O .SH "RETURN VALUE"
223 .SH ÊÖ¤êÃÍ
224 .\"O On success,
225 .\"O .BR ioprio_get ()
226 .\"O returns the
227 .\"O .I ioprio
228 .\"O value of the process with highest I/O priority of any of the processes
229 .\"O that match the criteria specified in
230 .\"O .I which
231 .\"O and
232 .\"O .IR who .
233 .\"O On error, \-1 is returned, and
234 .\"O .I errno
235 .\"O is set to indicate the error.
236 À®¸ù¤¹¤ë¤È¡¢
237 .BR ioprio_get ()
238 ¤Ï¡¢
239 .I which
240 ¤È
241 .I who
242 ¤Ç»ØÄꤵ¤ì¤¿´ð½à¤Ë¹çÃפ·¤¿Á´¥×¥í¥»¥¹¤ÇºÇ¤â¹â¤¤ I/O Í¥ÀèÅÙ¤ò»ý¤Ä¥×¥í¥»¥¹¤Î
243 .I ioprio
244 ÃͤòÊÖ¤¹¡£
245 ¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
246 .I errno
247 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
248 .PP
249 .\"O On success,
250 .\"O .BR ioprio_set ()
251 .\"O returns 0.
252 .\"O On error, \-1 is returned, and
253 .\"O .I errno
254 .\"O is set to indicate the error.
255 À®¸ù¤¹¤ë¤È¡¢
256 .BR ioprio_set ()
257 ¤Ï 0 ¤òÊÖ¤¹¡£
258 ¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
259 .I errno
260 ¤Ë¥¨¥é¡¼¤ò¼¨¤¹ÃͤòÀßÄꤹ¤ë¡£
261 .\"O .SH ERRORS
262 .SH ¥¨¥é¡¼
263 .TP
264 .B EINVAL
265 .\"O Invalid value for
266 .\"O .I which
267 .\"O or
268 .\"O .IR ioprio .
269 .\"O Refer to the NOTES section for available scheduler
270 .\"O classes and priority levels for
271 .\"O .IR ioprio .
272 .I which
273 ¤«
274 .I ioprio
275 ¤ÎÃͤ¬ÉÔÀµ¤Ç¤¢¤ë¡£
276 .I ioprio
277 ÍѤ˻ØÄê²Äǽ¤Ê¥¹¥±¥¸¥å¡¼¥é¥¯¥é¥¹¤ÈÍ¥ÀèÅÙ¥ì¥Ù¥ë¤Ë¤Ä¤¤¤Æ¤Ï
278 ¡ÖÈ÷¹Í¡×¤ò»²¾È¤Î¤³¤È¡£
279 .TP
280 .B EPERM
281 .\"O The calling process does not have the privilege needed to assign this
282 .\"O .I ioprio
283 .\"O to the specified process(es).
284 .\"O See the NOTES section for more information on required
285 .\"O privileges for
286 .\"O .BR ioprio_set ().
287 ¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤¬¡¢»ØÄꤵ¤ì¤¿¥×¥í¥»¥¹¤Ë
288 .I ioprio
289 ¤ò³ä¤êÅö¤Æ¤ë¤Î¤ËɬÍפʸ¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£
290 .BR ioprio_set ()
291 ¤ËɬÍפʸ¢¸Â¤Ë¤Ä¤¤¤Æ¤Î¾Ü¤·¤¤¾ðÊó¤Ï¡ÖÈ÷¹Í¡×¤ÎÀá¤ò»²¾È¤Î¤³¤È¡£
292 .TP
293 .B ESRCH
294 .\"O No process(es) could be found that matched the specification in
295 .\"O .I which
296 .\"O and
297 .\"O .IR who .
298 .I which
299 ¤È
300 .I who
301 ¤Ç»ØÄꤵ¤ì¤¿´ð½à¤Ë¹çÃפ¹¤ë¥×¥í¥»¥¹¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£
302 .\"O .SH VERSIONS
303 .SH ¥Ð¡¼¥¸¥ç¥ó
304 .\"O These system calls have been available on Linux since
305 .\"O kernel 2.6.13.
306 ¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥«¡¼¥Í¥ë 2.6.13 °Ê¹ß¤Î Linux ¤ÇÍøÍѲÄǽ¤Ç¤¢¤ë¡£
307 .\"O .SH "CONFORMING TO"
308 .SH ½àµò
309 .\"O These system calls are Linux-specific.
310 ¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£
311 .\"O .SH NOTES
312 .SH È÷¹Í
313 .\"O Glibc does not provide wrapper for these system calls; call them using
314 .\"O .BR syscall (2).
315 glibc ¤Ï¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤ËÂФ¹¤ë¥é¥Ã¥Ñ¡¼´Ø¿ô¤òÄ󶡤·¤Æ¤¤¤Ê¤¤¡£
316 .BR syscall (2)
317 ¤ò»È¤Ã¤Æ¸Æ¤Ó½Ð¤¹¤³¤È¡£
318
319 .\"O These system calls only have an effect when used
320 .\"O in conjunction with an I/O scheduler that supports I/O priorities.
321 .\"O As at kernel 2.6.17 the only such scheduler is the Completely Fair Queuing
322 .\"O (CFQ) I/O scheduler.
323 ¤³¤ì¤é¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢I/O Í¥ÀèÅÙ¤ËÂбþ¤·¤¿ I/O ¥¹¥±¥¸¥å¡¼¥é¤È
324 ÁȤ߹ç¤ï¤»¤Æ»ÈÍѤµ¤ì¤¿¾ì¹ç¤Ë¤Î¤ß¸ú²Ì¤ò»ý¤Ä¡£
325 ¥«¡¼¥Í¥ë 2.6.17 ¤Ç¤Ï¡¢¤³¤Î¾ò·ï¤òËþ¤¿¤¹¥¹¥±¥¸¥å¡¼¥é¤Ï
326 Completely Fair Queuing (CFQ) I/O ¥¹¥±¥¸¥å¡¼¥é¤À¤±¤Ç¤¢¤ë¡£
327 .\"O .SS "Selecting an I/O Scheduler"
328 .SS I/O ¥¹¥±¥¸¥å¡¼¥é¤ÎÁªÂò
329 .\"O I/O Schedulers are selected on a per-device basis via the special
330 .\"O file
331 .\"O .IR /sys/block/<device>/queue/scheduler .
332 I/O ¥¹¥±¥¸¥å¡¼¥é¤ÎÁªÂò¤Ï¥Ç¥Ð¥¤¥¹Ã±°Ì¤Ë¹Ô¤ï¤ì¡¢¤½¤ÎÁªÂò¤Ï
333 ¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë
334 .I /sys/block/<device>/queue/scheduler
335 ·Ðͳ¤Ç¹Ô¤ï¤ì¤ë¡£
336
337 .\"O One can view the current I/O scheduler via the
338 .\"O .I /sys
339 .\"O file system.
340 .\"O For example, the following command
341 .\"O displays a list of all schedulers currently loaded in the kernel:
342 ¸½ºß¤Î I/O ¥¹¥±¥¸¥å¡¼¥é¤Ï
343 .I /sys
344 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à·Ðͳ¤Ç»²¾È¤Ç¤­¤ë¡£Î㤨¤Ð¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤È¡¢
345 ¸½ºß¥«¡¼¥Í¥ë¤Ç¥í¡¼¥É¤µ¤ì¤Æ¤¤¤ë¥¹¥±¥¸¥å¡¼¥é¤ÎÁ´¥ê¥¹¥È¤¬É½¼¨¤µ¤ì¤ë¡£
346 .sp
347 .RS
348 .nf
349 .RB "$" " cat /sys/block/hda/queue/scheduler"
350 noop anticipatory deadline [cfq]
351 .fi
352 .RE
353 .sp
354 .\"O The scheduler surrounded by brackets is the one actually
355 .\"O in use for the device
356 .\"O .RI ( hda
357 .\"O in the example).
358 ³ç¸Ì¤Ç°Ï¤Þ¤ì¤¿¥¹¥±¥¸¥å¡¼¥é¤¬¤½¤Î¥Ç¥Ð¥¤¥¹ (¾å¤ÎÎã¤Ç¤Ï
359 .IR hda )
360 ¤Ë¤Ä¤¤¤Æ¼ÂºÝ¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¥¹¥±¥¸¥å¡¼¥é¤Ç¤¢¤ë¡£
361 .\"O Setting another scheduler is done by writing the name of the
362 .\"O new scheduler to this file.
363 .\"O For example, the following command will set the
364 .\"O scheduler for the
365 .\"O .I hda
366 .\"O device to
367 .\"O .IR cfq :
368 Ê̤Υ¹¥±¥¸¥å¡¼¥é¤òÀßÄꤹ¤ë¤Ë¤Ï¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¿·¤·¤¤¥¹¥±¥¸¥å¡¼¥é̾¤ò
369 ½ñ¤­¹þ¤á¤Ð¤è¤¤¡£Î㤨¤Ð¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤È¡¢¥Ç¥Ð¥¤¥¹
370 .I hda
371 ¤Î¥¹¥±¥¸¥å¡¼¥é¤È¤·¤Æ
372 .I cfq
373 ¤¬ÀßÄꤵ¤ì¤ë¡£
374 .sp
375 .RS
376 .nf
377 .RB "$" " su"
378 Password:
379 .RB "#" " echo cfq > /sys/block/hda/queue/scheduler"
380 .fi
381 .RE
382 .\"O .SS "The Completely Fair Queuing (CFQ) I/O Scheduler"
383 .SS "Completely Fair Queuing (CFQ) I/O ¥¹¥±¥¸¥å¡¼¥é"
384 .\"O Since v3 (aka CFQ Time Sliced) CFQ implements
385 .\"O I/O nice levels similar to those
386 .\"O of CPU scheduling.
387 .\"O These nice levels are grouped in three scheduling classes
388 .\"O each one containing one or more priority levels:
389 ¥Ð¡¼¥¸¥ç¥ó 3 (ÊÌ̾ CFQ Time Sliced) °Ê¹ß¡¢
390 CPU ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ÈƱÍͤΠI/O nice ¥ì¥Ù¥ë¤¬ CFQ ¤Ë¼ÂÁõ¤µ¤ì¤Æ¤¤¤ë¡£
391 ¤³¤ì¤é¤Î nice ¥ì¥Ù¥ë¤Ï 3¤Ä¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤ËʬÎà¤Ç¤­¡¢
392 ³Æ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤Ë¤Ä¤­ 1¤Ä°Ê¾å¤ÎÍ¥ÀèÅÙ¥ì¥Ù¥ë¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
393 .TP
394 .BR IOPRIO_CLASS_RT " (1)"
395 .\"O This is the real-time I/O class.
396 .\"O This scheduling class is given
397 .\"O higher priority than any other class:
398 .\"O processes from this class are
399 .\"O given first access to the disk every time.
400 .\"O Thus this I/O class needs to be used with some
401 .\"O care: one I/O real-time process can starve the entire system.
402 .\"O Within the real-time class,
403 .\"O there are 8 levels of class data (priority) that determine exactly
404 .\"O how much time this process needs the disk for on each service.
405 .\"O The highest real-time priority level is 0; the lowest is 7.
406 .\"O In the future this might change to be more directly mappable to
407 .\"O performance, by passing in a desired data rate instead.
408 ¤³¤ì¤Ï¥ê¥¢¥ë¥¿¥¤¥à I/O ¥¯¥é¥¹¤Ç¤¢¤ë¡£
409 ¤³¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤Ë¤Ï¾¤Î¥¯¥é¥¹¤è¤ê¤â¹â¤¤Í¥ÀèÅÙ¤¬Í¿¤¨¤é¤ì¤ë¡£
410 ¤³¤Î¥¯¥é¥¹¤Î¥×¥í¥»¥¹¤Ë¤Ï¡¢¾ï¤Ë¥Ç¥£¥¹¥¯¤Ø¤Î¥¢¥¯¥»¥¹¤¬Í¥À褷¤Æ
411 ³ä¤êÅö¤Æ¤é¤ì¤ë¡£¤½¤Î¤¿¤á¡¢¤³¤Î I/O ¥¯¥é¥¹¤ò»È¤¦ºÝ¤Ë¤Ï¡¢
412 ¤¿¤Ã¤¿°ì¤Ä¤Î ¥ê¥¢¥ë¥¿¥¤¥à I/O ¥¯¥é¥¹¤Î¥×¥í¥»¥¹¤Ë¤è¤ê
413 ¥·¥¹¥Æ¥àÁ´ÂΤΥǥ£¥¹¥¯¥¢¥¯¥»¥¹¤¬¤Ç¤­¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦¤³¤È¤¬¤¢¤ë
414 ¤È¤¤¤¦ÅÀ¤Ë¡¢Ãí°Õ¤òʧ¤¦É¬Íפ¬¤¢¤ë¡£
415 ¤³¤Î¥¯¥é¥¹¤Ë¤Ï¡¢8 Ãʳ¬¤Î class data (Í¥ÀèÅÙ¥ì¥Ù¥ë) ¤¬¤¢¤ë¡£
416 ¤³¤ÎÃͤϡ¢¤½¤Î¥×¥í¥»¥¹¤¬ 1²ó¤Î¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹¤Ë¤É¤ì¤À¤±¤Î
417 »þ´Ö¤¬É¬Íפ«¤òÀµ³Î¤Ë·è¤á¤ë¤¿¤á¤Î¤â¤Î¤Ç¤¢¤ë¡£
418 ºÇ¹â¤Î¥ê¥¢¥ë¥¿¥¤¥àÍ¥ÀèÅÙ¥ì¥Ù¥ë¤Ï 0 ¤Ç¡¢ºÇÄã¤Ï 7 ¤Ç¤¢¤ë¡£
419 ¾­ÍèŪ¤Ë¤Ï¡¢Í¥ÀèÅÙ¥ì¥Ù¥ë¤Ï¡¢´õ˾¤¹¤ë¥Ç¡¼¥¿¥ì¡¼¥È¤òÅϤ¹¤Ê¤É¡¢
420 ¤è¤êľÀÜŪ¤ËÀ­Ç½¾ò·ï¤òÈ¿±Ç¤Ç¤­¤ë¤è¤¦¤ËÊѹ¹¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
421 .TP
422 .BR IOPRIO_CLASS_BE " (2)"
423 .\"O This is the best-effort scheduling class,
424 .\"O which is the default for any process
425 .\"O that hasn't set a specific I/O priority.
426 .\"O The class data (priority) determines how much
427 .\"O I/O bandwidth the process will get.
428 .\"O Best-effort priority levels are analogous to CPU nice values
429 .\"O (see
430 .\"O .BR getpriority (2)).
431 .\"O The priority level determines a priority relative
432 .\"O to other processes in the best-effort scheduling class.
433 .\"O Priority levels range from 0 (highest) to 7 (lowest).
434 ¤³¤ì¤Ï ¥Ù¥¹¥È¥¨¥Õ¥©¡¼¥È¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤Ç¤¢¤ë¡£
435 ¤³¤Î¥¯¥é¥¹¤Ï¡¢ÆÃÄê¤Î I/O Í¥ÀèÅÙ¤òÀßÄꤷ¤Æ¤¤¤Ê¤¤¥×¥í¥»¥¹¤Î
436 ¥Ç¥Õ¥©¥ë¥ÈÃͤǤ¢¤ë¡£
437 class data (Í¥ÀèÅÙ¥ì¥Ù¥ë) ¤Ë¤è¤ê¡¢¤½¤Î¥×¥í¥»¥¹¤¬¤É¤ÎÄøÅÙ¤Î
438 I/O ÂÓ°è¤òÆÀ¤é¤ì¤ë¤«¤¬·èÄꤵ¤ì¤ë¡£
439 ¥Ù¥¹¥È¥¨¥Õ¥©¡¼¥È¡¦Í¥ÀèÅÙ¥ì¥Ù¥ë¤Ï¡¢CPU ¤Î nice ÃÍ
440 .RB ( getpriority (2)
441 »²¾È) ¤ÈƱÍͤΤâ¤Î¤Ç¤¢¤ë¡£
442 Í¥ÀèÅÙ¥ì¥Ù¥ë¤Ï¡¢¥Ù¥¹¥È¥¨¥Õ¥©¡¼¥È¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤ÎÃæ¤Ç
443 ¾¤Î¥×¥í¥»¥¹¤È¤ÎÁêÂÐŪ¤ÊÍ¥ÀèÅÙ¤ò·èÄꤹ¤ë¡£
444 Í¥ÀèÅÙ¥ì¥Ù¥ë¤ÎÃͤÎÈϰϤϠ0 (ºÇ¹â) ¤«¤é 7 (ºÇÄã) ¤Ç¤¢¤ë¡£
445 .TP
446 .BR IOPRIO_CLASS_IDLE " (3)"
447 .\"O This is the idle scheduling class.
448 .\"O Processes running at this level only get I/O
449 .\"O time when no-one else needs the disk.
450 .\"O The idle class has no class data.
451 .\"O Attention is required when assigning this priority class to a process,
452 .\"O since it may become starved if higher priority processes are
453 .\"O constantly accessing the disk.
454 ¤³¤ì¤Ï idle ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥¯¥é¥¹¤Ç¤¢¤ë¡£
455 ¤³¤Î¥ì¥Ù¥ë¤ÇÆ°ºî¤¹¤ë¥×¥í¥»¥¹¤Ï¾¤Ë¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹¤ò¤·¤è¤¦¤È¤¹¤ë
456 ¥×¥í¥»¥¹¤¬¤Ê¤¤¾ì¹ç¤Ë¤Î¤ß I/O »þ´Ö¤ò¼èÆÀ¤¹¤ë¡£
457 idle ¥¯¥é¥¹¤Ë¤Ï class data (Í¥ÀèÅÙ) ¤ÏÍÑ°Õ¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
458 ¥×¥í¥»¥¹¤Ë¤³¤ÎÍ¥ÀèÅÙ¤ò³ä¤êÅö¤Æ¤ëºÝ¤Ë¤ÏÃí°Õ¤¬É¬ÍפǤ¢¤ë¡£
459 ¤Ê¤¼¤Ê¤é¡¢Í¥ÀèÅ٤ι⤤¥×¥í¥»¥¹¤¬¾ï¤Ë¥Ç¥£¥¹¥¯¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï
460 ¥Ç¥£¥¹¥¯¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¯¤Ê¤ë²ÄǽÀ­¤¬¤¢¤ë¤«¤é¤À¡£
461 .PP
462 .\"O Refer to
463 .\"O .I Documentation/block/ioprio.txt
464 .\"O for more information on the CFQ I/O Scheduler and an example program.
465 CFQ I/O ¥¹¥±¥¸¥å¡¼¥é¤Î¹¹¤Ê¤ë¾ðÊó¤È¥µ¥ó¥×¥ë¥×¥í¥°¥é¥à¤Ë¤Ä¤¤¤Æ¤Ï
466 .I Documentation/block/ioprio.txt
467 ¤ò»²¾È¤Î¤³¤È¡£
468 .\"O .SS "Required permissions to set I/O priorities"
469 .SS "I/O Í¥ÀèÅÙ¤ÎÀßÄê¤ËɬÍפʵö²Ä"
470 .\"O Permission to change a process's priority is granted or denied based
471 .\"O on two assertions:
472 ¥×¥í¥»¥¹¤ÎÍ¥ÀèÅÙ¤òÊѹ¹¤¹¤ëµö²Ä¤¬ÆÀ¤é¤ì¤ë¤«¤É¤¦¤«¤Ï
473 °Ê²¼¤Î 2¤Ä¤Î¾ò·ï¤Ë´ð¤¤¤Æ·èÄꤵ¤ì¤ë¡£
474 .TP
475 .\"O .B "Process ownership"
476 .B "¥×¥í¥»¥¹¤Î½êÍ­¸¢"
477 .\"O An unprivileged process may only set the I/O priority of a process
478 .\"O whose real UID
479 .\"O matches the real or effective UID of the calling process.
480 .\"O A process which has the
481 .\"O .B CAP_SYS_NICE
482 .\"O capability can change the priority of any process.
483 ÈóÆø¢¥×¥í¥»¥¹¤Ï¡¢¥×¥í¥»¥¹¤Î¼Â UID ¤¬¸Æ¤Ó½Ð¤·¸µ¥×¥í¥»¥¹¤Î¼Â UID ¤â¤·¤¯¤Ï
484 ¼Â¸ú UID ¤È°ìÃפ¹¤ë¥×¥í¥»¥¹¤Î I/O Í¥ÀèÅ٤ΤߤòÀßÄê¤Ç¤­¤ë¡£
485 .B CAP_SYS_NICE
486 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤ò»ý¤Ä¥×¥í¥»¥¹¤Ï¡¢¤É¤Î¥×¥í¥»¥¹¤ÎÍ¥ÀèÅ٤ǤâÊѹ¹¤Ç¤­¤ë¡£
487 .TP
488 .\"O .B "What is the desired priority"
489 .B "¤É¤ÎÍ¥ÀèÅÙ¤ËÀßÄꤷ¤è¤¦¤È¤·¤Æ¤¤¤ë¤«"
490 .\"O Attempts to set very high priorities
491 .\"O .RB ( IOPRIO_CLASS_RT )
492 .\"O require the
493 .\"O .B CAP_SYS_ADMIN
494 .\"O capability.
495 Èó¾ï¤Ë¹â¤¤Í¥ÀèÅÙ
496 .RB ( IOPRIO_CLASS_RT )
497 ¤òÀßÄꤷ¤è¤¦¤È¤¹¤ë¾ì¹ç¡¢
498 .B CAP_SYS_ADMIN
499 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤ë¡£
500 .\"O Kernel versions up to 2.6.24 also required
501 .\"O .B CAP_SYS_ADMIN
502 .\"O to set a very low priority
503 .\"O .RB ( IOPRIO_CLASS_IDLE ),
504 .\"O but since Linux 2.6.25, this is no longer required.
505 ¥«¡¼¥Í¥ë 2.6.24 °ÊÁ°¤Ç¤Ï¡¢Èó¾ï¤ËÄ㤤ͥÀèÅÙ
506 .RB ( IOPRIO_CLASS_IDLE )
507 ¤òÀßÄꤹ¤ë¤¿¤á¤Ë¤â
508 .B CAP_SYS_ADMIN
509 ¥±¡¼¥Ñ¥Ó¥ê¥Æ¥£¤¬É¬ÍפǤ¢¤Ã¤¿¤¬¡¢
510 Linux 2.6.25 °Ê¹ß¤Ç¤Ï¤â¤Ï¤äɬÍפʤ¯¤Ê¤Ã¤¿¡£
511 .PP
512 .\"O A call to
513 .\"O .BR ioprio_set ()
514 .\"O must follow both rules, or the call will fail with the error
515 .\"O .BR EPERM .
516 .BR ioprio_set ()
517 ¤Ï¤³¤ÎξÊý¤Î¥ë¡¼¥ë¤Ë½¾¤¤¡¢¾ò·ï¤òËþ¤¿¤µ¤Ê¤¤¾ì¹ç¡¢¥¨¥é¡¼
518 .B EPERM
519 ¤Ç¼ºÇÔ¤¹¤ë¡£
520 .\"O .SH BUGS
521 .SH ¥Ð¥°
522 .\" 6 May 07: Bug report raised:
523 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=4464
524 .\" Ulriich Drepper replied that he wasn't going to add these
525 .\" to glibc.
526 .\"O Glibc does not yet provide a suitable header file defining
527 .\"O the function prototypes and macros described on this page.
528 .\"O Suitable definitions can be found in
529 .\"O .IR linux/ioprio.h .
530 glibc ¤Ï¡¢¤³¤Î¥Ú¡¼¥¸¤Ëµ­ºÜ¤µ¤ì¤¿´Ø¿ô¥×¥í¥È¥¿¥¤¥×¤ä¥Þ¥¯¥í¤òÄêµÁ¤¹¤ë
531 ŬÀڤʥإåÀ¥Õ¥¡¥¤¥ë¤ò¤Þ¤ÀÄ󶡤·¤Æ¤¤¤Ê¤¤¡£
532 ɬÍפÊÄêµÁ¤Ë¤Ä¤¤¤Æ¤Ï
533 .I linux/ioprio.h
534 ¤ò¸«¤ì¤Ð¤è¤¤¡£
535 .\"O .SH "SEE ALSO"
536 .SH ´ØÏ¢¹àÌÜ
537 .BR getpriority (2),
538 .BR open (2),
539 .BR capabilities (7)
540 .sp
541 .\"O Documentation/block/ioprio.txt in the kernel source tree.
542 ¥«¡¼¥Í¥ë¡¦¥½¡¼¥¹Æâ¤Î Documentation/block/ioprio.txt