Re: Memory Problem in 2.4.9 ?

From: Mike Galbraith (mikeg@wen-online.de)
Date: Wed Aug 22 2001 - 12:22:35 EST


On Wed, 22 Aug 2001, Stephan von Krawczynski wrote:

> On Wed, 22 Aug 2001 07:33:38 +0200 (CEST)
> Mike Galbraith <mikeg@wen-online.de> wrote:
>
> >> HAHAHA.. I was right, hurried whack with my little hammer _did_ bust
> > it all to pieces :)
> >
> > This is also (very!) hurried and _lightly_ tested, but still cures my
> > problem.. what do you think?
> >
> > -Mike
> >
> >
> > --- linux-2.4.9/mm/vmscan.c.org Sun Aug 19 08:55:24 2001
> > +++ linux-2.4.9/mm/vmscan.c Wed Aug 22 05:03:50 2001
> > @@ -506,11 +506,17 @@
> > }
> [...]
> > + if (++page->age > PAGE_AGE_START) {
>
> I am not very experienced with the aging algorithm, but can this statement be false at all? I mean if I get that right page->age starts with PAGE_AGE_START, doesn't it?

When page is added to to the pagecache, it begins life with age=0 and
is placed on the inactive_dirty list with use_once. With the original
aging, it started with PAGE_AGE_START and was placed on the active
list. The intent of used once (correct me Daniel if I fsck up.. haven't
been able to track vm changes very thoroughly lately [as you can see:])
is to place a new page in the line of fire of page reclamation and only
pull it into the active aging scheme if it is referenced again prior to
consumption. This is intended to preserve other cached pages in the event
of streaming IO. Your cache won't be demolished as quickly, the pages
which are only used one time will self destruct instead. Cool idea.

Unfortunately, with loads like file rewrite, so many (all?) pages meet
the qualification, and are activated and aged up immediately that they
swamp the system. Background aging can't keep up at all (even if you
accelerate it wildly btw), so you end up swapping needlessly.

This quick hack is intended to do something like use_once in that a page
which has been deactivated does not go back to the active queue merely
because of a single access (etc). Instead, you get a couple of chances
to stay on your death march. Often used pages will drop out of line,
seldom used pages won't.

It might be a really rotten way to cure my problem.. I'm not sure yet.

Christ on a crutch.. that sure was a longwinded way to say "yes, the
statement can be false". Think I'll go turn on the idiot box, crack
a brew and play a round of couch potato :)

        Later,

        -Mike

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



This archive was generated by hypermail 2b29 : Thu Aug 23 2001 - 21:00:49 EST