Skip to content

cgroup: Add support for cgroups v2

adlternative requested to merge adlternative/gitaly:zh-cgroups-v2 into master

Due to the lack of cgroup V2 support in Gitaly, some operating systems that use cgroup V2 may not be able to use cgroups in Gitaly properly. Therefore, this patch adds support for cgroup V2 in Gitaly, which maintains a similar interface to cgroup V1 but removes the "gitaly_cgroup_memory_reclaim_attempts_total" metric and modifies the label of the "gitaly_cgroup_procs_total" metric compared to V1.

The configuration of cgroup does not need to be changed at present (but it is worth discussing whether some data of cgroup V2 should be used as configuration)

Tests can only be run on machines that support cgroup V2, or in other words, cgroup v1 tests are not compatible with cgroup V2 test. We may have to find a way to detect the operating system cgroup version, and then only run one of the tests.

It is expected that this patch will solve #4025

/cc @chriscool @twk3 @balasankarc

Merge request reports