Re: swapping and the value of /proc/sys/vm/swappiness

Marcelo Tosatti
2004-09-08T18:09:47Z

On Tue, Sep 07, 2004 at 08:56:47PM +1000, Con Kolivas wrote:
> Nick Piggin wrote:
> >
> >
> >Marcelo Tosatti wrote:
> >
> >>
> >>Hi kernel fellows,
> >>
> >>I volunteer. I'll try something tomorrow to compare swappiness of
> >>older kernels like 2.6.5 and 2.6.6, which were fine on SGI's Altix
> >>tests, up to current newer kernels (on small memory boxes of course).
> >>
> >
> >Hi Marcelo,
> >
> >Just a suggestion - I'd look at the thrashing control patch first.
> >I bet that's the cause.
>
> Good point!
>
> I recall one of my users found his workload which often hit swap lightly
> was swapping much heavier and his performance dropped dramatically until
> I stopped including the swap thrash control patch. I informed Rik about
> it some time back so I'm not sure if he addressed it in the meantime.

Swap thrashing code doesnt affect anything, at least on my simple contained test.
With the same test, the amount of swapped out memory with 2.6.6/2.6.7 is 100-150MB,
while 2.6.8/2.6.9-mm* swaps out around 250MB.

I tried 2.6.7's "vmscan.c" on 2.6.8 without noticeable difference, I wonder why.

What I've noticed before with the swap token code is total crap interactivity
when memory hog is running. Which doesnt happen without it.

Con, I've seen your hard swappiness patch, why do you remove the current
swap_tendency calculation? Can you give us some insight into it?

The thing is, if the user thinks the machine is swapping out too heavily
he can always decrease vm_swappinness. Whatever change that might happen
on VM swapout policy can be tuned with vm_swappinness.

It works - its not very smooth, changing from "53" to "50" causes the
amount of swapped data to be 4 times smaller (due to
if (swap_tendency >= 100) I believe). Apart from that its fine,
and behaves as expected.

Maybe the current value of "60" is too high for most desktop users,
if so it can be decreased a little bit.

But whats the point of your patch?