Re: Very bad swap bug -- 2.0, 2.1 at least

Rik van Riel (H.H.vanRiel@phys.uu.nl)
Wed, 16 Sep 1998 22:26:01 +0200 (CEST)


On Wed, 16 Sep 1998, Simon Kirby wrote:
> On Wed, 16 Sep 1998, Rik van Riel wrote:

> > Strange... There is more free memory than there is stuff to
> > swap in. This does indeed suggest a bug, unless of course
> > you use perl for web forms (4 simultaneous forks which glob
> > the machine will have left some 16 megs.
>
> Some large perl script is probably what cleared the 16MB free. Still, it
> wasn't executing when I was running the vmstat (I was also running a
> "top"...).

OK, if this perl script is clearing memory on a regular
basis, this will cause some swapins.

> > OTOH, if you have the values for freepages (/proc/sys/vm/freepages)
> > set to a rediculously high value, the swapping and paging might be
>
> "For real"? I'm very sure it is actually reading from disk -- I can hear

OK, then we know something is going on.

> [sroot@elmo:/root]# cat /proc/sys/vm/freepages
> 280 420 560
> This is high, I know...should I try it lower?

It's OK for a machine with 144 MB of ram...

> > > As you can see, the amount of stuff swapped out is staying the same, but
> > > it is constantly "swapping in" something.
> >
> > The MM code in 2.0 was mostly introduced in the 1.2 (!)
> > days and is very well tested.
> > Does the error also occur with a different kernel? Or
> > with a kernel compiled with a different compiler?
>
> All kernels compiled with 2.7.2.3. It seems to be happening on 2.0.33 and
> 2.0.55, and even on 2.1.120. I will try to write a C program that will
> reproduce it.

Hmm, if you could do that (somehow I doubt it because the
'bug' seems to depend on the environment), but I would be
_very_ interested if you could indeed trigger this bug...

> > Executable code is mmap()ed from the executable file, and is
> > not swapped in. Faulting pages from executables are shown with
> > the PageIn (pi) stats...
>
> "pi"? This does not appear to be in vmstats...Where is it?

Whoops, use the bi (block in) stats for Linux. DU vmstat
has pin :)

> > You might want to try 2.1.117 (running stably here) if
>
> I believe 2.1.117 was also having the same problem. We're using 2.1 on a

I've done quite some VM bashing with recent kernels (happily
thrashing GIMP using 200 MB with 80 MB real RAM, giving
approx 500 swap IOs/s == 2MB/s to/from swap!) and it all
seems to work properly. Hell, I can even continue to use
the machine without too bad interactive performance :)

Rik.
+-------------------------------------------------------------------+
| Linux memory management tour guide. H.H.vanRiel@phys.uu.nl |
| Scouting Vries cubscout leader. http://www.phys.uu.nl/~riel/ |
+-------------------------------------------------------------------+

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/