Re: [patch 07/21] SEQ replacement for anonymous pages

barrioskmc@gmail
2008-03-03T11:02:59Z

Hi, Rik.

static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
struct scan_control *sc, int priority, int file)
{
- unsigned long pgmoved;
+ unsigned long pgmoved = 0;
int pgdeactivate = 0;
unsigned long pgscanned;
LIST_HEAD(l_hold); /* The pages which were snipped off */
@@ -1058,12 +1058,25 @@ static void shrink_active_list(unsigned
cond_resched();
page = lru_to_page(&l_hold);
list_del(&page->lru);
- if (page_referenced(page, 0, sc->mem_cgroup))
- lru = LRU_ACTIVE_ANON;
+ if (page_referenced(page, 0, sc->mem_cgroup)) {
+ if (file)
+ /* Referenced file pages stay active. */
+ lru = LRU_ACTIVE_ANON;
+ else
+ /* Anonymous pages always get deactivated. */
+ pgmoved++;
+ }
list_add(&page->lru, &list[lru]);
}

Why do you insert referenced page to LRU_ACTIVE_ANON ?
I have seen picture in your design document
(http://linux-mm.org/PageReplacementDesign)
If I understand your point well, page referenced is inserted to
LRU_ACTIVE_FILE.

What am I missing in your point?

Thanks, barrios