From: Linus Benedict Torvalds (torvalds@klaava.Helsinki.FI)
Date: 01/25/92


From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)
Subject: Re: linux/mm/memory.c
Date: 25 Jan 1992 10:54:53 GMT

In article <TYTSO.92Jan25002639@SOS.mit.edu> tytso@athena.mit.edu (Theodore Y. Ts'o) writes:
>
>Am I correct is suppose that a consequence of this is that every single
>dirty page of the parent has to be swapped in during a fork()? If so, I
>wonder what sort of hit you will take when something like GNU emacs
>fork()'s. (My GNU emacs on my Vax 3100 workstation is currently
>weighing in at 5.4 meg.)

Yes. This is bad, but not /that/ bad: linux only swaps /dirty/ pages: I
doubt the GNU emacs eceutable pages get dirtied, and are thus just
reloaded by the demand-loading mechanism (and nothing happens at the
fork()). But yes, when editing big files (where there are a lot of
dirty pages) will force a swap-in.

Swapping was added as a quick hack: it wasn't really meant to extend
virtual memory to really big values - more just to get gcc working on a
2M machine, and have that small extra memory when your executables don't
quite fit. More like a temporary "panic-memory": it linux swaps on a
more regular basis the algorithms should be changed to something better
as well, they are rudimentary right now..

                Linus