<!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-9.0
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/08d75467e686b34c939e11891a93b4ce23e54ae9">08d75467</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:00-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/9f6d334195bd37d47b3587196fcb2460660100a5">9f6d3341</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:00-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/8b5e7dc7a11b0f32f089e0b671b1e3149207e1c5">8b5e7dc7</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:01-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/67c0f410ebf8afe1d3f7b076c66dd75043db47a6">67c0f410</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:01-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/829a72cd25d0b9403eb2ba3e3f266c6d844fc87e">829a72cd</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:01-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/c19ee6d5e1c2401556530a244842553c7b24bb9a">c19ee6d5</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:01-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/5ed8139ab37e83642f6f70b06812577430feb667">5ed8139a</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:01-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/3c35c5883602c89045a8d4f16b170cf9fc4a51de">3c35c588</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:01-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/83e759a7867df35a7896c5196d652926b68f1f69">83e759a7</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:01-05:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">configure: Bump minimum-supported gcc version to 4.7

Since the __atomic_* builtins are not supported until gcc 4.7. Given
that this version was released in 2012 I think this is acceptable.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/7d846a79ff5e08a171fff83355e37e7346b65ed5">7d846a79</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:01-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/37886925295ff04c91c128d698853b361b35c5d3">37886925</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:01-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/5541b8ea0732e487c9590b78b2f6a045af4b0685">5541b8ea</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:01-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/12c8702a2c64e400812b77e1bb35bb03464fbceb">12c8702a</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:01-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/3eb46f2e612f00e587975f8b90279c4f55462e6b">3eb46f2e</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:01-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/e052a8129b84cb10d774f954651b7f84f4c750f0">e052a812</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:01-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/2b1da3d8209712e099d72cee1fec7b2fe7532260">2b1da3d8</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:01-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/053d3c5b1620d6612d72c35d0315cb6433e74ee4">053d3c5b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:02-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/7ebad34c81dfd25a66bea6501aab01427bce6eda">7ebad34c</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:02-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/67716ed34f7a588422644402c38288cfe257747d">67716ed3</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:02-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/5615aac82e98d43054e0c4caca4f3521d6b14ee5">5615aac8</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:02-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/677988d51c67e736c2157950966ca3923b3a10f6">677988d5</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:02-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/7ce384239720dc84447bb1767778fc785d458f9a">7ce38423</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:02-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/05f59c231da572cd93bfc9562061c976f5186b7c">05f59c23</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:02-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/6417288c4942de0b98604c7987ebea5954b3475a">6417288c</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:02-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/dba1771b3a773628e2d88ad4ca6d989b4701c074">dba1771b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:02-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/1727bc57fefe2965b2938c6dbd4d56dbdf8431d8">1727bc57</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:02-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/3e36d9eece985ae6d7e22785b97b56c340621e68">3e36d9ee</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:02-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/7b856fcd78327a497465afaa89012e5afa4c9507">7b856fcd</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:03-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/04a19bfcc0798d2e5a706cd65a45c3774c1d73ed">04a19bfc</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:03-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/1f5dded64845634c59c8985f91b396ce7017be34">1f5dded6</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:03-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/852eb2cc3ffe68adee980d1f87f6e164ff82f8e4">852eb2cc</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:03-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/d9b6eb31d21ba3e1e7785cb48b5fd9db2b85025a">d9b6eb31</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:03-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/1bcc9cd05822587be768eff708ebdb50822ab2af">1bcc9cd0</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:03-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/2e76a63116df473e720ab1d95e3aa159b2d2998f">2e76a631</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:03-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/718a46db6f3547de14546732af02bb586c0615a0">718a46db</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:03-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/588a950bd141c5d04aafe84181247d55ae89d995">588a950b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:03-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/853ef5e1c52fb711dc1b53dc17c953f0e3be76f2">853ef5e1</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:03-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/5bcda8baa55e7f0bd3bd33cbc434dd27796023f9">5bcda8ba</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-11-24T12:03:03-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/e78d90e37bfa89eba17ac5d39ae1ebe740af5d71">e78d90e3</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-11-24T12:03:03-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/a99f05ef6920ad1af9c5e95b9b13d762a1af3c5a">a99f05ef</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:03-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/02d2e42bae29a21f3335f0b6583668416a2fb302">02d2e42b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/fba38edfb0fe63cacc1c8a7774b16d49befa9f66">fba38edf</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/0215ff52da2346248ae71fa142e264fddd67e866">0215ff52</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/e191eb781d04c29da50d3fcb9bc710c5c69bf248">e191eb78</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/a31bcccaec0f373048f5b15fb638b9e316461f5d">a31bccca</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/7aba9e547e33c1f09d14090c8e048dc0d104f19c">7aba9e54</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/23a30a3b8cff2dda916dc2be23149009a6a0e59b">23a30a3b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/4139b672d991409bf30bb81f34ff5e46178d0d16">4139b672</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/33b7b375899ffd1d5bda1044164ea700d01bddb9">33b7b375</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/725dfd75c0f4f67671208555cf79a86c54cedf9f">725dfd75</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/240bb1b43e9029c0cd2dbc8f5e258055561a773c">240bb1b4</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/b7b0f3aeb0db6ba5e78c972d890abde7addf30d7">b7b0f3ae</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/20787589240323972a3be70b4c613dd0c6f6b879">20787589</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/b15db12795cb7fc5bbaffe6ef7fd71c20c9a47aa">b15db127</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/49c8049e361dc30fe6098ee8b30bca04ae648d8e">49c8049e</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/89864d461152d80fd46509a09a7b4c04fe32ecf6">89864d46</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:04-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/31669bd3097c1c2cdec12b77e97654bbbc4c76b6">31669bd3</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-11-24T12:03:04-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/7e968942880db7beca675e6efe1b4bbd59730228">7e968942</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/acef7fd3f243321970060e641717ca498acc0b50">acef7fd3</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/53920304732bfbdaec2b55373c2415eb001e592f">53920304</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/0ca2beeb8a3374b8b84ca4e34ed3bae6047b5893">0ca2beeb</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/7d3d0f1375942bb529406d711fbd1fc9cc549fde">7d3d0f13</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/c29b1a83300cc6955dad5ddd658d573e33cbb71a">c29b1a83</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/55b252f21b81368b4c53bca373ff4fee96063790">55b252f2</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/d9e82a561ca7f184a98670d57e1de534e2f590c6">d9e82a56</a></strong>
<div>
<span>by GHC GitLab CI</span>
<i>at 2020-11-24T12:03:05-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/d9ed5a62114ffea7adfc6f10e91e7f46ceeddc0f">d9ed5a62</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/219f64968049af34daffedddb430dd7d9062b111">219f6496</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/cf99c5e530da10e9a89ae9b4da94ea85ecbd60f0">cf99c5e5</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/d7655654a49d4f9c5e4b4bb64b615df89dcfff57">d7655654</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/389c92df814da9d1e23ba42bde1d2f204ff208f2">389c92df</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/b4ced8465e6561e794172acf784eace6ee632042">b4ced846</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/9116b39ab4119b91463f56a1003188b45ae4f317">9116b39a</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/75b8c06669b31be4408e38a608d64a1dff08426e">75b8c066</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/dcea5aefaa47e415c9537d84ecb04622328aaf51">dcea5aef</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:05-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/16d3ea2132f603109db929a172b206a6b6d40c05">16d3ea21</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:06-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/da69341b0624f5f81f2c4aa2143339945e0b6db1">da69341b</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:06-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/f65a5c9ea49c8a44df24b442b8879dccb094e503">f65a5c9e</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:06-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/543ad4f3f8320c17be0029078a1cbe832f5b6f56">543ad4f3</a></strong>
<div>
<span>by Ben Gamari</span>
<i>at 2020-11-24T12:03:06-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>
</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="#87db583be5c13c1f7b3c958b10e03d67b6a2ca06">
configure.ac
</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>
</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/d4483f7b81dc7bd3d246fc22728a1ec86570e6e8...543ad4f3f8320c17be0029078a1cbe832f5b6f56">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>