2005-01-13 16:20:09

by Oleg Nesterov

[permalink] [raw]
Subject: Q: shrink_cache() vs release_pages()

Hello.

shrink_cache:
if (get_page_testone(page)) {
__put_page(page);
SetPageLRU(page);
list_add(&page->lru, &zone->inactive_list);
continue;
}

Is it really necessary to re-add the page to inactive_list?

It seems to me that shrink_cache() can just do:

if (get_page_testone(page)) {
__put_page(page);
--zone->nr_inactive;
continue;
}

When the __page_cache_release (or whatever) takes zone->lru_lock
it must check PG_lru before del_page_from_lru().

The same question applies to refill_inactive_zone().

Thanks,
Oleg.