From cd7496abb548f98c54d18f1282bc3e646593e1a6 Mon Sep 17 00:00:00 2001 From: cuiwei13 Date: Mon, 21 Nov 2016 10:27:04 +0800 Subject: [PATCH] Checking whether CG_MEM_SWAP is enabled at the current system session Signed-off-by: CUI Wei --- contrib/check-config.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/contrib/check-config.sh b/contrib/check-config.sh index 3a924d9de4..ea8a93409b 100755 --- a/contrib/check-config.sh +++ b/contrib/check-config.sh @@ -217,9 +217,13 @@ echo 'Optional Features:' check_flags CGROUP_PIDS } { + CODE=${EXITCODE} check_flags MEMCG_SWAP MEMCG_SWAP_ENABLED - if is_set MEMCG_SWAP && ! is_set MEMCG_SWAP_ENABLED; then - echo " $(wrap_color '(note that cgroup swap accounting is not enabled in your kernel config, you can enable it by setting boot option "swapaccount=1")' bold black)" + 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 }