Skip to content

Commit 99c8b23

Browse files
mchehabhtejun
authored andcommitted
docs: cgroup-v1: convert docs to ReST and rename to *.rst
Convert the cgroup-v1 files to ReST format, in order to allow a later addition to the admin-guide. The conversion is actually: - add blank lines and identation in order to identify paragraphs; - fix tables markups; - add some lists markups; - mark literal blocks; - adjust title markups. At its new index.rst, let's add a :orphan: while this is not linked to the main index.rst file, in order to avoid build warnings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 38cf3a6 commit 99c8b23

34 files changed

Lines changed: 966 additions & 648 deletions

Documentation/admin-guide/hw-vuln/l1tf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ Guest mitigation mechanisms
241241
For further information about confining guests to a single or to a group
242242
of cores consult the cpusets documentation:
243243

244-
https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt
244+
https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.rst
245245

246246
.. _interrupt_isolation:
247247

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4078,7 +4078,7 @@
40784078

40794079
relax_domain_level=
40804080
[KNL, SMP] Set scheduler's default relax_domain_level.
4081-
See Documentation/cgroup-v1/cpusets.txt.
4081+
See Documentation/cgroup-v1/cpusets.rst.
40824082

40834083
reserve= [KNL,BUGS] Force kernel to ignore I/O ports or memory
40844084
Format: <base1>,<size1>[,<base2>,<size2>,...]
@@ -4588,7 +4588,7 @@
45884588
swapaccount=[0|1]
45894589
[KNL] Enable accounting of swap in memory resource
45904590
controller if no parameter or 1 is given or disable
4591-
it if 0 is given (See Documentation/cgroup-v1/memory.txt)
4591+
it if 0 is given (See Documentation/cgroup-v1/memory.rst)
45924592

45934593
swiotlb= [ARM,IA-64,PPC,MIPS,X86]
45944594
Format: { <int> | force | noforce }

Documentation/admin-guide/mm/numa_memory_policy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ document attempts to describe the concepts and APIs of the 2.6 memory policy
1515
support.
1616

1717
Memory policies should not be confused with cpusets
18-
(``Documentation/cgroup-v1/cpusets.txt``)
18+
(``Documentation/cgroup-v1/cpusets.rst``)
1919
which is an administrative mechanism for restricting the nodes from which
2020
memory may be allocated by a set of processes. Memory policies are a
2121
programming interface that a NUMA-aware application can take advantage of. When

Documentation/block/bfq-iosched.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ As for cgroups-v1 (blkio controller), the exact set of stat files
539539
created, and kept up-to-date by bfq, depends on whether
540540
CONFIG_DEBUG_BLK_CGROUP is set. If it is set, then bfq creates all
541541
the stat files documented in
542-
Documentation/cgroup-v1/blkio-controller.txt. If, instead,
542+
Documentation/cgroup-v1/blkio-controller.rst. If, instead,
543543
CONFIG_DEBUG_BLK_CGROUP is not set, then bfq creates only the files
544544
blkio.bfq.io_service_bytes
545545
blkio.bfq.io_service_bytes_recursive

Documentation/cgroup-v1/blkio-controller.txt renamed to Documentation/cgroup-v1/blkio-controller.rst

Lines changed: 56 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
Block IO Controller
2-
===================
1+
===================
2+
Block IO Controller
3+
===================
4+
35
Overview
46
========
57
cgroup subsys "blkio" implements the block io controller. There seems to be
@@ -22,28 +24,35 @@ Proportional Weight division of bandwidth
2224
You can do a very simple testing of running two dd threads in two different
2325
cgroups. Here is what you can do.
2426

25-
- Enable Block IO controller
27+
- Enable Block IO controller::
28+
2629
CONFIG_BLK_CGROUP=y
2730

28-
- Enable group scheduling in CFQ
31+
- Enable group scheduling in CFQ:
32+
33+
2934
CONFIG_CFQ_GROUP_IOSCHED=y
3035

3136
- Compile and boot into kernel and mount IO controller (blkio); see
3237
cgroups.txt, Why are cgroups needed?.
3338

39+
::
40+
3441
mount -t tmpfs cgroup_root /sys/fs/cgroup
3542
mkdir /sys/fs/cgroup/blkio
3643
mount -t cgroup -o blkio none /sys/fs/cgroup/blkio
3744

38-
- Create two cgroups
45+
- Create two cgroups::
46+
3947
mkdir -p /sys/fs/cgroup/blkio/test1/ /sys/fs/cgroup/blkio/test2
4048

41-
- Set weights of group test1 and test2
49+
- Set weights of group test1 and test2::
50+
4251
echo 1000 > /sys/fs/cgroup/blkio/test1/blkio.weight
4352
echo 500 > /sys/fs/cgroup/blkio/test2/blkio.weight
4453

4554
- Create two same size files (say 512MB each) on same disk (file1, file2) and
46-
launch two dd threads in different cgroup to read those files.
55+
launch two dd threads in different cgroup to read those files::
4756

4857
sync
4958
echo 3 > /proc/sys/vm/drop_caches
@@ -65,24 +74,27 @@ cgroups. Here is what you can do.
6574

6675
Throttling/Upper Limit policy
6776
-----------------------------
68-
- Enable Block IO controller
77+
- Enable Block IO controller::
78+
6979
CONFIG_BLK_CGROUP=y
7080

71-
- Enable throttling in block layer
81+
- Enable throttling in block layer::
82+
7283
CONFIG_BLK_DEV_THROTTLING=y
7384

74-
- Mount blkio controller (see cgroups.txt, Why are cgroups needed?)
85+
- Mount blkio controller (see cgroups.txt, Why are cgroups needed?)::
86+
7587
mount -t cgroup -o blkio none /sys/fs/cgroup/blkio
7688

7789
- Specify a bandwidth rate on particular device for root group. The format
78-
for policy is "<major>:<minor> <bytes_per_second>".
90+
for policy is "<major>:<minor> <bytes_per_second>"::
7991

8092
echo "8:16 1048576" > /sys/fs/cgroup/blkio/blkio.throttle.read_bps_device
8193

8294
Above will put a limit of 1MB/second on reads happening for root group
8395
on device having major/minor number 8:16.
8496

85-
- Run dd to read a file and see if rate is throttled to 1MB/s or not.
97+
- Run dd to read a file and see if rate is throttled to 1MB/s or not::
8698

8799
# dd iflag=direct if=/mnt/common/zerofile of=/dev/null bs=4K count=1024
88100
1024+0 records in
@@ -99,7 +111,7 @@ throttling's hierarchy support is enabled iff "sane_behavior" is
99111
enabled from cgroup side, which currently is a development option and
100112
not publicly available.
101113

102-
If somebody created a hierarchy like as follows.
114+
If somebody created a hierarchy like as follows::
103115

104116
root
105117
/ \
@@ -115,7 +127,7 @@ directly generated by tasks in that cgroup.
115127

116128
Throttling without "sane_behavior" enabled from cgroup side will
117129
practically treat all groups at same level as if it looks like the
118-
following.
130+
following::
119131

120132
pivot
121133
/ / \ \
@@ -152,27 +164,31 @@ Proportional weight policy files
152164
These rules override the default value of group weight as specified
153165
by blkio.weight.
154166

155-
Following is the format.
167+
Following is the format::
168+
169+
# echo dev_maj:dev_minor weight > blkio.weight_device
170+
171+
Configure weight=300 on /dev/sdb (8:16) in this cgroup::
172+
173+
# echo 8:16 300 > blkio.weight_device
174+
# cat blkio.weight_device
175+
dev weight
176+
8:16 300
177+
178+
Configure weight=500 on /dev/sda (8:0) in this cgroup::
156179

157-
# echo dev_maj:dev_minor weight > blkio.weight_device
158-
Configure weight=300 on /dev/sdb (8:16) in this cgroup
159-
# echo 8:16 300 > blkio.weight_device
160-
# cat blkio.weight_device
161-
dev weight
162-
8:16 300
180+
# echo 8:0 500 > blkio.weight_device
181+
# cat blkio.weight_device
182+
dev weight
183+
8:0 500
184+
8:16 300
163185

164-
Configure weight=500 on /dev/sda (8:0) in this cgroup
165-
# echo 8:0 500 > blkio.weight_device
166-
# cat blkio.weight_device
167-
dev weight
168-
8:0 500
169-
8:16 300
186+
Remove specific weight for /dev/sda in this cgroup::
170187

171-
Remove specific weight for /dev/sda in this cgroup
172-
# echo 8:0 0 > blkio.weight_device
173-
# cat blkio.weight_device
174-
dev weight
175-
8:16 300
188+
# echo 8:0 0 > blkio.weight_device
189+
# cat blkio.weight_device
190+
dev weight
191+
8:16 300
176192

177193
- blkio.leaf_weight[_device]
178194
- Equivalents of blkio.weight[_device] for the purpose of
@@ -297,30 +313,30 @@ Throttling/Upper limit policy files
297313
- blkio.throttle.read_bps_device
298314
- Specifies upper limit on READ rate from the device. IO rate is
299315
specified in bytes per second. Rules are per device. Following is
300-
the format.
316+
the format::
301317

302-
echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.read_bps_device
318+
echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.read_bps_device
303319

304320
- blkio.throttle.write_bps_device
305321
- Specifies upper limit on WRITE rate to the device. IO rate is
306322
specified in bytes per second. Rules are per device. Following is
307-
the format.
323+
the format::
308324

309-
echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.write_bps_device
325+
echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.write_bps_device
310326

311327
- blkio.throttle.read_iops_device
312328
- Specifies upper limit on READ rate from the device. IO rate is
313329
specified in IO per second. Rules are per device. Following is
314-
the format.
330+
the format::
315331

316-
echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.read_iops_device
332+
echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.read_iops_device
317333

318334
- blkio.throttle.write_iops_device
319335
- Specifies upper limit on WRITE rate to the device. IO rate is
320336
specified in io per second. Rules are per device. Following is
321-
the format.
337+
the format::
322338

323-
echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.write_iops_device
339+
echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.write_iops_device
324340

325341
Note: If both BW and IOPS rules are specified for a device, then IO is
326342
subjected to both the constraints.

0 commit comments

Comments
 (0)