Linux and GC

Scott L. Burson
Tue, 12 May 1998 14:03:32 -0700 (PDT)

   From: (Kragen)
   Date: Tue, 12 May 1998 10:50:33 -0400 (EDT)

   On Mon, 11 May 1998, Scott L. Burson wrote:
   > The technique Kragen suggests may have been studied, although I don't think I
   > had heard of it, 

   I read about it in a paper of Henry Baker's -- although there, it was
   suggested that instead of calling fork(), you simply stop execution of
   the mutator, copy its entire address space to somewhere else, and then
   wake the mutator back up.

Do you recall which paper?

   Well, on most Unix machines, it will involve at least allocating enough
   swap space to hold the entire address space if necessary, and possibly
   actually copying the entire address space.  On Linux, it will only
   involve allocating a new page table and process structure for the child
   and enough swap space to hold whatever pages get mutated while the gc
   is trying to scan them.

Linux is not the first Unix to have this feature by any means.  Berkeley Unix
(the first virtual-memory Unix) had it more-or-less from the beginning (circa
1980), although one had to make a different system call (`vfork' instead of
`fork').  The only difference with Linux is that the old `fork' functionality
is gone; `fork' and `vfork' do the same thing.

It's possible that Kelly Murray is using a collector like this for SilkOS.  He
said he was doing some trick that involved the VM hardware.  But I don't know
exactly what.

Seems to me, in order to make this work well, it would be nice to have
additional kernel support.  For instance, it would be nice to be able to find
out what pages had been copied because the mutator (the user program) had
written to them, and to compare the mutator's version with the collector's --
this would facilitate generational collection.

-- Scott