免費報告已使用的虛假交換量

免費報告已使用的虛假交換量

free 報告的已用交換空間非常高。

[root@rhel6 ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          9892       9537        354          0         71        884
-/+ buffers/cache:       8581       1310 
Swap:          767 1759218592     116869 

喜歡,真的高的。

[root@bb14 blackboard]# free -g|grep Swap
Swap:            0 1717986906        114 

或者是嗎?

[root@bb14 blackboard]# free -h |grep Swap
Swap:         767M       767M       114G 

更奇怪的是,即使我禁用交換,數字仍然很高。

[root@rhel6 ~]# swapoff -a
[root@rhel6 ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          9892       9760        131          0         45        638
-/+ buffers/cache:       9076        815 
Swap:            0 1759218592     116814 

檢查 meminfo 時,事情並沒有變得更加混亂,它顯示 swapfree 高於 swaptotal。

[root@rhel6 ~]# cat /proc/meminfo|grep Swap
SwapCached:            0 kB
SwapTotal:        786428 kB
SwapFree:       120404008 kB

顯然有些事情很奇怪,我的第一個反應是重新啟動,但這是一台生產機器,這意味著維護窗口等,我想知道是否有任何方法可以找出問題所在,甚至可能在不停機的情況下修復它。

答案1

解決方案是升級到內核-2.6.32-573.7.1.el6或更高。

只需簡單的yum update重啟即可。

以下是錯誤報告的引用內核-2.6.32-573.1.1.el6.x86_64這導致可用掉期大於掉期總量:

get_swap_page() 鎖定的先前變更刪除了 swap_lock 自旋鎖的使用。這可能會導致 nr_swap_pages 損壞並導致 /proc/meminfo 檔案中的 SwapFree 資訊無效,其中 SwapFree 的大小可能超過 SwapTotal 的大小。此更新對 nr_swap_pages 使用原子變量,並且 /proc/meminfo 中的 SwapFree 的大小現在是正確的。 (BZ#1259362)

答案2

看起來這是 RHEL6.7 中的已知問題,其私有 bugzilla 中正在追蹤 kernel-2.6.32-573.1.1.el6.x86_64。

https://access.redhat.com/solutions/1571043

相關內容