Skip to contentSkip to conversation

2.4.14/15-pre4 too "swap-happy"?

VM Linus Torvalds 3 participants 3 messages Nov 14, 2001 – Nov 19, 2001 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 4 lines · Sebastian Dröge

The system has 256 MB RAM, nothing RAM-eating in the background I got many buffer-underuns just because of swapping. When I turn swap off everything works fine. I think it's something with the cache.

Can you do some statistics for me:

cat /proc/meminfo
cat /proc/slabinfo
vmstat 1

while the worst swapping is going on..

Quoted 5 lines

Leaving system 2 alone, just play mp3s over nfs:

After two or three days the used swap-space is around 3 MB. I just played MP3s and no X and no other "big" applications were running. This isn't really a problem but it doesn't look good. Just because of cache swap gets full :(

That's normal and usually good. It's supposed to swap stuff out if it really isn't needed, and that improves performance. Cache _is_ more important than swap if the cache is active.

HOWEVER, there's probably something in your system that triggers this too easily. Heavy NFS usage will do that, for example - as mentioned in another thread on linux-kernel, the VM doesn't really understand writebacks and asynchronous reads from filesystems that don't use buffers, and so sometimes the heuristics get confused simply because NFS activity can _look_ like page mapping to the VM.

Your MP3-over-NFS doesn't sound bad, though. 3MB of swap is perfectly
normal: that tends to be just the idle deamons etc which really _should_ go to swapspace.

The cdrecord thing is something else, though. I'd love to see the statistics from that. Although it can, of course, just be another SCSI allocation strangeness.

Linus

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
I couldn't answer ealier because I had some problems with my ISP the heavy swapping problem while burning a cd is solved in pre6aa1 but if you want i can do some statistics tommorow Thanks and bye
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7+UjjvIHrJes3kVIRApxEAKCwoOhYcptcm/1Q2teIY2YkVwNZGwCeNsDR pSi5RbK5o5qeYUWzHHYgAj0=
=1Nvc
-----END PGP SIGNATURE-----

#3 lore raw
In reply to a message not in the archive
Quoted 3 lines · Linus Torvalds

That's normal and usually good. It's supposed to swap stuff out if it really isn't needed, and that improves performance. Cache _is_ more important than swap if the cache is active.

We have to remember that swap can be much slower to read back in than rereading data from files, though. I guess this is because files tend to be more often read sequentially. A freshly-booted box loads up things it hasn't seen before much faster than a heavily-swapped-out box swaps the things it needs back in...window managers and X desktop backgrounds, for example, are awfully slow. I would prefer if it never swapped them out.

This is an annoying situation, though, because I would like some of my unused daemons to be swapped out. mlocking random stuff would be worse, though.

Quoted 6 lines

HOWEVER, there's probably something in your system that triggers this too easily. Heavy NFS usage will do that, for example - as mentioned in another thread on linux-kernel, the VM doesn't really understand writebacks and asynchronous reads from filesystems that don't use buffers, and so sometimes the heuristics get confused simply because NFS activity can _look_ like page mapping to the VM.

I've been copying about 40 GB of stuff back and forth over NFS over switched 100Mbit Ethernet lately, so I can say I'm definitely seeing this. :) It also seems to happen when I "pull" over NFS rather than "push" (eg: I ssh to a remote machine and "cp" with the source being an NFS mount of the local machine)...the 2.4.15pre1 local machine tends to swap out while this happens as well.

Simon-

[ Stormix Technologies Inc. ][ NetNation Communications Inc. ]
[ [email protected] ][ [email protected] ]
[ Opinions expressed are not necessarily those of my employers. ]