HomeClusterLabs Projects

main: Add support for cgroup v2 and auto mode

Description

main: Add support for cgroup v2 and auto mode

Support for cgroup v2 is very similar to cgroup v1 just checking (and
writing) different file.

Because of all the problems described later with cgroup v2 new "auto"
mode (new default) is added. This mode first tries to set rr scheduling
and moves Corosync to root cgroup only if it fails.

Testing this feature is a bit harder than with cgroup v1 so it's
probably worh noting in this commit message.

  1. Copy some service file (I've used httpd service) and set CPUQuota=30% in the [service] section.
  2. Check /sys/fs/cgroup/cgroup.subtree_control - there should be no "cpu"
  3. Start modified service
  4. Check /sys/fs/cgroup/cgroup.subtree_control - there should be "cpu"
  5. Start corosync - It should be able to get rt priority

When move_to_root_cgroup is disabled (applies only for kernels
with CONFIG_RT_GROUP_SCHED enabled), behavior differs:

  • If corosync is started before modified service, so there is no "cpu" in /sys/fs/cgroup/cgroup.subtree_control corosync starts without problem and gets rt priority. Starting modified service later will never add "cpu" into /sys/fs/cgroup/cgroup.subtree_control (because corosync is holding rt priority and it is placed in the non-root cgroup by systemd).
  • When corosync is started after modified service, so "cpu" is in /sys/fs/cgroup/cgroup.subtree_control, corosync is not able to get RT priority.

It's worth noting problems when cgroup v2 is used together with systemd
logging described in corosync.conf(5) man page.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>

Details

Provenance
jfriesseAuthored on May 3 2021, 9:29 AM
Parents
rC24b787248b06: stats: fix crash when iterating over deleted keys
Branches
Unknown
Tags
Unknown

Event Timeline