home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / linux / 17205 < prev    next >
Encoding:
Internet Message Format  |  1992-11-19  |  2.1 KB

  1. Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!torvalds
  2. From: torvalds@klaava.Helsinki.FI (Linus Torvalds)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: VM wizards - verify this please
  5. Message-ID: <1992Nov19.181645.7977@klaava.Helsinki.FI>
  6. Date: 19 Nov 92 18:16:45 GMT
  7. References: <5623@krafla.rhi.hi.is>
  8. Organization: University of Helsinki
  9. Lines: 40
  10.  
  11. In article <5623@krafla.rhi.hi.is> sigurasg@rhi.hi.is (Sigurdur Asgeirsson) writes:
  12. >
  13. >  I downloaded the linux sources and browsed through the mm directory.
  14. >Could someone please tell me if the following is TRUE (*chuckle*), the
  15. >sources are not very readable.
  16. >
  17. >1. Linux does not swap page tables.
  18.  
  19. True.  I didn't think it was worth it (still don't) as swapping the page
  20. tables would mean that you'd have to check a lot more about
  21. race-conditions etc.  The 386 can handle swapped page-tables, but I
  22. doubt they take up that much space that it would be worth it.  Linux
  23. does give each process a 3GB (user) + 1GB (kernel) virtual memory space,
  24. but it's sparsely filled, so the page tables shouldn't usually be very
  25. many (4-5 of pages per process should be normal). 
  26.  
  27. >2. On fork:
  28. >   All page tables are cloned
  29. >   All referenced pages that are in-core are made read only in both page tables
  30. >   and the share count bumped (mem_map[i]++)
  31. >   All referenced pages that are on disk are swap_dup - ed
  32.  
  33. True.  Simple enough.  Again, cloning the page tables isn't that
  34. expensive (mostly), and it means we know that the page tables are always
  35. correct and up-to-date.  Less to check for later, fewer races. 
  36.  
  37. >3. When swapping out:
  38. >   All pagetables are searched for in-core pages and those are swapped
  39. >   out by saving them to disk, decrementing the share count and freeing
  40. >   if share count == 0.
  41. >   This result in multiple copies of shared pages in swap, and, on next
  42. >   reference, in memory, does it not? (and why all the ','?)
  43.  
  44. Yes.  This should be rewritten: I actually did a simple LRU-like
  45. algorithm to test things in 0.97 or so, but that one had some problems
  46. (it needed tweaking - it got so good at searching for unused pages that
  47. interactive processes got swapped out a bit too easily, leading to bad
  48. interactive performance). 
  49.  
  50.         Linus
  51.