Re: Swapping thoughts

Rik van Riel (
Wed, 20 May 1998 22:12:47 +0200 (MET DST)

On Wed, 20 May 1998, Ville Voutilainen wrote:

> I remember the early days when a friend of mine praised the advantage
> of a dynamic buffer cache, saying that 'all so called free memory
> acts as cache and whenever an application needs more memory, the
> cache is shrinked.' I just would like to have that behavior back.

No you don't... Executables are mmap()ed and reside inside
the page cache. You don't want to kick out the executable
code when you can swap out some unused X buffers or old
images (in the Gimp undo stack)...

> Granted, shrinking the buffer cache might also cause more disk
> activity, but I don't believe it is reasonable to put so much weight
> on buffering versus swapping sleeping processes out, since it feels
> ridiculous to swap 20 MB if there are 45 MB of buffers.

Well, you can alway try to tune things in /proc/sys/vm/*.
But whatever you do, you won't keep Linux from swapping out
the least used pages. You probably don't even want to...

Most of the current problems are due to memory fragmentation.
No, I don't mean the kind of fragmentation we discuss usually,
but the fact that swappable and unswappable pages get mixed
up all over memory and kswapd is then unable to free large
chunks of memory...

| Linux: - LinuxHQ MM-patches page | Scouting webmaster |
| - kswapd ask-him & complain-to guy | Vries cubscout leader |
| | <> |

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to