Subject: Re: Building an alternate backing store.
To: gabriel rosenkoetter <gr@eclipsed.net>
From: Nathan J. Williams <nathanw@MIT.EDU>
List: tech-kern
Date: 07/13/2000 18:13:21
<gr@eclipsed.net> (gabriel rosenkoetter) writes:

> uvm_pager.c contains just the "generic functions used to assist the
> pager". I don't really want to change anything generically, as I only
> want to muck with the swap pager (doing evil things to, say, the device
> pager would be really bad news).

It is the pager you want to be messing with. You want to dig through
Chuck Cranor's thesis, "Design and Implementation of the UVM Virtual
Memory Sysyem". Chapter 6 is all about the pager interface.

http://www.ccrc.wustl.edu/pub/chuck/psgz/diss.ps.gz


> This led me to uvm_fault.c, and from there to pmap_enter(), since
> that's how uvm_fault(), the main entry point for any page fault, goes
> about getting memory pages back where they belong from wherever
> they've gone. The only calls to anything out of uvm_pager.c made in
> uvm_fault() are to uvm_pageralloc(), and that's only in the section
> that deals with COW on loaned pages; it sets up an object into which
> to copy the written version so that we don't write over the original
> (which isn't ours).

You've overlooked the calls to the pager's pgo_fault and pgo_get
routines. Look around lines 882-1020 or so in uvm_fault.c. Those
function pointers point to the object's pager entry points. 

> As near as I can understand, when it goes to actually map a page back
> in, uvm_fault() calls pmap_enter() with the physical address of the
> page it wants back and the virtual address of where it wants it;
> there's no other way to do it.

.. after it gets the physical address of that page from the underlying
pager.

        - Nathan