[comp.sys.sun] Sun 4 & MMU: further inquiry

mark@drd.com (Mark Lawrence) (10/08/90)

We're in the middle of analysis of some troubling behaviour from one of
our heavily used sparcstations and in reading this extremely useful and
well written exposition on Sun's implementation and use of the MMU in the
Sun 4 line, some questions have been raised.

For programs dynamically linked (involving shared libraries), are pmegs
allocated for all potential members of the shared library?  Is this the
rationale for savings by linking statically (wherein only the object
referenced is linked in and therefore, pmegs allocated only on an as
needed basis).  I think this is implied, but not stated explicitly.

The point is made that shared text and data between processes still
involves non-shared pmegs (i.e., pmegs mapping the same pages aren't
shared).  Is this also true for multiple processes attaching to System V
shared memory segments?  Does each process have its own set of pmegs
mapping the shared memory? (This could be disastrous in systems with large
shared memory segments).

It is implied that more than 16 megabytes of physical memory is typically
going to be used as a disk cache (rather than for text, data and
what-not).  What's the basis for this claim?  That the virtual memory
pages mapped by the pmegs is only 50% utilized on the average?  This one
escaped me.

Thanks in advance for any illumination.

mark@DRD.Com uunet!apctrc!drd!mark$B!J%^!<%/!!!&%m!<%l%s%9!K(B

Mark_Weiser.PARC@xerox.com (11/01/90)

"For programs dynamically linked (involving shared libraries), are pmegs
allocated for all potential members of the shared library?"

No, that is not the point.  Rather, the shared libraries cause the actual
addresses being mapped to be spread out all over, and every 256k of
address space with a page in use in it uses up a pmeg entry.  The actual
physcial pages in use are no larger, but the spread of addresses is.

"The point is made that shared text and data between processes still
involves non-shared pmegs (i.e., pmegs mapping the same pages aren't
shared).  Is this also true for multiple processes attaching to System V
shared memory segments?"

Yes.  PMEG entries are not shared across processes at all, even if they
are doing mmaps or shmops to specify sharing.  Furthermore, Sun's PMEG fix
patch does not repair this, but only makes swapping pmeg entries in and
out faster.

"It is implied that more than 16 megabytes of physical memory is typically
going to be used as a disk cache."

Implied by who where?  Anyway, it might be true.  The PMEG problem is not
a physical memory problem, but rather an addressing problem.  You can be
running completely in RAM and have 95% of your time going to the kernel
thrashing pmeg entries.  I've seen it.

-mark