From: Peter MacDonald (pmacdona@sol.UVic.CA)
Date: 11/16/91


Subject: demand paging: proposal
Date: Sat, 16 Nov 1991 16:28:57 PST
From: pmacdona@sol.UVic.CA (Peter MacDonald)

I finally bit the bullet. Yup, I blew away my dos partition and
put Linux on it. Now I would like to start a project. I consider
virtual consoles to be high priority, but until init/login etc is
done, there is probably no use starting that.

Thus I am proposing to look at demand paging from the file system.
If Linus agrees to consider adding it to linux when it is done,
and nobody successfully shoots this proposal down, I will start
tuit suite.

If someone else wants to help (or do all of it) let me know.
I have broken it down into phases to clarify understanding,
not necessarily to imply they might be released in this order (if ever).
If you think this is a house of cards, let me know ASAP.

Proposed Design:

   Phase 1:
     - Upon loading an executable, create a map that is stored in the
       process that locates all blocks on disk. Do not look at fs again.
     - Load only the first 4K page and execute.
     - Upon a code page fault load the required 4 blocks into ram.
     - Make no attempt to lock file image (count on seg violation?)

   Phase 2:
     - Attempt to share executable images in ram (shared-text).

   Phase 3:
     - Attempt to implement the stickey bit, to pin an executable
       in memory once loaded.
     - Find a way to flush it (all) from memory when done.
     
   Phase 3:
     - Attempt to manage working sets in memory if data requirements
       exceed available ram (down to ~15%).

   Phase 4:
     - Paging (writing) data to a partition or fixed size file.
     - Locking paged image file.

Issues:

     - Allocating/deallocating memory for the program maps.
     - Enable/disable paging when booting from shoelace?
     - Do not use working set with pinned pages?
     - File locks held in ram only?