public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* /proc/meminfo swap counter wraparound in 2.2
@ 2001-09-12  9:51 Sean Hunter
  2001-09-12 10:07 ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Sean Hunter @ 2001-09-12  9:51 UTC (permalink / raw)
  To: linux-kernel

Hi there

Having put 8Gb of swap on one of our production database servers[1], I found
that "top", "free" et al report the amount of available swap space incorrectly.

This is because they all parse /proc/meminfo, and its counters seem to wrap
when they encounter very high numbers.  The relevant bit is the totalswap
member of "struct sysinfo"

sean@lisa:~$ cat /proc/swaps
Filename                        Type            Size    Used    Priority
/dev/rd/c0d2p1                  partition       530104  41436   10
/usr/SWAPFILE1                  file            1048568 56      2
/usr/local/SWAPFILE1            file            1048568 52      2
/usr/SWAPFILE2                  file            1572856 0       3
/usr/local/SWAPFILE2            file            1572856 0       3
/var/SWAPFILE2                  file            1572856 0       3
/home/SWAPFILE2                 file            1572856 0       -6

sean@lisa:~$ cat /proc/meminfo 
        total:    used:    free:  shared: buffers:  cached:
Mem:  4125683712 2820616192 1305067520        0 82919424 232722432
Swap: 542777344 42541056 500236288
MemTotal:   4028988 kB
MemFree:    1274480 kB
MemShared:        0 kB
Buffers:      80976 kB
Cached:      227268 kB
BigTotal:   3111908 kB
BigFree:    1266988 kB
SwapTotal:   530056 kB
SwapFree:    488512 kB

sean@lisa:~$ uname -a
Linux lisa.sportingbet.com 2.2.19-6.2.7enterprise #1 SMP Thu Jun 14 07:34:12 EDT 2001 i686 unknown

As you can see, we are running redhat's "enterprise" 2.2.19 kernel.

I would be amazed if this bug were not also in the main 2.2.x tree.  Is a fix
likely or even possible in 2.2 ?

Sean

[1]One of several changes to avoid random oracle 600 errors under heavy load.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-09-12 10:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-12  9:51 /proc/meminfo swap counter wraparound in 2.2 Sean Hunter
2001-09-12 10:07 ` Alan Cox
2001-09-12 10:12   ` Sean Hunter
2001-09-12 10:31     ` Sean Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox