[MLton] Paging under RedHat 9.0 although largely fitting in core (resend)

Jesper Louis Andersen jlouis@mongers.org
Tue, 9 Mar 2004 18:05:46 +0100


Quoting Alain Deutsch (deutsch@PolySpace.com):

>   4. kswapd is active and eats up 25% of CPU time

Preventive paging? ie. The system expects to run low on resources in
the near future and thus begins paging (I assume kswapd handles paging
as well as swapping, but I am not knowledged in Linux VM model).

Looking at the memory stats tells me that we are running low on resources.
Theres only 10156k free and 5288k in the buffer-cache to take from. This is
very low. And with almost 700.000k swap space used this might be the problem.

Note though that I am not sure. I am far more experienced with the *BSD VMs
than the Linux ones.

> I was wondering:
> 
>   1. if this is due to RedHat 9.0

A test on some other version of redhat or a linux distribution would hint
if the problem is related to this kernel only or not. Redhat has been known
for adding their own patchset on top on a stock linux kernel, so what you
see here might very well be a Redhat only thing.

>   2. if so, whether the use of madvise() calls from the gc could ease
>      up the situation (perhaps by using WONTNEED on old from spaces ?)

I'll let others bite at this one. In my NetBSD it is

 #define MADV_DONTNEED   4       /* don't need these pages */

but it does not seem to conform to any standards so I do not know if there
exist a standardisation on madvise(). Setting this flag will hint the pager
that it can remove these of memory pressure becomes too big. Maybe it will
help.

>   3. if there may be RedHat 9.0 kernel and/or swapd setting to avoid
>      this behavior.

If my hypothesis is correct, tuning of the pager could help to remove the
problem. But as it is now, it is only a hypothesis.

-- 
j.