|
@@ -230,13 +230,21 @@ echo 'Optional Features:'
|
|
check_flags CGROUP_PIDS
|
|
check_flags CGROUP_PIDS
|
|
}
|
|
}
|
|
{
|
|
{
|
|
- CODE=${EXITCODE}
|
|
|
|
- check_flags MEMCG_SWAP MEMCG_SWAP_ENABLED
|
|
|
|
- if [ -e /sys/fs/cgroup/memory/memory.memsw.limit_in_bytes ]; then
|
|
|
|
|
|
+ check_flags MEMCG_SWAP
|
|
|
|
+ # Kernel v5.8+ removes MEMCG_SWAP_ENABLED.
|
|
|
|
+ if [ "$kernelMajor" -lt 5 ] || [ "$kernelMajor" -eq 5 -a "$kernelMinor" -le 8 ]; then
|
|
|
|
+ CODE=${EXITCODE}
|
|
|
|
+ check_flags MEMCG_SWAP_ENABLED
|
|
|
|
+ # FIXME this check is cgroupv1-specific
|
|
|
|
+ if [ -e /sys/fs/cgroup/memory/memory.memsw.limit_in_bytes ]; then
|
|
|
|
+ echo " $(wrap_color '(cgroup swap accounting is currently enabled)' bold black)"
|
|
|
|
+ EXITCODE=${CODE}
|
|
|
|
+ elif is_set MEMCG_SWAP && ! is_set MEMCG_SWAP_ENABLED; then
|
|
|
|
+ echo " $(wrap_color '(cgroup swap accounting is currently not enabled, you can enable it by setting boot option "swapaccount=1")' bold black)"
|
|
|
|
+ fi
|
|
|
|
+ else
|
|
|
|
+ # Kernel v5.8+ enables swap accounting by default.
|
|
echo " $(wrap_color '(cgroup swap accounting is currently enabled)' bold black)"
|
|
echo " $(wrap_color '(cgroup swap accounting is currently enabled)' bold black)"
|
|
- EXITCODE=${CODE}
|
|
|
|
- elif is_set MEMCG_SWAP && ! is_set MEMCG_SWAP_ENABLED; then
|
|
|
|
- echo " $(wrap_color '(cgroup swap accounting is currently not enabled, you can enable it by setting boot option "swapaccount=1")' bold black)"
|
|
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
{
|
|
{
|