[coyotos-dev] For your amusement
Jonathan S. Shapiro
shap at eros-os.com
Mon Oct 1 09:38:46 EDT 2007
On Mon, 2007-10-01 at 04:45 +0200, Jeroen Visser wrote:
> Below are three backtraces taken while the console reads "Enabling
> interrupts". These traces were taken between 2 to 3 seconds apart.
Okay. What is happening is more or less what I expected. I have just put
one improvement in to the tree, but the other needs to wait another hour
or so.
The first problem was the call to memset() at kern_malloc.c:150. This
was zeroing the pages one at a time, which was forcing the emulator to
build mappings one page at a time and then consolidate them later. That
is an expensive thing to do. Since that zeroing step is redundant, I
have removed it.
The second problem is the use of calloc() instead of malloc() in
cache_init(). That one looks like it is also redundant, because it
appears to me that we are clearing the objects whenever we remove them
from the free list. I don't want to make that change until JWA gets in
to the office and I can double check with him. If it is redundant, then
clearing on free list removal is the right thing, because that clearing
occurs lazily.
So basically, we were zeroing memory three times just to make sure. :-)
Another performance issue here is that we should be building the heap
using large page mappings to lower TLB overheads. The only reason we are
not doing that now is that it requires re-thinking of the interface to
the machine-dependent mapping mechanism, and I didn't want to do that
until we had a second architecture to validate against.
Anyway, I want to go back and review the object lifecycle diagram with
JWA before updating cache_init() any further.
shap
--
Jonathan S. Shapiro
Managing Director
The EROS Group, LLC
www.coyotos.org, www.eros-os.org
More information about the coyotos-dev
mailing list