Skip to contentSkip to conversation

Q: shrink_cache() vs release_pages()

DISCUSSION Oleg Nesterov 1 participant 1 message Jan 13, 2005

lore
Share & tools
lore
#0 lore raw

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.