domjudge
domjudge copied to clipboard
Add cgroup v2 support
Hi, currently runguard is using libcgroup to manipulate cgroup creation and controller settings. But some distributions are moving to cgroup v2: Fedora https://www.redhat.com/sysadmin/fedora-31-control-group-v2 RHEL https://www.redhat.com/ja/blog/world-domination-cgroups-rhel-8-welcome-cgroups-v2 Archlinux https://wiki.archlinux.org/index.php/cgroups#Enable_cgroup_v1
It will be nice if we have cgroup v2 support at future. libcgroup seems not to be supporting cgroupv2 in their C API, but since the file structure is unified, it shouldn't be too complex to just creating directories in cgroup's VFS.
Note that Docker for Mac recently switched to cgroup v2 as well.
Hi, my sysadmin refuses to install DOMJudge if it does not support cgroup v2. Are there any plans to upgrade DOMJudge?
We have looked into this already but it is super non trivial. The API changed and some stuff is hard / not doable, so we need to investigate. I don't think it's on a timeline anytime soon.
Unfortunately, it looks like we currently have to wait until libcgroup-dev becomes available in debian stable in version v3.0+. I very much would hope that this is next summer, but I am skeptical as the version is only in experimental right now.
I was mistaken, cgroup v2 support is partially available libcgroup v2.0.
systemd v255 (currently in rc3 or something) will officially remove cgroup v1 AFAIK, so from now on, DomJudge won't run anymore on up-to-date systems.
Hi, I wanted to ask if it is soon planned to support cgroups v2, as the deprecation of cgroups v1 is coming closer...
Hi, I wanted to ask if it is soon planned to support cgroups v2, as the deprecation of cgroups v1 is coming closer...
The coming months we are not planning to implement larger/harder features. As far as I'm aware (but didn't do extensive research on the subject) we can still use cgroupv1 as it is still supported with the kernel but only systemd will not support it anymore. Do you have more information on the subject? The main issue is that not all needed features are implemented in CGroupV2 so we can't do a 1 to 1 translation.
According to the kernel (https://github.com/torvalds/linux/blob/b401b621758e46812da61fa58a67c3fd8d91de0d/tools/testing/selftests/bpf/cgroup_helpers.h#L32) cgroupv1 is still tested for.
Pull requests adding cgroupv2 functionality are of course welcome!
I have a WiP port of runguard to cgroupv2 https://github.com/Johnnynator/domjudge/tree/cgroup with some assumptions that are not correct for domjudge (would need minor adjustments since the port is configured to create a systemd slice and scope with different naming than the old group) (Tested in a setup with jobe)
The main issue is that not all needed features are implemented in CGroupV2 so we can't do a 1 to 1 translation.
The only major difference I noticed was that memory is now hard split between memory and swap and no combined limit_in_bytes
I did not notice any other major differences
I was mistaken, cgroup v2 support is partially available libcgroup v2.0.
Anything before v3.1 has bugs that would need workarounds in the code.
Thanks for this! We will look into your code to see what we can reuse (and of course credit you if we do).