Re: patch cow-swapin [was Re: Very bad swap bug -- 2.0, 2.1 at least]

Andrea Arcangeli (andrea@e-mind.com)
Thu, 24 Sep 1998 21:11:56 +0200 (CEST)


On Thu, 24 Sep 1998, Bill Hawes wrote:

>It may be that a simple change to the swap cache policy would help keep pages
>cached for situations like this. Currently pages are removed from the swap

Infact I did it now (the patch is on the fly).

>cache when the last in-memory use is retired, but instead we could test the
>swap_map use count and kept the page cached if there were multiple

In my patch unused swap cache pages are deleted only when the system needs
memory. I am getting very interesting interactive performance with my
patch applyed and the evil program in background (I have 64Mbyte of ram
and 50 of swap). The evil program is this:

#include <stdio.h>

#define BUFSIZE 10000000

volatile int buf[BUFSIZE];

main()
{
volatile int i;
for (i=0; i<BUFSIZE; i++)
buf[i] = i;
for(;;)
{
sleep(60);
if(!fork())
{
printf("now\n");
for (i=0; i<BUFSIZE; i++)
buf[i] = i;
break;
}
else
wait();
}
}

>references. Then it would be likely that a subsequent use would find the
>cached page and not need a swap-in.

In fact it' s running fine ;-).

Andrea[s] Arcangeli

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