<!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 ghc-8.10
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/3e418e8546498a8a769f9758c2c98599f95b3931">3e418e85</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:52-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">SMP.h: Add C11-style atomic operations
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/e11cdee80081ff9cbcc7b98f840dec837cd8cace">e11cdee8</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Infrastructure for testing with ThreadSanitizer
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/0420a9147db1b9c8a7a52b8075bb43efd507ce57">0420a914</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/CNF: Initialize all bdescrs in group

It seems wise and cheap to ensure that the whole bdescr of all blocks of
a compact group is valid, even if most cases only look at the flags
field.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/3fc4f18c1ada42f1a7281745c01c0fec7c145117">3fc4f18c</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Capability: Intialize interrupt field

Previously this was left uninitialized.

Also clarify some comments.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/0db05bae50716e8739d3760a7d06e8d460db1bfb">0db05bae</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Task: Make comments proper Notes
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/92beeb48c479a149d3cd9f1f11f059e1a066ed08">92beeb48</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/SpinLock: Move to proper atomics

This is fairly straightforward; we just needed to use relaxed operations
for the PROF_SPIN counters and a release store instead of a write
barrier.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/ca5adbeb8daf000cb3fbdc810e688f4d0e98c4aa">ca5adbeb</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/OSThreads: Fix data race

Previously we would race on the cached processor count. Avoiding this is
straightforward; just use relaxed operations.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/b76a4cb3a96462628fd6e0b4a32d3aa9398f2eda">b76a4cb3</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/ClosureMaros: Use relaxed atomics
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/42603f7b8cfad90b8c7576450e1ec1433f277122">42603f7b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Fix thread leak in hs_try_putmvar00[13]
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/31cc96ac02499cd1d80a3dcdbb9b0078bd72d2bb">31cc96ac</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Introduce SET_HDR_RELEASE

Also ensure that we also store the info table pointer last to ensure
that the synchronization covers all stores.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/f5474698ede132a4f2ae3027651e1d4be406de75">f5474698</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Factor out logic to identify a good capability for running a task

Not only does this make the control flow a bit clearer but it also
allows us to add a TSAN suppression on this logic, which requires
(harmless) data races.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/e56161d704ad05aecd9c86bddd994ccb3d42da2e">e56161d7</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Annotate benign race in waitForCapability
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/67a1809243c2f52321709348f40e6608346a2702">67a18092</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Clarify locking behavior of releaseCapability_
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/eed7218ef05c46dd29e1cacfe7a80a180963b602">eed7218e</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Add assertions for task ownership of capabilities
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/b4ea534106251a3f95dac71dc73678be59ced8bf">b4ea5341</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Use relaxed atomics on n_returning_tasks

This mitigates the warning of a benign race on n_returning_tasks in
shouldYieldCapability.

See #17261.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/2220752fd15bb5594c35578382f1067d808ac5a3">2220752f</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Mitigate races in capability interruption logic
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/444e64766744544a6b5085d7cdc828cc9363b550">444e6476</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Capability: Use relaxed operations for last_free_capability
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/3c626d75e447f12299d709073968a629499007f3">3c626d75</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Use relaxed operations for cap->running_task (TODO)

This shouldn't be necessary since only the owning thread of the capability
should be touching this.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/efa866e6cedae0674db8cddccd1ddcb2fef559f9">efa866e6</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Schedule: Use relaxed operations for sched_state
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/a12ce9adb7bbcafda31806e2124539b517da1638">a12ce9ad</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Accept data race in work-stealing implementation

This race is okay since the task is owned by the capability pushing it.
By Note [Ownership of Task] this means that the capability is free to
write to `task->cap` without taking `task->lock`.

Fixes #17276.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/eaf108c8e655f13ffa81b4b10b2a4bb2a28aff71">eaf108c8</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Eliminate data races on pending_sync
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/2398fea7c98025e7dec0eb2696161ab6a0297ba3">2398fea7</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Schedule: Eliminate data races on recent_activity

We cannot safely use relaxed atomics here.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/7f2bacf5442734fed6537882c61b411d114fcda9">7f2bacf5</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Avoid data races in message handling
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/cd94f7bf519981b02f936762d8768fbad40c9488">cd94f7bf</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Messages: Drop incredibly fishy write barrier

executeMessage previously had a write barrier at the beginning of its
loop apparently in an attempt to synchronize with another thread's
writes to the Message. I would guess that the author had intended to use
a load barrier here given that there are no globally-visible writes done
in executeMessage.

I've removed the redundant barrier since the necessary load barrier is
now provided by the ACQUIRE_LOAD.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/2f5e1853bb0cccc4a5b2834468c3b5a97962c837">2f5e1853</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/ThreadPaused: Avoid data races
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/9600e424a5556b76d799f18454ab6acdc4f79f83">9600e424</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Schedule: Eliminate data races in run queue management
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/7e84329baba23cefa035a674d887cdda75d7f548">7e84329b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Eliminate shutdown data race on task counters
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/061611c9461df01fb2145b1420f33be43f5ce512">061611c9</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Threads: Avoid data races (TODO)

Replace barriers with appropriate ordering. Drop redundant barrier in
tryWakeupThread (the RELEASE barrier will be provided by sendMessage's
mutex release).

We use relaxed operations on why_blocked and the stack although it's not
clear to me why this is necessary.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/99c5e53a7a7953a3c3f5798f2a5c8cae57d40ea2">99c5e53a</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Messages: Annotate benign race
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/886440550dfec246ea688ef6bba93bea73502c0d">88644055</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/RaiseAsync: Synchronize what_next read
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/20a89e98a220d85353d74487d6abe90a527e76d1">20a89e98</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Task: Move debugTrace to avoid data race

Specifically, we need to hold all_tasks_mutex to read taskCount.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/aebe5c4de5a41fe888b75f39fdd6f19a8c3ccb92">aebe5c4d</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Disable flawed assertion
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/914196db5d1e0709f3707fcbdfdfe7ac7bd74e3a">914196db</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Document schedulePushWork race
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/68e93f4dc8c55737df57d84e814e849beb2e366c">68e93f4d</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Capabiliity: Properly fix data race on n_returning_tasks

There is a real data race but can be made safe by using proper atomic
(but relaxed) accesses.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/0ad7e4fe2105214889bdbbca5a1f74158729355d">0ad7e4fe</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Make write of to_cap->inbox atomic

This is necessary since emptyInbox may read from to_cap->inbox without
taking cap->lock.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/f4fa413d9e0355d2f66d8aa8130c23206a5d225f">f4fa413d</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">gitlab-ci: Add nightly-x86_64-linux-deb9-tsan job
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/aa2dc3a6a4276928be713d4f76cb693cd5ecf8c4">aa2dc3a6</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Mark setnumcapabilities001 as broken with TSAN

Due to #18808.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/d29d1d5935995d2417822b8dec99856552a5ac2b">d29d1d59</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-12-01T12:48:53-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Skip divbyzero and derefnull under TSAN

ThreadSanitizer changes the output of these tests.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/db69bfe9bb215a7bc5b4a355d7dc4b5b62d5245f">db69bfe9</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Skip high memory usage tests with TSAN

ThreadSanitizer significantly increases the memory footprint of tests,
so much so that it can send machines into OOM.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/7dbf414023d022f35fd69e65a4dd025c3d55b6ca">7dbf4140</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Mark hie002 as high_memory_usage

This test has a peak residency of 1GByte; this is large enough to
classify as "high" in my book.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/80019b4d7bd4596e2bbe43d244b1165538358a8c">80019b4d</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Mark T9872[abc] as high_memory_usage

These all have a maximum residency of over 2 GB.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/cbc7e06d449be0731c013502d173b46b307ed2ba">cbc7e06d</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">gitlab-ci: Disable documentation in TSAN build

Haddock chews through enough memory to cause the CI builders to OOM and
there's frankly no reason to build documentation in this job anyways.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/fcd68815acb4bbe26ca77db65e647202caa61aee">fcd68815</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">TSANUtils: Ensure that C11 atomics are supported
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/f966c105eefe51fd1348f02a68815702dd597fce">f966c105</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Mark T3807 as broken with TSAN

Due to #18883.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/38a0ede02cfc01b2bafcfa80f16b6af3db0e2135">38a0ede0</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">testsuite: Mark T13702 as broken with TSAN due to #18884
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/571a13e8e2026ffac25445ccc0928abffd029d4b">571a13e8</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/BlockAlloc: Use relaxed operations
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/2ecc569370d521eccd5fb1cfcfc69707e853a962">2ecc5693</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Rework handling of mutlist scavenging statistics
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/78a5bdff108a369588a50ab69d4f927344164f40">78a5bdff</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Avoid data races in StablePtr implementation

This fixes two potentially problematic data races in the StablePtr
implementation:

 * We would fail to RELEASE the stable pointer table when enlarging it,
   causing other cores to potentially see uninitialized memory.

 * We would fail to ACQUIRE when dereferencing a stable pointer.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/a191f6d5e59716e9027b77c37689bcfc035a5a0a">a191f6d5</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Storage: Use atomics
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/7d4d0751d6276f6e810d3cf4828da876b197c095">7d4d0751</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Updates: Use proper atomic operations
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/afdc79e87164807877fef62f7fcf4ba4ae679ba2">afdc79e8</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Weak: Eliminate data races

By taking all_tasks_mutex in stat_exit. Also better-document the fact
that the task statistics are protected by all_tasks_mutex.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/2e3a9399fb2f0eea907bd3e6baf6c74fcc33b6cd">2e3a9399</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/GC: Use atomics
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/c6855d59cebda52424be0257e24bfe20c6eead56">c6855d59</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Use RELEASE ordering in unlockClosure
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/84cf7ed6cde69b8e677c465628647ac902bbc23f">84cf7ed6</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Storage: Accept races on heap size counters
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/f9480f502a09e8d727ae90b0614a67fd2d4ee2dd">f9480f50</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Join to concurrent mark thread during shutdown

Previously we would take all capabilities but fail to join on the thread
itself, potentially resulting in a leaked thread.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/0ea9a980ce452f34259880e060986b5b5a68f0eb">0ea9a980</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Fix race in GC CPU time accounting

Ensure that the GC leader synchronizes with workers before calling
stat_endGC.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/e97ed9201681099b12da4071e95688cc00494ace">e97ed920</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/SpinLock: Separate out slow path

Not only is this in general a good idea, but it turns out that GCC
unrolls the retry loop, resulting is massive code bloat in critical
parts of the RTS (e.g. `evacuate`).
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/e0bf67381f85d842f11185604e2cfd9f6cc24880">e0bf6738</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Use relaxed ordering on spinlock counters
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/48054cf25b3880325f1d4c9c2859350741b53daa">48054cf2</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Annotate hopefully "benign" races in freeGroup
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/dddd97ec54ee2e3080be8eed0c87fcae9b64020f">dddd97ec</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Strengthen ordering in releaseGCThreads
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/bfe39b7fb0ab7aca2b6ff713ed8893f33379ae8f">bfe39b7f</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/WSDeque: Rewrite with proper atomics

After a few attempts at shoring up the previous implementation, I ended
up turning to the literature and now use the proven implementation,

> N.M. Lê, A. Pop, A.Cohen, and F.Z. Nardelli. "Correct and Efficient
> Work-Stealing for Weak Memory Models". PPoPP'13, February 2013,
> ACM 978-1-4503-1922/13/02.

Note only is this approach formally proven correct under C11 semantics
but it is also proved to be a bit faster in practice.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/f9ed0fd23dca0515c4281e7a0d8c8ae1ee4af46f">f9ed0fd2</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Use relaxed atomics for whitehole spin stats
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/211af4a11c325dc93821d31a0acae3d909d2a8f1">211af4a1</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Avoid lock order inversion during fork

Fixes #17275.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/7131d341d6c1e8ea933388ecf7fc99d46f4d8714">7131d341</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Use proper relaxe operations in getCurrentThreadCPUTime

Here we are doing lazy initialization; it's okay if we do the check more
than once, hence relaxed operation is fine.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/20178cde3212c7b09b3a888d6255fe5d4d59b798">20178cde</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/STM: Use atomics

This fixes a potentially harmful race where we failed to synchronize
before looking at a TVar's current_value.

Also did a bit of refactoring to avoid abstract over management of
max_commits.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/8894b40283f94565f4a2669cc1f39a5877a025fd">8894b402</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/stm: Strengthen orderings to SEQ_CST instead of volatile

Previously the `current_value`, `first_watch_queue_entry`, and
`num_updates` fields of `StgTVar` were marked as `volatile` in an
attempt to provide strong ordering. Of course, this isn't sufficient.

We now use proper atomic operations. In most of these cases I strengthen
the ordering all the way to SEQ_CST although it's possible that some
could be weakened with some thought.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/81a9029b4ab1d5177dc52a744a5ef9dc48652f9c">81a9029b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Mitigate data races in event manager startup/shutdown
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/9801d049af31cd4682fbb485338dcddcdc7a14e7">9801d049</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Suppress data race due to close

This suppresses the other side of a race during shutdown.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/9b5bd302400b07555ecbab8025fa7646faf71998">9b5bd302</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Accept benign races in Proftimer
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/25b9c7f9756ce3a16a95f5f15fd0969ce5bbaf4f">25b9c7f9</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Pause timer while changing capability count

This avoids #17289.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/a433c9087fbe1cc56c3e8ff3ed4be93ce910257f">a433c908</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Fix #17289
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/2161aed846f50088b226b03f61eb6d223306bcc9">2161aed8</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">suppress #17289 (ticker) race
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/c93f11feeb918c3c62c0af1f7e757943d52f7f8e">c93f11fe</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Fix timer initialization

Previously `initScheduler` would attempt to pause the ticker and in so
doing acquire the ticker mutex. However, initTicker, which is
responsible for initializing said mutex, hadn't been called
yet.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/1ada18d287927d78d9dbdba062e2c882177f2d4f">1ada18d2</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Fix races in Pthread timer backend shudown

We can generally be pretty relaxed in the barriers here since the timer
thread is a loop.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/d315985abb3e2188637ccb1f12e06634fd522a22">d315985a</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:54-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Stats: Hide a few unused unnecessarily global functions
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/953de20fc9980fa0768732cab42692733f8c0bfa">953de20f</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:55-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Stats: Protect with mutex

While on face value this seems a bit heavy, I think it's far better than
enforcing ordering on every access.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/9ad6e1f12e99330adeacc3b6eea52c6f26324a46">9ad6e1f1</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:55-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts: Tear down stats_mutex after exitHeapProfiling

Since the latter wants to call getRTSStats.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/0f28389c783a54a74c472f176c250ddf7a9c4bf4">0f28389c</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-12-01T12:48:55-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">rts/Stats: Reintroduce mut_user_time

Fix the previous backport; this function was dead code in master but is
still needed due to ProfHeap.c in ghc-8.10.
</pre>
</li>
</ul>
<h4>30 changed files:</h4>
<ul>
<li class="file-stats">
<a href="#587d266bb27a4dc3022bbed44dfa19849df3044c">
.gitlab-ci.yml
</a>
</li>
<li class="file-stats">
<a href="#2eeb40f0acd6cb433ebe65e34262040b618908a7">
hadrian/hadrian.cabal
</a>
</li>
<li class="file-stats">
<a href="#1655041cfd1add79e4c335c656405ee3eb3bd0dd">
hadrian/src/Flavour.hs
</a>
</li>
<li class="file-stats">
<a href="#704958036ebddd9058fb1367e440b2ea1abb53e9">
hadrian/src/Settings.hs
</a>
</li>
<li class="file-stats">
<a href="#fbf853844dc48d850085cbef14c0af1e474cb087">
<span class="new-file">
+
hadrian/src/Settings/Flavours/ThreadSanitizer.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#40f83a2cddcbc1f8190b0551eb572ccf4ea88cc9">
includes/Rts.h
</a>
</li>
<li class="file-stats">
<a href="#452d5ee18aa2b91b6486a157ecf550dc84081872">
includes/rts/OSThreads.h
</a>
</li>
<li class="file-stats">
<a href="#397950c6118f4b5a74a10249b6bcc322ab8e2e25">
includes/rts/SpinLock.h
</a>
</li>
<li class="file-stats">
<a href="#0e9120c800f0c7864f3631f8fb8d7035a4778f97">
includes/rts/StablePtr.h
</a>
</li>
<li class="file-stats">
<a href="#32b24c17e385bd15c4751ab0da5f55876fd57f51">
<span class="new-file">
+
includes/rts/TSANUtils.h
</span>
</a>
</li>
<li class="file-stats">
<a href="#aa19e824b3a8c24a7bf37f8352997022b14a5a0c">
includes/rts/storage/ClosureMacros.h
</a>
</li>
<li class="file-stats">
<a href="#0ea78c0eb38d298692960f63f47248f6464a0479">
includes/rts/storage/Closures.h
</a>
</li>
<li class="file-stats">
<a href="#94ca41c5afbb3d932bd6f37ee16458322988fb69">
includes/rts/storage/GC.h
</a>
</li>
<li class="file-stats">
<a href="#fbe566a2918ba0562be9aceeb5d07448bf2f9ed0">
includes/stg/SMP.h
</a>
</li>
<li class="file-stats">
<a href="#e5d5c3eb2ba69f9a4ab3f56a8e9dab426c012963">
libraries/base/GHC/Event/Control.hs
</a>
</li>
<li class="file-stats">
<a href="#46661d25ba83700d4344aaa428308c552e201be8">
<span class="new-file">
+
rts/.tsan-suppressions
</span>
</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="#63bb2dcb45bf7982130b0b95ecf366bf1a617e82">
rts/Messages.c
</a>
</li>
<li class="file-stats">
<a href="#a3b0919403d8f328f07cda7c4a7f9817c369357c">
rts/Proftimer.c
</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="#632a1fac336e62e26d0af2de3f023c11a62c927a">
rts/SMPClosureOps.h
</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="#52526efc348b52718c69d51f8df6e5425ff68d48">
rts/Schedule.h
</a>
</li>
<li class="file-stats">
<a href="#b1247567bf64d38ef0ee9a14575ac22983232204">
rts/Sparks.c
</a>
</li>
<li class="file-stats">
<a href="#6b4f3c89a36017ba0c8ca6c6bd086631c47406df">
<span class="new-file">
+
rts/SpinLock.c
</span>
</a>
</li>
<li class="file-stats">
<a href="#264b041893a19041ac2281341c74847243da87e3">
rts/StablePtr.c
</a>
</li>
<li class="file-stats">
<a href="#6c6e266b51f1c94d2ebf5aa2052f408397451f94">
rts/Stats.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: #666;">

<br>
<a href="https://gitlab.haskell.org/ghc/ghc/-/compare/65ed2fdca2e0d0e8f3535b31f94dcdc1424e5cf2...0f28389c783a54a74c472f176c250ddf7a9c4bf4">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>