Skip to contentSkip to conversation

Required Swap for recent 2.4 kernels?

DISCUSSION Quim K. Holland 2 participants 2 messages Dec 9, 2001

lore
Share & tools
lore
#0 lore raw

It seems that in early days of 2.4.x, the total
usable VM used to be not close to sum of the
physical RAM and swap. Is this still true for
post 2.4.10 kernels?

Back in January 2001, in response to a question about ``recommended swap for 2.4.x'', Rik van Riel answered (quotes '>' are from the messagey by [email protected]):

It has. We now leave dirty pages swapcached,
which means that for certain workloads Linux
2.4 eats up much more swap space than Linux
2.2.

On the other hand, if you almost never used
swap under Linux 2.2, you probably won't be
using it under 2.4 either.

Quoted 3 lines

2) Subtract the amount of RAM you have
(believe it or not, the more RAM you have,
the less swap you need. Imagine that).

For Linux 2.4, it may be better to substract a
bit less, because of the issue above.

If you have a very swap-intensive workload, you may end up with 90% of your memory being "duplicated" in swap, in which case this rule doesn't work.

My understanding is that this answer is not
applicable to post 2.4.10 kernels, but if so then
would the total usable VM be <physical RAM> +
<swap> - <kernel itself> - <kernel overhead that
is not proportional to the VM workload>?

________________________________________________________________
Nokia 5510 looks weird sounds great.
Go to http://uk.promotions.yahoo.com/nokia/ discover and win it! The competition ends 16 th of December 2001.

#1 lore raw
Quoted 5 lines

My understanding is that this answer is not
applicable to post 2.4.10 kernels, but if so then
would the total usable VM be <physical RAM> +
<swap> - <kernel itself> - <kernel overhead that
is not proportional to the VM workload>?

Assuming it hasn't changed with the Andrea VM then the behaviour which we switched was how the machine handles getting close to running out of swap.

The old 2.4 behaviour was that on swapping a page in from disk we always left it in swap as well. This is a win since if the page is not dirtied before we have to swap it out again we avoid a disk write. However it can mean that an entire copy of RAM is sitting in swap. So a box with 1Gb of RAM and 2Gb of swap might use 1Gb of swap and gain nothing in total available virtual memory

The newer behaviour Rik added to the Riel VM was that when we got to about 90% of swap full we began freeing up swap pages also in RAM. That meant that as things got tight we would migrate to a situation where data was either in swap or ram but not both, so you went from 2Gb total usable VM to 3Gb total usable VM on a 1Gb box with 2Gb of swap.

Alan