<!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/tsan-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/f8da754cbbbe2ca30d732758d083d733082151bd">f8da754c</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:30-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/2f6d3907a841e170e51707fc75d3a08b19a78b95">2f6d3907</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/cca9c1cb3456f86625fc0d4df52386b0ec001252">cca9c1cb</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/7dc087c507358921f14076b64d3a2795c4afbe91">7dc087c5</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/11791ecf801549de9b3f3d0687a8ef495aa32242">11791ecf</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/f9936c89229160e79504488a08c14dc59a9eca4c">f9936c89</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/2526bae76c39ef46e9b7f51e550a9660b73816fd">2526bae7</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/fc42a34ca352389f06f9b8573dddbd06a8ad1def">fc42a34c</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/f569c30157527d0ecf4335025441b7315244acd2">f569c301</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/b3262547f04a6a38d286e1b68505703b304e529f">b3262547</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/9b546265bae4daacfdad72467211513ca2275eb2">9b546265</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/8dbaa27cc635d31a78a74780d18fe2400e602ac3">8dbaa27c</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/bd5ec3092f56be3ed980e64f8d6395362c7bb4aa">bd5ec309</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/41e854b75dcbb7ff3ac4eb645a590dc9abf68c1e">41e854b7</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/f54d381ba5d6fc5d9ab1abe5e952f1d5e595a126">f54d381b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/5a29a9acceaa450e228cf58674beb5292f1a75ef">5a29a9ac</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/3b56d934aa3a88f26efe4840681bb5faf18aefb7">3b56d934</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/5eec2560640cb38b2eee1e8e7f076e21dcd0cccf">5eec2560</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/014482a81dde8d1c7bb9462c5c5314c550954a06">014482a8</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/5ad949c8d58f02d9bb0ff6506fd817bc540a41c9">5ad949c8</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/3a61a6248b799a1d01da03339e248277d20d9362">3a61a624</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/6b0c4a4def25cb4e15152eb5ee309b03a0358ba4">6b0c4a4d</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/d035205e72aff206ed5a3d5be52a194aacdc610e">d035205e</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/47b3aa0f714d4ea125889f9bcde697697686039e">47b3aa0f</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/8dff50c65c2929168c1d38fea663df30cb071edf">8dff50c6</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/c28b7cc2c193a266702c96fdc93ad9977a441dde">c28b7cc2</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/041c2e859e1ab160ffd1e52b753fda1cf75043e3">041c2e85</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:34-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/c12ef8b24d4094f3f33dfbdfa44525e730cc9627">c12ef8b2</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/82ddaf61d82272fd6c19164be49a27ea77cc669b">82ddaf61</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/46866cfd216bad95a52088199a85ed4042b5420f">46866cfd</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/3b82799309f0d216c164969f3a5dd39dbe804fe5">3b827993</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/43913d14570d71bf17167d21d4b23bc5d5a18ba2">43913d14</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-11-27T13:28:35-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/a3cff1328ff2fb0be5cb0f95206a32436dc45202">a3cff132</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-11-27T13:28:35-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/49b08d4bf8c7b3998902f33490be937eb1401d67">49b08d4b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/e00197428be55b3de8a1d437933ea58af0baef82">e0019742</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/09882529f27722e9c9e37ccf000236ff3780e08b">09882529</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/7f9413ae53434217c968e0895d658eb655d4093f">7f9413ae</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/e75605540f6729a422c691b85f076a8d81e40209">e7560554</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/55500716ae8b5b086019503e1c239def2ce2f9f7">55500716</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/4197478e74bbde869545b6976520ce220cd263fe">4197478e</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/e60293890e0012b437086029fac5584b3aec2f64">e6029389</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/0772dac604d9b36857f4b32ffac8a5185a515ed8">0772dac6</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/d623201eb933e081dc395e2902bf7e5f98d2e29b">d623201e</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/62dc2674a9346b7e8c4964f2d3efa3035247359f">62dc2674</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/948cfaf2fa1f8c382822e3c1715d8932e6133bb8">948cfaf2</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/c84d15467c6858ce51a1417205d50d40bda536f9">c84d1546</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/18f1cd4fa363d3a989e1d61718650089bd7b52d5">18f1cd4f</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/8d181e61be1810677418b2fa32e00539163e2ae1">8d181e61</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/f6e6ae9acce29730caf6df50ac10060fe83fe6de">f6e6ae9a</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/7672301d6113e9943bd424ad0bd1dbc578a939cc">7672301d</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:28:35-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/81731699ed3d243e3528e5c42487df4a335f5d64">81731699</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-11-27T13:28:35-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/2222390f838d3e07c77042a22e3e756c6f77401e">2222390f</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:30:25-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/840cd2d3b8ace82b9db1ca639029a51e1fc00b8a">840cd2d3</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:02-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/aade2cdd5c0938a4d969e562f82e5f6993af2aa6">aade2cdd</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/574181f45dae3233e6e99f03a7f510f7d81faf95">574181f4</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/c5fcb0f2b39edae451cb42b29f13e651d20d7141">c5fcb0f2</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/4e57a865b08bf28582ef9bdcee5c171a28b9366f">4e57a865</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/5e9a359eded5079667c91dc2490afd245ca91908">5e9a359e</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/f76075546ea3c46b1e83c029a8aa616ec515362a">f7607554</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-11-27T13:31:04-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/a6fdae361ea124c55dfb9135a48bae92bfefceb7">a6fdae36</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/798a81d5ffc2b456199d75980f2c86376090a99f">798a81d5</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/8a4c40c4fe480ea7c6ff036a1d9c50debc06de79">8a4c40c4</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/1f636c1029a0395ea8dd94b908003bb80b26299a">1f636c10</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/8f0d6db9c7e066cceb0e830baffaf6186fb2ddfe">8f0d6db9</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/52704812eb03be390878ca86e852dec771d22d59">52704812</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/e09376e0b4260c4e73a45aa051415727a971849a">e09376e0</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/d7761be1098def9170f003e9868cc3de09dcd2ff">d7761be1</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/dab8b674d0ecd31fc6aecf487293fcce66574edc">dab8b674</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/11fa84bfa3f28c484088d6bc18b67c0ce259ab73">11fa84bf</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/dfb5053774f603671a3eec4720ad3f472e3b987f">dfb50537</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/b95413091951c57c15a0c53272ad2eb20a54245a">b9541309</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/5a46207b95307b67a562144f9999e2f807da6958">5a46207b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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/a3152aa057644dac7b8df4c30c3034d3ab180748">a3152aa0</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-27T13:31:04-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="#1655041cfd1add79e4c335c656405ee3eb3bd0dd">
hadrian/src/Flavour.hs
</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">
includes/rts/TSANUtils.h
</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">
rts/.tsan-suppressions
</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>
<li class="file-stats">
<a href="#b90c7236dd80d0ab7be1156ccd798e69994e38c6">
rts/Stats.h
</a>
</li>
<li class="file-stats">
<a href="#2dcc6eaccbc1470a4453e6040e4a5dcfd0ba0a14">
rts/Task.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>
</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/51d95b564fa7319719c1c810df4faeb983f281bb...a3152aa057644dac7b8df4c30c3034d3ab180748">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>