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 () {
21
21
# Check whether cgroup v2 is available.
22
22
fs_type=$( awk ' $2 == "/sys/fs/cgroup" {print $3}' /proc/mounts)
23
23
if [ " $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 ] && [ " $minor " -lt 19 ]; }; then
28
+ echo " WARNING: Kernel ($kernel_version ) is too old to record peak RAM usage" >&2
29
+ fi
24
30
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."
26
32
fi
27
33
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."
29
35
fi
30
36
exit 0
31
37
fi
You can’t perform that action at this time.
0 commit comments