Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jun 1999 14:17:13 -0700 (PDT)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Jason Thorpe <thorpej@nas.nasa.gov>
Cc:        Zhihui Zhang <zzhang@cs.binghamton.edu>, "Daniel J. O'Connor" <darius@dons.net.au>, freebsd-hackers@FreeBSD.ORG, Ladavac Marino <mladavac@metropolitan.at>
Subject:   Re: Implementation of mmap() in FreeBSD 
Message-ID:  <199906282117.OAA24801@apollo.backplane.com>
References:   <199906282107.OAA22292@lestat.nas.nasa.gov>

next in thread | previous in thread | raw e-mail | index | archive | help
:Well, if you make a VM object map-entry-specific (not just "process-specific";
:a single process may have multiple mappings of a file!), then the pages
:*can't* be shared, because pages are owned by the objects.  The only reason
:you can share pages is because multiple map entries may reference the same
:object (the offset into the object being map-entry-specific).
:
:Put another way, it's not possible for this sentence to be true, at all:
:
:	What you propose will not work because even if the VM object is
:	process-specific, the pages underlying the VM object are not.

    There's missing information.  Remember that VM objects are recursive.
    That is, they stack in layers.  So, in fact, you are sharing the same
    physical page for both a PRIVATE and SHARED mmap.  A copy only occurs
    if you attempt to modify a page in a PRIVATE mmap.  The underlying VM
    object is, ultimately, the file itself.  That's what I meant.  You
    are absolute correct about the high-level mapping occuring in the
    map-entry.  For a shared map it is ultimately the same VM object.

:This, of course, would mean that VM objects themselves serve no purpose, so
:you could collapse it into "pages are owned by VM map entries", and do away
:with objects completely.
:
:However, that would be stupid.
:
:Anyhow, it's possible to have the semantics Zhihui suggested, but you have to
:give up an awful lot to get them. :-)
:
:        -- Jason R. Thorpe <thorpej@nas.nasa.gov>

    It really isn't possible without creating massive inefficiencies.  It
    would be possible in a MULTICS system, but not in a UNIX system and not
    with most modern processors ( which do not have byte resolved 
    variable-length page maps ).  Not efficiently, anyway.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906282117.OAA24801>