VM callbacks and VM design

From: Neil Schemenauer (nascheme@enme.ucalgary.ca)
Date: Wed Jun 07 2000 - 19:07:37 EST


On Thu, Jun 08, 2000 at 01:16:06AM +0200, Juan J. Quintela wrote:
> After I have been chatting with Ben LaHaise, he has suggested, instead
> of using especial code for NFS pages and block pages to change/add a
> new function to address_operations to do the swapout in
> try_to_swap_pages and the writepage in shrink_mmap.

I believe that is exactly what David's anon patch does. The
function is called try_to_free_page. Personally, I think it is a
great idea.

IMHO, the long term goal should be to futher unify the Linux VM
system. Here is my (possibly misinformed) take on the issue:

The resource being managed the the VM system is physical pages.
When this resource becomes scarce, pressure must be placed on the
users of these pages. Pages which well not be needed in the near
future should be the ones to be freed.

In order to decide which pages are good candidates for freeing
the temporal locality heuristic should be used (ie. pages needed
recently will also be needed in the near future). Note that this
is different that "most often used". I think Rik's latest aging
patch is slightly wrong in this regard.

The users who have lots of physical pages in memory will feel the
most pressure. If they are actively using these pages the
pressure will be reduced. LRU (or some variant to eliminate
pathological worst case behavior) should be the unified heuristic
to determine which pages should be freed. This will provide good
performance and balance to the system.

Creating a bunch of distinct caches and trying to balance them is
the wrong solution.

Unfortunately with the current design we do not have a relation
from physical pages to users of those pages (at least not for all
types of pages). David's anon patch fixes this for anonymous
pages. With this change the memory management code becomes much
simpler. A similar approach should be taken with the SHM code.

Unfortunately these kinds of changes are too radical to make
during the so called code freeze so we will have to wait until
2.5. I look forward to getting my hands dirty and providing some
help in this effort.

Thanks for the patch Juan.

    Neil

-- 
"Everyone can be taught to sculpt: Michelangelo would have had to
be taught how not to. So it is with the great programmers" -- Alan Perlis

- 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 : Thu Jun 15 2000 - 21:00:15 EST