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
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+ 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+
182188You have now configured the system to use cgroups. To create
183189the actual cgroups that DOMjudge will use you need to run::
184190
Original file line number Diff line number Diff line change @@ -25,17 +25,19 @@ if [ "$fs_type" = "cgroup2" ]; then
2525 major=$( echo " $kernel_version " | cut -d ' .' -f 1)
2626 minor=$( echo " $kernel_version " | cut -d ' .' -f 2)
2727 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."
2930 fi
3031 if ! echo " +memory" >> /sys/fs/cgroup/cgroup.subtree_control; then
3132 cgroup_error_and_usage " Error: Cannot add +memory to cgroup.subtree_control; check kernel params. Unable to continue."
3233 fi
3334 if ! echo " +cpuset" >> /sys/fs/cgroup/cgroup.subtree_control; then
3435 cgroup_error_and_usage " Error: Cannot add +cpuset to cgroup.subtree_control; check kernel params. Unable to continue."
3536 fi
36- exit 0
3737fi
3838
39+ # Trying cgroup V1:
40+
3941for i in cpuset memory; do
4042 mkdir -p $CGROUPBASE /$i
4143 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)
504504 int64_t max_usage = 0 ;
505505 ret = cgroup_get_value_int64 (cg_controller, " memory.peak" , &max_usage);
506506 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" );
508508 } else if ( ret!=0 ) {
509509 error (ret," get cgroup value memory.peak" );
510510 }
You can’t perform that action at this time.
0 commit comments