Subject: Re: cpu_switch (was Re: 1.5 Release documentation ...)
To: None <rearnsha@arm.com>
From: Bill Sommerfeld <sommerfeld@orchard.arlington.ma.us>
List: port-arm32
Date: 11/15/2000 10:21:26
> Finally, I've been looking at implementing pmap_copy to duplicate an 
> entire pmap (this is potentially cheaper than taking a large number of 
> faults when a new process starts up).  However, experiments so far haven't 
> shown any performance increase here (though we might win if we were to 
> temporarily enable caching of the pmap tables while doing the copy).  I 
> think the main reason for the non-startling result is that normally fork() 
> is immediately followed by exec(), so we don't get to execute many of the 
> entries we have just copied.  The jury is still out on this one.

There was a verdict in a related case, though: there was a pmap_copy
implementation in the i386 pmap; it turned out to be a net lose and
was disabled.

If you want to avoid predictable faults, it might be plausible to
pre-COW the page that the stack pointer is pointed at, and pre-fault
the page the program counter is pointed at..  i also have a vague
memory of seeing a paper which talked about a "bovophobic"
(COW-avoidance) scheme where the system accumulated a history of which
data pages of a process were typically modified between fork() and
exec(), and precopied them at fork time..

					- Bill