Subject: ddb & shared libs: first results
To: None <tech-kern@NetBSD.ORG>
From: None <jiho@postal.c-zone.net>
List: tech-kern
Date: 03/22/1998 02:03:01
On 19-Mar-98 Chuck Cranor wrote:

>> And although from your test, code sharing appears to work "as expected" with
>> UVM, we don't really know about Mach yet.
>
> ... but it is easy enough to find out.  someone just needs to repeat
> the test under the oldvm.   i do not have time to do it myself.

I've done this now, and it's clear that ALL code pages ARE being shared.

My assertion that library code was not being shared can now be dismissed as a
statistical aritfact of my test.  The 64K of new pages from starting subsequent
shared instances just happened to be EXACTLY what I would expect in a system
that was very efficient except for library code not being shared.  (In this
case, ld.so has 44K code plus 4K data, which leaves 16K, which sounds
reasonable for the two C library functions plus the process stack and data
pages.  There shouldn't be anything else from the C library, because nothing
would get written...unless inefficiently by ld.so.)

This ddb is a VERY nifty widget.  Had I known about ddb before, I could have
found this out a long time ago, and not clogged up the mailing list with so
much nonsense.  Y'all ought to "advertise" ddb a little better, and provide an
explanation how to invoke it.  I had to visit the FreeBSD web site to find out
how to drop into it.  (Some might argue the output could be cleaned up and
organized a little better, but that's nitpicking.)

I see ddb is from Mach...so Mach was good for something, after all!

Now then...

We remove ld.so's 28K of dead bss from the 64K, and get 36K.  Take another 8K
for the process stack and data, and another 8K for ld.so's data and native bss.
That leaves 20K due to additional overhead from ld.so and the two C library
functions.  Hmmm...that's still not very efficient.

Anyway, this outcome is in a way depressing.  Had there been some mysterious
glitch preventing library code from sharing, that would have been an
identifiable bug to track down and fix.  Now, I'm back scratching my head at
the overall page-spewing behavior of the system, the disproportionality of which
-- in the context of what is being run -- had me looking for explanations to
begin with.  But at least with ddb, I can look into it and find out.  (Or die
trying...)


--Jim Howard  <jiho@mail.c-zone.net>


----------------------------------
E-Mail: jiho@mail.c-zone.net
Date: 22-Mar-98
Time: 00:56:49

This message was sent by XFMail
----------------------------------

----------------------------------
E-Mail: jiho@mail.c-zone.net
Date: 22-Mar-98
Time: 02:03:01

This message was sent by XFMail
----------------------------------