From 0ed11ccd25a5cc6227453cae7752b2698af502bf Mon Sep 17 00:00:00 2001 From: Nicky Gerritsen Date: Thu, 10 Oct 2024 20:16:34 +0200 Subject: [PATCH] Make sure to enable memory and cpuset cgroup in v2 --- doc/manual/install-judgehost.rst | 3 +-- judge/create_cgroups.in | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/manual/install-judgehost.rst b/doc/manual/install-judgehost.rst index 9fd6d02c5a..9e28553e04 100644 --- a/doc/manual/install-judgehost.rst +++ b/doc/manual/install-judgehost.rst @@ -180,8 +180,7 @@ any other tasks on the same CPU core the judgedaemon is using: ``GRUB_CMDLINE_LINUX_DEFAULT="quiet cgroup_enable=memory swapaccount=1 isolcpus=2"`` You have now configured the system to use cgroups. To create -the actual cgroups that DOMjudge will use, on systems with cgroups v1, you need -to run:: +the actual cgroups that DOMjudge will use you need to run:: sudo systemctl enable create-cgroups --now diff --git a/judge/create_cgroups.in b/judge/create_cgroups.in index 1b96cfee66..a8d2e73ae7 100755 --- a/judge/create_cgroups.in +++ b/judge/create_cgroups.in @@ -12,7 +12,8 @@ CGROUPBASE="/sys/fs/cgroup" # We do not need to do any of this with cgroup v2. fs_type=$(awk '$2 == "/sys/fs/cgroup" {print $3}' /proc/mounts) if [ "$fs_type" = "cgroup2" ]; then - echo "cgroup v2 detected, skipping cgroup creation" >&2 + echo "+memory" >> /sys/fs/cgroup/cgroup.subtree_control + echo "+cpuset" >> /sys/fs/cgroup/cgroup.subtree_control exit 0 fi