ksm info only under linux
Costa Tsaousis (ktsaou) committed
Jan 20, 2018 at 18:51 UTC
6debcdf249fb03fd2dc6d6261daacf1494420ba8
1 file changed
+18
-14
netdata-installer.sh
+18
-14
@@ -869,11 +869,13 @@ else
869
download_netdata_conf "${NETDATA_USER}" "${NETDATA_PREFIX}/etc/netdata/netdata.conf" "http://localhost:${NETDATA_PORT}/netdata.conf"
870
fi
871
872
-# -----------------------------------------------------------------------------
873
-progress "Check KSM (kernel memory deduper)"
872
+if [ "$(uname)" = "Linux" ]
873
+then
874
+ # -------------------------------------------------------------------------
875
+ progress "Check KSM (kernel memory deduper)"
876
875
-ksm_is_available_but_disabled() {
876
- cat <<KSM1
877
+ ksm_is_available_but_disabled() {
878
+ cat <<KSM1
879
880
${TPUT_BOLD}Memory de-duplication instructions${TPUT_RESET}
881
@@ -888,10 +890,10 @@ To enable it run:
890
If you enable it, you will save 40-60% of netdata memory.
891
892
KSM1
891
-}
893
+ }
894
893
-ksm_is_not_available() {
894
- cat <<KSM2
895
+ ksm_is_not_available() {
896
+ cat <<KSM2
897
898
${TPUT_BOLD}Memory de-duplication not present in your kernel${TPUT_RESET}
899
@@ -903,18 +905,20 @@ To enable it, you need a kernel built with CONFIG_KSM=y
905
If you can have it, you will save 40-60% of netdata memory.
906
907
KSM2
906
-}
908
+ }
909
908
-if [ -f "/sys/kernel/mm/ksm/run" ]
909
- then
910
- if [ $(cat "/sys/kernel/mm/ksm/run") != "1" ]
910
+ if [ -f "/sys/kernel/mm/ksm/run" ]
911
then
912
- ksm_is_available_but_disabled
912
+ if [ $(cat "/sys/kernel/mm/ksm/run") != "1" ]
913
+ then
914
+ ksm_is_available_but_disabled
915
+ fi
916
+ else
917
+ ksm_is_not_available
918
fi
914
-else
915
- ksm_is_not_available
919
fi
920
921
+
922
# -----------------------------------------------------------------------------
923
progress "Check version.txt"
924