Re: [RFC] Optimization for use-once pages

Marcelo Tosatti (marcelo@conectiva.com.br)
Tue, 24 Jul 2001 23:31:32 -0300 (BRT)


On Tue, 24 Jul 2001, Daniel Phillips wrote:

> --- ../2.4.5.clean/mm/vmscan.c Sat May 26 02:00:18 2001
> +++ ./mm/vmscan.c Mon Jul 23 17:25:27 2001
> @@ -359,10 +359,10 @@
> }
>
> /* Page is or was in use? Move it to the active list. */
> - if (PageReferenced(page) || page->age > 0 ||
> - (!page->buffers && page_count(page) > 1)) {
> + if (PageReferenced(page) || (!page->buffers && page_count(page) > 1)) {
> del_page_from_inactive_clean_list(page);
> add_page_to_active_list(page);
> + page->age = PAGE_AGE_START;
> continue;
> }
>
> @@ -462,11 +462,11 @@
> }
>
> /* Page is or was in use? Move it to the active list. */
> - if (PageReferenced(page) || page->age > 0 ||
> - (!page->buffers && page_count(page) > 1) ||
> + if (PageReferenced(page) || (!page->buffers && page_count(page) > 1) ||
> page_ramdisk(page)) {
> del_page_from_inactive_dirty_list(page);
> add_page_to_active_list(page);
> + page->age = PAGE_AGE_START;
> continue;
> }

That change will cause problems: we indicate that a page is young due to a
young mapped pte by increasing its age (at swap_out()).

With the current way of doing things, if you don't move higher aged pages
from the inactive lists to the active list you'll have severe problems
because of that (inactive list full of unfreeable pages due to mapped
pte's).

I suggest you to change

if (!page->buffers && page_count(page) > 1)
to
if ((page_count(page) - !!page->buffers) > 1)

at page_launder/reclaim_page to fix that problem.

This way we end up moving all pages with additional references ignoring
the buffers to the active list.

We have to unmap all references to a page before being able to make it
reclaimable clean cache anyway, so there is no real point keeping those
pages at the inactive list.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/