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

Andrea Arcangeli (andrea@e-mind.com)
Fri, 25 Sep 1998 00:22:13 +0200 (CEST)


On Thu, 24 Sep 1998, Rik van Riel wrote:

>While I must admit that I haven't read the code, could
>it be that the swap cache 'forgets' about a page when
>no process has it mapped?

The cause of the swapin is that the swap cache page is removed from the
swap cache and it' s assigned to the process when such process try to
write to it even if there are other process that are sharing the same swap
entry.

>What we want to do now, is find the best possible
>solution or workaround to this problem. Andrea's
>version is a great workaround; I haven't found a
>real solution yet.

My first fix is perfect for 2.0 I think. I just developed the second (I
think right) fix too but you have not just seen it because it' s on the
fly on the internet right now (the list has a high latency from here). I'
ll send it to you privately in the meantime since I just posted it to the
list in an email with subject NULL (I forgot to write it, I hope that it
will be no rejected my some mail filter btw ;-).

>For 2.3, we could extend this to true multi-level
>aging, whereby pages that are not accessed will
>be removed from a processes working set and mapped
>in again from the swap cache when we need to.

My new patch seems pretty efficient right now too. My new
shrink_swap_cache() remove every _only_ caching swap cache page in round
robin only when the system need memory. It' s very simple and seems to
scale very well.

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/