Jelajahi Sumber

Merge pull request #28634 from ghostplant/check_cfg_memsw

Checking whether CG_MEM_SWAP is enabled at the moment.
Sebastiaan van Stijn 8 tahun lalu
induk
melakukan
e2de212339
1 mengubah file dengan 6 tambahan dan 2 penghapusan
  1. 6 2
      contrib/check-config.sh

+ 6 - 2
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
 }
 {