免费报告的交换使用非常高.
[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
显然有些东西是不稳定的,我的第一直觉是重新启动,但这是一台生产机器,这意味着维护窗口等,我想知道是否有任何方法可以找出问题所在,甚至可以在没有停机的情况下修复它.
解决方法
解决方案是升级到kernel-2.6.32-573.7.1.el6或更高版本.
只需简单的yum更新和重新启动即可.
以下是kernel-2.6.32-573.1.1.el6.x86_64的错误报告的引用,该报告导致Swap free大于交换总数:
A prevIoUs change in the get_swap_page() locking removed the use of the swap_lock spinlock. This could cause nr_swap_pages corruption and invalid SwapFree information in the /proc/meminfo file,where the size of SwapFree could exceed the size of SwapTotal. This update uses an atomic variable for nr_swap_pages,and the size of SwapFree in /proc/meminfo is now correct. (BZ#1259362)