diff --git a/content/posts/cgroup v2 by hand.adoc b/content/posts/cgroup v2 by hand.adoc index d287f5a..354c6a4 100644 --- a/content/posts/cgroup v2 by hand.adoc +++ b/content/posts/cgroup v2 by hand.adoc @@ -82,9 +82,10 @@ We will keep it simple by only setting controllers globally in our root cgroup. == Controlling CPU usage -This control group will use the cpu controllerfootnote:controllers[]. Every -process in this group will be deprioritized, all processes together can only use -the power of 2 CPU cores. +This control group will use the cpu +controllerfootnote:[link:{url-kernel-doc}#cpu[Kernel documentation on Control +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] -------------------------------------------------------------------------------- @@ -126,8 +127,10 @@ values used by link:{url-nice}[nice] and has a range from -20 to 19. === Controlling CPU core usage -This control group will use the cpuset controller to restrict the processes to -the CPU cores 0 and 3. +This control group will use the cpuset +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] -------------------------------------------------------------------------------- @@ -148,8 +151,9 @@ kbd:[Enter]. == Controlling memory usage -This control group will use the memory controllerfootnote:controllers[]. All -processes together can only use 1 +This control group will use the memory +controllerfootnote:[link:{url-kernel-doc}#memory[Kernel documentation on Control +Group v2, section Controllers → Memory]]. All processes together can only use 1 pass:[GiB] of memory at most. [source,shell] @@ -173,7 +177,8 @@ echo "$$" > cgroup.procs This control group will increase the IO priority and limit the write speed to 2 pass:[MiB] 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 want to limit (in my case it is “8:0” for `/dev/sda`). Run `lsblk` or `cat /proc/partitions` to find them out. @@ -209,7 +214,8 @@ yet, since I run kernel 5.10. == Controlling process numbers 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] --------------------------------------------------------------------------------