Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99c8b231 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Tejun Heo
Browse files

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: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 38cf3a68
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -241,7 +241,7 @@ Guest mitigation mechanisms
   For further information about confining guests to a single or to a group
   of cores consult the cpusets documentation:

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

.. _interrupt_isolation:

+2 −2
Original line number Diff line number Diff line
@@ -4078,7 +4078,7 @@

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

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

	swiotlb=	[ARM,IA-64,PPC,MIPS,X86]
			Format: { <int> | force | noforce }
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ document attempts to describe the concepts and APIs of the 2.6 memory policy
support.

Memory policies should not be confused with cpusets
(``Documentation/cgroup-v1/cpusets.txt``)
(``Documentation/cgroup-v1/cpusets.rst``)
which is an administrative mechanism for restricting the nodes from which
memory may be allocated by a set of processes. Memory policies are a
programming interface that a NUMA-aware application can take advantage of.  When
+1 −1
Original line number Diff line number Diff line
@@ -539,7 +539,7 @@ As for cgroups-v1 (blkio controller), the exact set of stat files
created, and kept up-to-date by bfq, depends on whether
CONFIG_DEBUG_BLK_CGROUP is set. If it is set, then bfq creates all
the stat files documented in
Documentation/cgroup-v1/blkio-controller.txt. If, instead,
Documentation/cgroup-v1/blkio-controller.rst. If, instead,
CONFIG_DEBUG_BLK_CGROUP is not set, then bfq creates only the files
blkio.bfq.io_service_bytes
blkio.bfq.io_service_bytes_recursive
+56 −40
Original line number Diff line number Diff line
===================
Block IO Controller
===================

Overview
========
cgroup subsys "blkio" implements the block io controller. There seems to be
@@ -22,28 +24,35 @@ Proportional Weight division of bandwidth
You can do a very simple testing of running two dd threads in two different
cgroups. Here is what you can do.

- Enable Block IO controller
- Enable Block IO controller::

	CONFIG_BLK_CGROUP=y

- Enable group scheduling in CFQ
- Enable group scheduling in CFQ:


	CONFIG_CFQ_GROUP_IOSCHED=y

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

  ::

	mount -t tmpfs cgroup_root /sys/fs/cgroup
	mkdir /sys/fs/cgroup/blkio
	mount -t cgroup -o blkio none /sys/fs/cgroup/blkio

- Create two cgroups
- Create two cgroups::

	mkdir -p /sys/fs/cgroup/blkio/test1/ /sys/fs/cgroup/blkio/test2

- Set weights of group test1 and test2
- Set weights of group test1 and test2::

	echo 1000 > /sys/fs/cgroup/blkio/test1/blkio.weight
	echo 500 > /sys/fs/cgroup/blkio/test2/blkio.weight

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

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

Throttling/Upper Limit policy
-----------------------------
- Enable Block IO controller
- Enable Block IO controller::

	CONFIG_BLK_CGROUP=y

- Enable throttling in block layer
- Enable throttling in block layer::

	CONFIG_BLK_DEV_THROTTLING=y

- Mount blkio controller (see cgroups.txt, Why are cgroups needed?)
- Mount blkio controller (see cgroups.txt, Why are cgroups needed?)::

        mount -t cgroup -o blkio none /sys/fs/cgroup/blkio

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

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

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

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

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

If somebody created a hierarchy like as follows.
If somebody created a hierarchy like as follows::

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

Throttling without "sane_behavior" enabled from cgroup side will
practically treat all groups at same level as if it looks like the
following.
following::

				pivot
			     /  /   \  \
@@ -152,23 +164,27 @@ Proportional weight policy files
	  These rules override the default value of group weight as specified
	  by blkio.weight.

	  Following is the format.
	  Following is the format::

	    # echo dev_maj:dev_minor weight > blkio.weight_device
	  Configure weight=300 on /dev/sdb (8:16) in this cgroup

	  Configure weight=300 on /dev/sdb (8:16) in this cgroup::

	    # echo 8:16 300 > blkio.weight_device
	    # cat blkio.weight_device
	    dev     weight
	    8:16    300

	  Configure weight=500 on /dev/sda (8:0) in this cgroup
	  Configure weight=500 on /dev/sda (8:0) in this cgroup::

	    # echo 8:0 500 > blkio.weight_device
	    # cat blkio.weight_device
	    dev     weight
	    8:0     500
	    8:16    300

	  Remove specific weight for /dev/sda in this cgroup
	  Remove specific weight for /dev/sda in this cgroup::

	    # echo 8:0 0 > blkio.weight_device
	    # cat blkio.weight_device
	    dev     weight
@@ -297,28 +313,28 @@ Throttling/Upper limit policy files
- blkio.throttle.read_bps_device
	- Specifies upper limit on READ rate from the device. IO rate is
	  specified in bytes per second. Rules are per device. Following is
	  the format.
	  the format::

	    echo "<major>:<minor>  <rate_bytes_per_second>" > /cgrp/blkio.throttle.read_bps_device

- blkio.throttle.write_bps_device
	- Specifies upper limit on WRITE rate to the device. IO rate is
	  specified in bytes per second. Rules are per device. Following is
	  the format.
	  the format::

	    echo "<major>:<minor>  <rate_bytes_per_second>" > /cgrp/blkio.throttle.write_bps_device

- blkio.throttle.read_iops_device
	- Specifies upper limit on READ rate from the device. IO rate is
	  specified in IO per second. Rules are per device. Following is
	  the format.
	  the format::

	   echo "<major>:<minor>  <rate_io_per_second>" > /cgrp/blkio.throttle.read_iops_device

- blkio.throttle.write_iops_device
	- Specifies upper limit on WRITE rate to the device. IO rate is
	  specified in io per second. Rules are per device. Following is
	  the format.
	  the format::

	    echo "<major>:<minor>  <rate_io_per_second>" > /cgrp/blkio.throttle.write_iops_device

Loading