Re: Want to allocate almost all the memory with no swap

Szabolcs Szakacsits
2001-04-26T16:16:06Z

On Thu, 19 Apr 2001, Rik van Riel wrote:
> On Thu, 19 Apr 2001, Simon Derr wrote:
> > Actually this is what happens under 2.4.2 :
> > when I launch the program, during about one minute kswapd eats 50% cpu,
> > and bdflush takes 2-5% cpu,
> > One minute later approx, they both stop eating the cpu and my process gets
> > almost 100% of the cpu (a PIII 733).
> >
> > The same happens if I kill and launch my program a second time.
> >
> [...] Thanks for telling us. It is good to know that kswapd
> exhibits this strange behaviour. It's admiteddly not a high
> priority thing to fix, but it IS something to keep in mind.

Apparently it's already fixed in ac kernels. Could the reduced number of
wakeup_kswapd() calls the reason?

Szaka

---------- Forwarded message ----------
Date: Thu, 26 Apr 2001 13:49:56 +0200 (MEST)
From: Simon Derr <Simon.Derr@imag.fr>
To: Szabolcs Szakacsits <szaka@f-secure.com>
Subject: Re: Want to allocate almost all the memory with no swap

On Fri, 20 Apr 2001, Szabolcs Szakacsits wrote:

> Could you try Alan Cox's latest prekernel? It has VM related changes and
> your feedbeck could be valuable.
> ftp://ftp.fi.kernel.org/pub/linux/kernel/v2.4/
>
> And maybe 2.4.3? But Alan's would be more interesting because there are
> more significant modifications.
> ftp://ftp.kernel.org/pub/linux/kernel/people/alan/2.4/

Hi,

I'm sorry I had no time this week to do theses tests.
I can report this :

when allocating 240 megs of memory, and using
mlockall(MCL_CURRENT|MCL_FUTURE)
on a 256Megs RAM machine :

Under Linux 2.4.2: kswapd eats half of the CPU. A few times it did so
for a minute approximatively, and then my process got all the CPU. But
some other times kswapd has been taking the CPU much much longer (I did
not see the end, I stopped the test before)

Under Linux 2.4.3-ac9 : It works great !
kswapd does not eat the CPU at all (well, almost : I see it taking 0.1%
CPU during one second, but 'top' is not a very accurate measure tool)

Simon.