Re: memory handling in pre5/pre6

From: Andrea Arcangeli (andrea@suse.de)
Date: Fri Apr 21 2000 - 20:35:35 EST


On Fri, 21 Apr 2000, Rik van Riel wrote:

>Having pages make _two_ passes through the second chance queue
>in shrink_mmap() gives them a better chance to age. Not having
>the referenced bit set for them will give them the "advantage"
>of whatever random position in the queue they're in the moment
>they are unmapped.

I think the fact new inserted cache have the reference bit set is hurting
the hot cache that is actually getting less prio than cache pollution. I'd
like to give more prio to hot cache than to unknown new pages.

>Remember that the queue isn't LRU but more like second chance
>fifo...

The LRU is a LRU and nothing else. The only reason we have a reference bit
in place is to avoid us having to roll the LRU at each cache hit and so to
only dirtify the page->flags cacheline instead of the lru chain.

When umapped pages will be out of the LRU while reinserting them we'll
simply put them at the top of the LRU and so they will look as referenced
automatically by their position, if you're worried about that just add a
referenced bit while ummapping the pages from swapout. The right approch
for 2.2.x in getting the referenced bit set was to avoid shrink_mmap to
clear it for mapped pages (it was simpler), in 2.3.x design the right
approch is instead to add the referenced bit from swap_out. I don't think
you want to set the referenced bit to new cache only in order to show
recently unmapped pages as referenced.

Andrea

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



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:20 EST