File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -179,8 +179,8 @@ Optionally the timings can be made more stable by not letting the OS schedule
179179any other tasks on the same CPU core the judgedaemon is using:
180180``GRUB_CMDLINE_LINUX_DEFAULT="quiet cgroup_enable=memory swapaccount=1 isolcpus=2" ``
181181
182- You have now configured the system to use cgroups. On systems with
183- cgroups v1, you need to run::
182+ You have now configured the system to use cgroups. To create
183+ the actual cgroups that DOMjudge will use you need to run::
184184
185185 sudo systemctl enable create-cgroups --now
186186
Original file line number Diff line number Diff line change 99JUDGEHOSTUSER=@DOMJUDGE_USER@
1010CGROUPBASE=" /sys/fs/cgroup"
1111
12- # We do not need to do any of this with cgroup v2.
13- fs_type=$( awk ' $2 == "/sys/fs/cgroup" {print $3}' /proc/mounts)
14- if [ " $fs_type " = " cgroup2" ]; then
15- echo " cgroup v2 detected, skipping cgroup creation" >&2
16- exit 0
17- fi
18-
1912cgroup_error_and_usage () {
2013 echo " $1 " >&2
2114 echo " To fix this, please make the following changes:
2215 1. In /etc/default/grub, add 'cgroup_enable=memory swapaccount=1' to GRUB_CMDLINE_LINUX_DEFAULT.
23- On modern distros (e.g. Debian bullseye and Ubuntu Jammy Jellyfish) which have cgroup v2 enabled by default,
24- you need to add 'systemd.unified_cgroup_hierarchy=0' as well.
2516 2. Run update-grub
2617 3. Reboot" >&2
2718 exit 1
2819}
2920
21+ # Check whether cgroup v2 is available.
22+ fs_type=$( awk ' $2 == "/sys/fs/cgroup" {print $3}' /proc/mounts)
23+ if [ " $fs_type " = " cgroup2" ]; then
24+ if ! echo " +memory" >> /sys/fs/cgroup/cgroup.subtree_control; then
25+ cgroup_error_and_usage " Error: Cannot add +memory to cgroup.subtree_control; check kernel params. Unable to continue."
26+ fi
27+ if ! echo " +cpuset" >> /sys/fs/cgroup/cgroup.subtree_control; then
28+ cgroup_error_and_usage " Error: Cannot add +cpuset to cgroup.subtree_control; check kernel params. Unable to continue."
29+ fi
30+ exit 0
31+ fi
32+
3033for i in cpuset memory; do
3134 mkdir -p $CGROUPBASE /$i
3235 if [ ! -d $CGROUPBASE /$i / ]; then
You can’t perform that action at this time.
0 commit comments