From: Marcus Leech (mleech@bnr.ca)
Date: 06/01/92


From: mleech@bnr.ca (Marcus Leech)
Subject: Re: Linux swapping
Date: Mon, 1 Jun 1992 13:45:01 GMT

In article <1992May29.171214.8939@klaava.Helsinki.FI>, torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds) writes:
|> Demand-loading has a couple of very good points: (1) it simplifies the
|> exec system call, (2) it means page-sharing between processes that have
|> executed the same file is easy to implement, and (3) it cuts down on the
|> amount of memory required. When linux runs out of real memory, it
|> starts to look for pages it can swap out: but if it notices that the
|> page is clean, it just forgets about it, and demand-loads it when it's
|> needed again. That means the swap-file isn't needed as much, especially
|> when running big binaries like gcc, where the code-pages can be
|> demand-loaded as you wish.
A problem with this scheme is that your page-fault latency is limited by the
  efficiency of the filesystem. Other OS/UNIX implementations that support
  "demand load" executables copy demand-loaded pages into the paging
  area after they've been faulted in. Once that's happened, subsequent
  faults for the same page come out of the paging area. Paging-area
  I/O is typically faster than filesystem I/O by quite a bit, which is
  why it's done this way.

-- 
Marcus Leech, 4Y11             Bell-Northern Research  |opinions expressed
mleech@bnr.ca                  P.O. Box 3511, Stn. C   |are my own, and not
ml@ve3mdl.ampr.org             Ottawa, ON, CAN K1Y 4H7 |necessarily BNRs