Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jan 2000 21:42:50 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Brett Glass <brett@lariat.org>
Cc:        hackers@freebsd.org
Subject:   Re: Possible optimization in VM?
Message-ID:  <200001070542.VAA79015@apollo.backplane.com>
References:   <4.2.2.20000106220706.00b67650@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
    (repeating, Brett sent his original posting to freebsd.com instead
    of freebsd.org!)

:As I read this, a question immediately occurred to me. I can understand why 
:C1 exists; when the child modifies pages, one must create COW copies for it 
:that are distinct from the parent's. But why create C2? Why not allow the 
:parent to use B, as before, and create copies in C1 if the parent modifies 
:pages in B? By not multiplying entities beyond necessity, one could reduce 
:the overhead of a fork+exec -- in which C2 goes away quickly and C1 takes 
:up space until the parent process dies.
:
:Am I missing something here, or would this be an easy optimization to make?
:
:--Brett Glass
:
:P.S. -- I don't currently subscribe to "hackers," so please copy me on any 
:replies. I'll join the list if the discussion gets hot and heavy.

    Hmm.  Well, you could copy the page to C1 in order to avoid creating
    a C2 layer, at least as long as you do not have other entities sharing
    B directly (e.g. C3, C4, ...).  This sort of optimization would reduce 
    the parent object's layering complexity but at the cost of increasing 
    the child object's layering complexity.

    The problem that we hit is that we really mess up the 'All Shadowed'
    optimization if we start throwing pages into C1 that C1 didn't touch
    itself.  The C1 layer may wind up contaiing a significant number of
    *additional* dirty pages, pages the child never actually touched
    itself and thus pages that an additional forked child of the child
    probably will not ever touch.  This will prevent the 'All Shadowed'
    optimization from occuring, resulting in a potentially deep VM Object
    layering on one side of the graph.

    The key to the 'All Shadowed' optimization is that it depends on locality
    of reference in nearby layers.  The locality of reference is messed up
    if we start copying pages to layers whos governing processes didn't 
    actually touch.

    Another reason why we wouldn't want to do this is that it complicates
    the VM Object layer accounting.  It would be hard to tell whether C1 could
    be collapsed into B without a C2.  Or, if not hard, definitely more complex
    then the C1,C2 -> B case where the collapsability of layers is visually
    obvious.

					-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?200001070542.VAA79015>