File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,12 @@ 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
+ On modern systems where cgroup v2 is available, DOMjudge will try to
183
+ use that. This requires kernel versions 5.19 or 6.0 or later to
184
+ support reporting peak memory usage. If not found, the system will try
185
+ to fall back to cgroup v1, but this might require you to add
186
+ ``systemd.unified_cgroup_hierarchy=0 `` to the boot options as well.
187
+
182
188
You have now configured the system to use cgroups. To create
183
189
the actual cgroups that DOMjudge will use you need to run::
184
190
Original file line number Diff line number Diff line change @@ -25,17 +25,19 @@ if [ "$fs_type" = "cgroup2" ]; then
25
25
major=$( echo " $kernel_version " | cut -d ' .' -f 1)
26
26
minor=$( echo " $kernel_version " | cut -d ' .' -f 2)
27
27
if [ " $major " -lt 5 ] || { [ " $major " -eq 5 ] && [ " $minor " -lt 19 ]; }; then
28
- echo " WARNING: Kernel ($kernel_version ) is too old to record peak RAM usage" >&2
28
+ cgroup_error_and_usage " Error: kernel ($kernel_version ) is too old to record peak RAM usage with cgroup V2.
29
+ You can try using cgroup V1 by adding systemd.unified_cgroup_hierarchy=0 to the kernel params."
29
30
fi
30
31
if ! echo " +memory" >> /sys/fs/cgroup/cgroup.subtree_control; then
31
32
cgroup_error_and_usage " Error: Cannot add +memory to cgroup.subtree_control; check kernel params. Unable to continue."
32
33
fi
33
34
if ! echo " +cpuset" >> /sys/fs/cgroup/cgroup.subtree_control; then
34
35
cgroup_error_and_usage " Error: Cannot add +cpuset to cgroup.subtree_control; check kernel params. Unable to continue."
35
36
fi
36
- exit 0
37
37
fi
38
38
39
+ # Trying cgroup V1:
40
+
39
41
for i in cpuset memory; do
40
42
mkdir -p $CGROUPBASE /$i
41
43
if [ ! -d $CGROUPBASE /$i / ]; then
Original file line number Diff line number Diff line change @@ -504,7 +504,7 @@ void output_cgroup_stats_v2(double *cputime)
504
504
int64_t max_usage = 0 ;
505
505
ret = cgroup_get_value_int64 (cg_controller, " memory.peak" , &max_usage);
506
506
if ( ret == ECGROUPVALUENOTEXIST ) {
507
- write_meta ( " internal-warning " , " Kernel too old and does not support memory.peak" );
507
+ error (ret , " kernel too old and does not support memory.peak" );
508
508
} else if ( ret!=0 ) {
509
509
error (ret," get cgroup value memory.peak" );
510
510
}
You can’t perform that action at this time.
0 commit comments