cgroups v2 возникли проблемы при попытке установить ограничение процессора - PullRequest
0 голосов
/ 01 июля 2019

Env: пользовательское ядро ​​Linux 5.0.0 на x86_64 Fedora 29

При попытке настроить ограничение ЦП с помощью cgroups v2 я фактически отключил cgroups v1, передав

cgroup_no_v1=all 

в качестве параметра ядра cmdline. Это выглядит нормально, и теперь различные контроллеры (процессор, память, ...) отображаются под /sys/fs/cgroup/unified/cgroup.controllers.

Однако, делая:

# mkdir /sys/fs/cgroup/unified/test1
# echo "+cpu " > /sys/fs/cgroup/unified/test1/cgroup.subtree_control
bash: echo: write error: No such file or directory
# 

Я понимаю, что это ожидаемо, поскольку man-страница cgroups (7) упоминает:

    As at Linux 4.15, the cgroups v2 cpu controller does not support 
control of realtime processes, and the controller can be enabled in the 
root cgroup only if all realtime threads are in the root cgroup. (If there 
are realtime processes in nonroot cgroups, then a write(2) of the string 
"+cpu" to the cgroup.subtree_control file fails with the error EINVAL. 
However, on some systems, systemd(1) places certain realtime processes in 
nonroot cgroups in the v2 hierarchy. On such systems, these processes must 
first be moved to the root cgroup before the cpu controller can be 
enabled.

Мои вопросы: как именно «переместить процессы реального времени в корневую группу»? Какие команды? И как определить, какие процессы? Те, которые имеют политику SCHED_FIFO или SCHED_RR? Будет ли использование служебной оболочки сделать это проще? (libcgroup, cgmanager и т. д.) - хорошо ли они играют с cgroups2? ТИА!

...