diff --git a/sysinfo/sysinfo.go b/sysinfo/sysinfo.go index 47b84ce..8f905aa 100644 --- a/sysinfo/sysinfo.go +++ b/sysinfo/sysinfo.go @@ -13,9 +13,10 @@ type SysInfo struct { } type cgroupMemInfo struct { - MemoryLimit bool - SwapLimit bool - OomKillDisable bool + MemoryLimit bool + SwapLimit bool + OomKillDisable bool + MemorySwappiness bool } type cgroupCpuInfo struct { diff --git a/sysinfo/sysinfo_linux.go b/sysinfo/sysinfo_linux.go index 75700d9..e9d6b3d 100644 --- a/sysinfo/sysinfo_linux.go +++ b/sysinfo/sysinfo_linux.go @@ -50,6 +50,10 @@ func checkCgroupMem(quiet bool) *cgroupMemInfo { if !quiet && !info.OomKillDisable { logrus.Warnf("Your kernel does not support oom control.") } + info.MemorySwappiness = cgroupEnabled(mountPoint, "memory.swappiness") + if !quiet && !info.MemorySwappiness { + logrus.Warnf("Your kernel does not support memory swappiness.") + } return info }