1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-08 04:30:45 -08:00
emacs/mps/manual/wiki/poolamc.html
Richard Kistruck 3f74e5a986 Mps wiki: trace: .scan.loop.terminate thoughts. poolamc clarify.
Copied from Perforce
 Change: 161752
 ServerID: perforce.ravenbrook.com
2007-02-14 18:01:09 +00:00

249 lines
7.9 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>MPS Wiki: AMC Poolclass</title>
<style type = "text/css">
<!--
div.banner {text-align:center}
dt {font-weight:bold}
-->
</style>
</head>
<body>
<div class="banner">
<p>
<a href="/">Ravenbrook</a>
/ <a href="/project/">Projects</a>
/ <a href="/project/mps/">Memory Pool System</a>
/ <a href="/project/mps/master/">Master Product Sources</a>
/ <a href="/project/mps/master/manual/">Manuals</a>
/ <a href="/project/mps/master/manual/wiki/">Wiki</a>
</p>
<p><i><a href="/project/mps/">Memory Pool System Project</a></i></p>
<hr />
<h1>MPS Wiki: AMC Poolclass</h1>
<address>
<a href="mailto:rhsk@ravenbrook.com">Richard Kistruck</a>,
<a href="http://www.ravenbrook.com/">Ravenbrook Limited</a>,
2007-01-15
</address>
</div>
<p> This wiki article contains incomplete and informal notes about the MPS, the precursor to more formal documentation. Not confidential. Readership: MPS users and developers. </p>
<h2>Introduction</h2>
<p><em class="note">[Incomplete... Should eventually go into new Guide section of design/poolamc. RHSK 2007-01-18]</em></p>
<p>Lots of complex MPS concepts come together in poolamc. This document first states the problem, and then carves it up to arrive a the solution.</p>
<h2>The Problem</h2>
<p>Input:</p>
<ul>
<li>Segment mode:
<ul>
<li>Mobile</li>
<li>Board</li>
<li>Stuck (segment nailed, but no nailboard)</li>
</ul>
</li>
<li>Tracing at:
<ul>
<li>Normal</li>
<li>Emergency</li>
</ul>
</li>
<li>Does this fix affect the segment we are scanning?
<ul>
<li>Yes: see wiki:trace/.scan.change</li>
<li>No</li>
</ul>
</li>
<li>Object type:
<ul>
<li>Client</li>
<li>Fwd</li>
<li>Pad</li>
</ul>
</li>
<li>Segment rankset:
<ul>
<li>Exact</li>
<li>Zero (no refs)</li>
<li>Weak</li>
</ul>
</li>
<li>Object colour:
<ul>
<li>Black for any of N traces</li>
<li>Grey for any of N traces</li>
<li>White for any of N traces</li>
</ul>
</li>
<li>Buffers:
<ul>
<li>Buffer types:
<ul>
<li>Mutator Grey</li>
<li>Mutator Black</li>
<li>Forwarding Grey</li>
</ul>
</li>
<li>Segment regions:
<ul>
<li>Unbuffered</li>
<li>Trail</li>
<li>Raw (from Init to Alloc)</li>
<li>Spare (beyond Alloc)</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Output</p>
<ul>
<li>How to do these Operations:
<ul>
<li>Whiten</li>
<li>Scan</li>
<li>Fix</li>
<li>Reclaim</li>
<li>Walk</li>
<li>Write-barrier hit on Black</li>
</ul>
</li>
<li>When to do these segment mode transitions:
<ul>
<li>Mobile -> Board</li>
<li>Mobile -> Stuck</li>
<li>Board -> Mobile</li>
<li>Stuck -> Mobile</li>
</ul>
</li>
</ul>
<h2>Colour</h2>
<p>The things that contribute to colour are: SegGrey, SegWhite, SegNailed, segment mode, and (if Board) "nails" (marks in the board).</p>
<p>Buffer colour is an extra complication.</p>
<h2>Segment-mode transitions</h2>
<p>Mobile mode requires the whole seg to be the same colour. Can the Mobile mode support all the various colour transitions?</p>
<h2>Colour transitions</h2>
<ul>
<li>Atomic whole segment:
<ul>
<li>B&rarr;W (whiten)</li>
<li>B&rarr;G (greyen to make foundation)</li>
</ul>
</li>
<li>Progressive:
<ul>
<li>G&rarr;B (blacken, ie. scan): Attempts whole seg. </li>
</ul>
</li>
<li>Random:
<ul>
<li>W&rarr;G (greyen by fix)</li>
<li>W&rarr;B (blacken by fix when rank=Ø, ie. leaf only)</li>
</ul>
</li>
<li>Unused:
<ul>
<li>G&rarr;W</li>
</ul>
</li>
</ul>
<p>Board and Stuck modes are used to record
<h3>.amc.scan.loop:</h3>
<p>AMC is expected to mostly avoid this.</p>
<p>Non-boarded segs are always all one colour: AMCScan on these always scans all objects.</p>
<p>Boarded segs:</p>
<ul>
<li>in non-emergency mode: we can't be scanning at Ambig (because only roots can be ambig), so if there's a backwards ref that newly finds an object, it will be preserved and greyed (during the scan) by copy into another segment (or at least -- given that buffers are currently attached at the ends of segments only -- into a definitely <strong>later</strong> part of the same seg).</li>
</ul>
<p>But in emergency mode, all fixing (even of exact refs) is in-place. In emergency mode, a seg with a board will keep its board. So AMCScan on boarded segments (the misnamed amsScanNailed and amcScanNailedOnce) must loop: <code>do { newMarks = 0; ... } while (newMarks)</code>. (Communication between these two happens through the poorly named "moreReturn"). </p>
<p>In emergency mode on a mobile (non-boarded) or already stuck seg, .... [what happens here?]</p>
<p>AMS also has a loop: see <code>do { } while (amsseg->marksChanged)</code> in AMSScan.</p>
<h2><a id="section-B" name="section-B">B. Document History</a></h2>
<pre>
2007-01-15 RHSK Created.
</pre>
<h2><a id="section-C" name="section-C">C. Copyright and License</a></h2>
<p> This document is copyright &copy; 2007 <a href="http://www.ravenbrook.com/">Ravenbrook Limited</a>. All rights reserved. This is an open source license. Contact Ravenbrook for commercial licensing options. </p>
<p> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: </p>
<ol>
<li> Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. </li>
<li> Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. </li>
<li> Redistributions in any form must be accompanied by information on how to obtain complete source code for the this software and any accompanying software that uses this software. The source code must either be included in the distribution or be available for no more than the cost of distribution plus a nominal fee, and must be freely redistributable under reasonable conditions. For an executable file, complete source code means the source code for all modules it contains. It does not include source code for modules or files that typically accompany the major components of the operating system on which the executable file runs. </li>
</ol>
<p> <strong> This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement, are disclaimed. In no event shall the copyright holders and contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage. </strong> </p>
<hr />
<div class="banner">
<p><code>$Id$</code></p>
<p>
<a href="/">Ravenbrook</a>
/ <a href="/project/">Projects</a>
/ <a href="/project/mps/">Memory Pool System</a>
/ <a href="/project/mps/master/">Master Product Sources</a>
/ <a href="/project/mps/master/manual/">Manuals</a>
/ <a href="/project/mps/master/manual/wiki/">Wiki</a>
</p>
</div>
</body>
</html>