<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>
<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">
<h3>
Ben Gamari pushed to branch wip/gc/test
at <a href="https://gitlab.haskell.org/ghc/ghc">Glasgow Haskell Compiler / GHC</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/commit/395ab8d5e6a0cc467a7b280142fe8e567cc5a70d">395ab8d5</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2019-06-19T15:23:46Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Implement concurrent collection in the nonmoving collector
This extends the non-moving collector to allow concurrent collection.
The full design of the collector implemented here is described in detail
in a technical note
B. Gamari. "A Concurrent Garbage Collector For the Glasgow Haskell
Compiler" (2018)
This extension involves the introduction of a capability-local
remembered set, known as the /update remembered set/, which tracks
objects which may no longer be visible to the collector due to mutation.
To maintain this remembered set we introduce a write barrier on
mutations which is enabled while a concurrent mark is underway.
The update remembered set representation is similar to that of the
nonmoving mark queue, being a chunked array of `MarkEntry`s. Each
`Capability` maintains a single accumulator chunk, which it flushed
when it (a) is filled, or (b) when the nonmoving collector enters its
post-mark synchronization phase.
While the write barrier touches a significant amount of code it is
conceptually straightforward: the mutator must ensure that the referee
of any pointer it overwrites is added to the update remembered set.
However, there are a few details:
* In the case of objects with a dirty flag (e.g. `MVar`s) we can
exploit the fact that only the *first* mutation requires a write
barrier.
* Weak references, as usual, complicate things. In particular, we must
ensure that the referee of a weak object is marked if dereferenced by
the mutator. For this we (unfortunately) must introduce a read
barrier, as described in Note [Concurrent read barrier on deRefWeak#]
(in `NonMovingMark.c`).
* Stable names are also a bit tricky as described in Note [Sweeping
stable names in the concurrent collector] (`NonMovingSweep.c`).
We take quite some pains to ensure that the high thread count often seen
in parallel Haskell applications doesn't affect pause times. To this end
we allow thread stacks to be marked either by the thread itself (when it
is executed or stack-underflows) or the concurrent mark thread (if the
thread owning the stack is never scheduled). There is a non-trivial
handshake to ensure that this happens without racing which is described
in Note [StgStack dirtiness flags and concurrent marking].
Co-Authored-by: Ömer Sinan Ağacan <omer@well-typed.com>
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/commit/59894c9036959ca72d9f7102799a10f6fffe39f6">59894c90</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2019-06-19T15:23:46Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Nonmoving: Disable memory inventory with concurrent collection
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/commit/69900691cb332c24a1ac7e79366b69926abc32c0">69900691</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2019-06-19T15:26:14Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Add nonmoving_thr way
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/commit/8da04fa35ac77c227e52f029e62df2a130021d88">8da04fa3</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2019-06-19T15:26:14Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Add nonmoving_thr_ghc way
This uses the nonmoving collector when compiling the testcases.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/commit/1e59c6cbe484fa8efe62a6ff6e14632000806cb5">1e59c6cb</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2019-06-19T15:26:14Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Don't run T15892 in nonmoving ways
The nonmoving GC doesn't support `+RTS -G1`, which this test insists on.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/commit/bcff1d8420e3a2c16492cb9abc46656e64b22e99">bcff1d84</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2019-06-19T15:26:14Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Nonmoving collector doesn't support -G1
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/commit/6327adf2b0272a58c43476001f8982311b755e24">6327adf2</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2019-06-19T15:26:14Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Ensure that threaded tests are run in nonmoving_thr
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/commit/d7690aefa785dc9a191d9ca4ad0240da7394232c">d7690aef</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2019-06-19T15:26:14Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: bug1010 requires -c, which isn't supported by nonmoving
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/commit/1d0c58bc0a50bae2d43d23ceb2ce0b26f654b050">1d0c58bc</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2019-06-19T15:26:14Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Skip T15892 in nonmoving_thr_ghc
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/commit/17a5c3592c084f8924c13d4ef541dba0c1955360">17a5c359</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2019-06-19T15:26:14Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">ghc-heap: Skip heap_all test with debugged RTS
The debugged RTS initializes the heap with 0xaa, which breaks the
(admittedly rather fragile) assumption that uninitialized fields are set
to 0x00:
```
Wrong exit code for heap_all(nonmoving)(expected 0 , actual 1 )
Stderr ( heap_all ):
heap_all: user error (assertClosuresEq: Closures do not match
Expected: FunClosure {info = StgInfoTable {entry = Nothing, ptrs = 0, nptrs = 1, tipe = FUN_0_1, srtlen = 0, code = Nothing}, ptrArgs = [], dataArgs = [0]}
Actual: FunClosure {info = StgInfoTable {entry = Nothing, ptrs = 0, nptrs = 1, tipe = FUN_0_1, srtlen = 1032832, code = Nothing}, ptrArgs = [], dataArgs = [12297829382473034410]}
CallStack (from HasCallStack):
assertClosuresEq, called at heap_all.hs:230:9 in main:Main
)
```
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/commit/fba07d85e92922e3d493ee96fdd7f0077659d87e">fba07d85</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2019-06-19T15:26:14Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Skip ghc_heap_all test in nonmoving ways
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/commit/5f6cb8edf982b8055a42e71d0a92a0b0f6e31fb0">5f6cb8ed</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2019-06-19T15:26:14Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Don't run T9630 in nonmoving ways
The nonmoving collector doesn't support -G1
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/commit/d60bdf28b901eb59500ec43e8a8010a86c602053">d60bdf28</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2019-06-19T15:26:15Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Don't run T7160 in nonmoving_thr ways
The nonmoving way finalizes things in a different order.
</pre>
</li>
</ul>
<h4>30 changed files:</h4>
<ul>
<li class="file-stats">
<a href="#db6936871693fa68c3fdcbd692eb7dcffc3a9372">
compiler/cmm/CLabel.hs
</a>
</li>
<li class="file-stats">
<a href="#c10b1b0056f54b8b89286ac4a327928f83cf8ab6">
compiler/codeGen/StgCmmBind.hs
</a>
</li>
<li class="file-stats">
<a href="#731b07c16b2f4bb31dd7defa4ceef54e74473cc7">
compiler/codeGen/StgCmmPrim.hs
</a>
</li>
<li class="file-stats">
<a href="#5f05b3e433aad7b0e6e5aa2aae206d359bb54f4c">
compiler/codeGen/StgCmmUtils.hs
</a>
</li>
<li class="file-stats">
<a href="#6011cad13b19136953f8ee72df01a66623c5c1b0">
includes/Cmm.h
</a>
</li>
<li class="file-stats">
<a href="#40f83a2cddcbc1f8190b0551eb572ccf4ea88cc9">
includes/Rts.h
</a>
</li>
<li class="file-stats">
<a href="#3b4c67d255fe638e594c28d4a73d04aee85a04f0">
<span class="new-file">
+
includes/rts/NonMoving.h
</span>
</a>
</li>
<li class="file-stats">
<a href="#aa19e824b3a8c24a7bf37f8352997022b14a5a0c">
includes/rts/storage/ClosureMacros.h
</a>
</li>
<li class="file-stats">
<a href="#94ca41c5afbb3d932bd6f37ee16458322988fb69">
includes/rts/storage/GC.h
</a>
</li>
<li class="file-stats">
<a href="#2f870b7c76a5e24010e464cc1a1f860c0f9e0dab">
includes/rts/storage/TSO.h
</a>
</li>
<li class="file-stats">
<a href="#89ed911ca15ec0db941eb82e8d7df8453f4ab713">
includes/stg/MiscClosures.h
</a>
</li>
<li class="file-stats">
<a href="#e7e177c17e4bf37dc865a39cde7a0ec9e1a33362">
libraries/ghc-heap/tests/all.T
</a>
</li>
<li class="file-stats">
<a href="#c6ca7d2b8bb94ab0a0ee349206e12a4a65925cec">
rts/Apply.cmm
</a>
</li>
<li class="file-stats">
<a href="#33249795fee267712d5c3a7ecfa9f2edea260401">
rts/Capability.c
</a>
</li>
<li class="file-stats">
<a href="#62ec5569a8af1e443ae952b393d15b9dd1cea199">
rts/Capability.h
</a>
</li>
<li class="file-stats">
<a href="#deed6a3bec2843fc56bafbd3ae930f535197b3a6">
rts/Exception.cmm
</a>
</li>
<li class="file-stats">
<a href="#63bb2dcb45bf7982130b0b95ecf366bf1a617e82">
rts/Messages.c
</a>
</li>
<li class="file-stats">
<a href="#6db965f97cbab901f493506a385bcf1283009921">
rts/PrimOps.cmm
</a>
</li>
<li class="file-stats">
<a href="#515f190a948b1d6c490c96f75a3f909580e927b0">
rts/RaiseAsync.c
</a>
</li>
<li class="file-stats">
<a href="#9ed11d0519762dae04656481b089dbb5b05acf98">
rts/RtsStartup.c
</a>
</li>
<li class="file-stats">
<a href="#16c842a51a135c8ef2c7c7f94336544868348a3c">
rts/RtsSymbols.c
</a>
</li>
<li class="file-stats">
<a href="#e137645f8a9be9fa32cc764e19cea2b492e33d9c">
rts/STM.c
</a>
</li>
<li class="file-stats">
<a href="#7d6961cb073b9fe3df3a81f0ad5cf36eed293c42">
rts/Schedule.c
</a>
</li>
<li class="file-stats">
<a href="#2f69bf0632a148614b9aceae17e7e627784cf567">
rts/StableName.c
</a>
</li>
<li class="file-stats">
<a href="#4b22b3f666af23f7c8097b32282abfd52fb6c342">
rts/ThreadPaused.c
</a>
</li>
<li class="file-stats">
<a href="#a5d219117032120cc7bde9f13451d9627cff5614">
rts/Threads.c
</a>
</li>
<li class="file-stats">
<a href="#2ffbdc61d9d0e36978f07f62c00c08f33149e335">
rts/Updates.h
</a>
</li>
<li class="file-stats">
<a href="#b4a38dad10ba126e05a0b6adc99aa0c2eb742875">
rts/sm/NonMoving.c
</a>
</li>
<li class="file-stats">
<a href="#371d3c3c9fad484c1163aa733d70507ce33084c9">
rts/sm/NonMoving.h
</a>
</li>
<li class="file-stats">
<a href="#4f5ba3ce18ccc17ad367193f379aa61f4c9180a0">
rts/sm/NonMovingMark.c
</a>
</li>
</ul>
<h5>The diff was not included because it is too large.</h5>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777;">
—
<br>
<a href="https://gitlab.haskell.org/ghc/ghc/compare/da9e3ef2f0eb9943159444953d14d2fd4b6bff5e...d60bdf28b901eb59500ec43e8a8010a86c602053">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.haskell.org.
If you'd like to receive fewer emails, you can
adjust your notification settings.
</p>
</div>
</body>
</html>