cgroup: Add more precise footnotes.

This commit is contained in:
tastytea 2021-07-22 00:04:36 +02:00
parent fa77f6868c
commit 0be2de3cf8
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 15 additions and 9 deletions

View File

@ -82,9 +82,10 @@ We will keep it simple by only setting controllers globally in our root cgroup.
== Controlling CPU usage == Controlling CPU usage
This control group will use the cpu controllerfootnote:controllers[]. Every This control group will use the cpu
process in this group will be deprioritized, all processes together can only use controllerfootnote:[link:{url-kernel-doc}#cpu[Kernel documentation on Control
the power of 2 CPU cores. Group v2, section Controllers → CPU]]. Every process in this group will be
deprioritized, all processes together can only use the power of 2 CPU cores.
[source,shell] [source,shell]
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -126,8 +127,10 @@ values used by link:{url-nice}[nice] and has a range from -20 to 19.
=== Controlling CPU core usage === Controlling CPU core usage
This control group will use the cpuset controller to restrict the processes to This control group will use the cpuset
the CPU cores 0 and 3. controllerfootnote:[link:{url-kernel-doc}#cpuset[Kernel documentation on Control
Group v2, section Controllers → Cpuset]] to restrict the processes to the CPU
cores 0 and 3.
[source,shell] [source,shell]
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -148,8 +151,9 @@ kbd:[Enter].
== Controlling memory usage == Controlling memory usage
This control group will use the memory controllerfootnote:controllers[]. All This control group will use the memory
processes together can only use 1 controllerfootnote:[link:{url-kernel-doc}#memory[Kernel documentation on Control
Group v2, section Controllers → Memory]]. All processes together can only use 1
pass:[<abbr title="Gibibyte, 1024 Mebibyte">GiB</abbr>] of memory at most. pass:[<abbr title="Gibibyte, 1024 Mebibyte">GiB</abbr>] of memory at most.
[source,shell] [source,shell]
@ -173,7 +177,8 @@ echo "$$" > cgroup.procs
This control group will increase the IO priority and limit the write speed to 2 This control group will increase the IO priority and limit the write speed to 2
pass:[<abbr title="Mebibyte, 1024 Kibibyte">MiB</abbr>] a second using the io pass:[<abbr title="Mebibyte, 1024 Kibibyte">MiB</abbr>] a second using the io
controllerfootnote:controllers[]. IO limits are set per device. You need to controllerfootnote:[link:{url-kernel-doc}#io[Kernel documentation on Control
Group v2, section Controllers → IO]]. IO limits are set per device. You need to
specify the major and minor device numbers of the _device_ (not partition) you specify the major and minor device numbers of the _device_ (not partition) you
want to limit (in my case it is “8:0” for `/dev/sda`). Run `lsblk` or `cat want to limit (in my case it is “8:0” for `/dev/sda`). Run `lsblk` or `cat
/proc/partitions` to find them out. /proc/partitions` to find them out.
@ -209,7 +214,8 @@ yet, since I run kernel 5.10.
== Controlling process numbers == Controlling process numbers
This control group will limit the amount of processes to 10 using the process This control group will limit the amount of processes to 10 using the process
number controllerfootnote:controllers[]. number controllerfootnote:[link:{url-kernel-doc}#pid[Kernel documentation on
Control Group v2, section Controllers → PID]].
[source,shell] [source,shell]
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------