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
179
179
any other tasks on the same CPU core the judgedaemon is using:
180
180
``GRUB_CMDLINE_LINUX_DEFAULT="quiet cgroup_enable=memory swapaccount=1 isolcpus=2" ``
181
181
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::
184
184
185
185
sudo systemctl enable create-cgroups --now
186
186
Original file line number Diff line number Diff line change 9
9
JUDGEHOSTUSER=@DOMJUDGE_USER@
10
10
CGROUPBASE=" /sys/fs/cgroup"
11
11
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
-
19
12
cgroup_error_and_usage () {
20
13
echo " $1 " >&2
21
14
echo " To fix this, please make the following changes:
22
15
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.
25
16
2. Run update-grub
26
17
3. Reboot" >&2
27
18
exit 1
28
19
}
29
20
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
+
30
33
for i in cpuset memory; do
31
34
mkdir -p $CGROUPBASE /$i
32
35
if [ ! -d $CGROUPBASE /$i / ]; then
You can’t perform that action at this time.
0 commit comments