[Git][ghc/ghc][wip/tsan/all] 7 commits: rts: Accept benign races in Proftimer

Ben Gamari gitlab at gitlab.haskell.org
Tue Oct 20 18:46:17 UTC 2020



Ben Gamari pushed to branch wip/tsan/all at Glasgow Haskell Compiler / GHC


Commits:
1ce9c5c7 by Ben Gamari at 2020-10-20T14:45:50-04:00
rts: Accept benign races in Proftimer

- - - - -
03b5dc44 by Ben Gamari at 2020-10-20T14:45:50-04:00
rts: Pause timer while changing capability count

This avoids #17289.

- - - - -
f8257342 by Ben Gamari at 2020-10-20T14:45:51-04:00
Fix #17289

- - - - -
60aeb584 by Ben Gamari at 2020-10-20T14:45:51-04:00
suppress #17289 (ticker) race

- - - - -
d7885a85 by Ben Gamari at 2020-10-20T14:45:51-04:00
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.

- - - - -
c5da3791 by Ben Gamari at 2020-10-20T14:45:51-04:00
rts: Annotate benign race in ticker shutdown logic

We are guaranteed to see the change in the `stopped` flag at some point
so the race is harmless.

- - - - -
ca66a680 by Ben Gamari at 2020-10-20T14:46:09-04:00
Merge branch 'wip/tsan/timer' into wip/tsan/all

- - - - -


1 changed file:

- rts/posix/itimer/Pthread.c


Changes:

=====================================
rts/posix/itimer/Pthread.c
=====================================
@@ -189,7 +189,7 @@ void
 startTicker(void)
 {
     OS_ACQUIRE_LOCK(&mutex);
-    stopped = 0;
+    RELAXED_STORE(&stopped, false);
     signalCondition(&start_cond);
     OS_RELEASE_LOCK(&mutex);
 }
@@ -199,7 +199,7 @@ void
 stopTicker(void)
 {
     OS_ACQUIRE_LOCK(&mutex);
-    stopped = 1;
+    RELAXED_STORE(&stopped, true):
     OS_RELEASE_LOCK(&mutex);
 }
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e93ed3e60a09f1083dbd697562d2063f783ba5e3...ca66a68098773586d5c8c565964cf421df5a57c0

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e93ed3e60a09f1083dbd697562d2063f783ba5e3...ca66a68098773586d5c8c565964cf421df5a57c0
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201020/16164427/attachment.html>


More information about the ghc-commits mailing list