File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,17 @@ cgroup_error_and_usage () {
2121# Check whether cgroup v2 is available.
2222fs_type=$( awk ' $2 == "/sys/fs/cgroup" {print $3}' /proc/mounts)
2323if [ " $fs_type " = " cgroup2" ]; then
24+ kernel_version=$( uname -r)
25+ major=$( echo " $kernel_version " | cut -d ' .' -f 1)
26+ minor=$( echo " $kernel_version " | cut -d ' .' -f 2)
27+ if [ " $major " -lt 5 ] || [ " $major " -eq 5 -a " $minor " -lt 19 ] ; then
28+ echo " WARNING: Kernel ($kernel_version ) is too old to record peak RAM usage" >&2
29+ fi
2430 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."
31+ cgroup_error_and_usage " Error: Cannot add +memory to cgroup.subtree_control; check kernel params. Unable to continue."
2632 fi
2733 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."
34+ cgroup_error_and_usage " Error: Cannot add +cpuset to cgroup.subtree_control; check kernel params. Unable to continue."
2935 fi
3036 exit 0
3137fi
You can’t perform that action at this time.
0 commit comments