public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Hunter <sean@dev.sportingbet.com>
To: linux-kernel@vger.kernel.org
Subject: /proc/meminfo swap counter wraparound in 2.2
Date: Wed, 12 Sep 2001 10:51:51 +0100	[thread overview]
Message-ID: <20010912105151.L6126@dev.sportingbet.com> (raw)

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.

             reply	other threads:[~2001-09-12  9:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-12  9:51 Sean Hunter [this message]
2001-09-12 10:07 ` /proc/meminfo swap counter wraparound in 2.2 Alan Cox
2001-09-12 10:12   ` Sean Hunter
2001-09-12 10:31     ` Sean Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010912105151.L6126@dev.sportingbet.com \
    --to=sean@dev.sportingbet.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox