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