Re: 2.1.127 BUGS was Re: Linux-2.1.127

Linus Torvalds (torvalds@transmeta.com)
Sun, 8 Nov 1998 10:54:50 -0800 (PST)


On 8 Nov 1998, Andi Kleen wrote:
>
> I still see two mm/scheduling bugs with 2.1.127:
>
> - kswapd is far too aggressive at killing the page cache. Assuming I run
> a normal SMP X11 setup with 128MB and most of the memory used in the page
> cache (about 60%). Now I start a kernel compile with -j4. The result is that
> nearly all of the page cache is freed after a few seconds (it runs with >50%
> free memory then), then when it continues compiling the page cache slowly
> builds up again, then after about 30s is completely blow away again etc.

Ok, this is due to having _only_ a time limit for kswapd - I've known all
along that that was wrong, but it works for me with tons of memory, and I
wanted to have people be able to actually compare. So the thing I'd like
you to compare against and try is simply:

mm/vmscan.c, around like 540:

/* max one hundreth of a second */
end_time = jiffies + (HZ-1)/100;
do {
if (!do_try_to_free_page(0))
break;
+ if (nr_free_pages > 2*freepages.high)
+ break;
} while (time_before_eq(jiffies,end_time));

The reason you see the behaviour you do is that otherwise it will free up
as much memory as it can in one hundreth of a second - which is fine if it
has to do IO in order to free it up, but is bad if it can do it by just
freeing cached pages..

Linus

-
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/