[Git][ghc/ghc][wip/tsan/fixes] 23 commits: hadrian: Enable Cmm instrumentation in TSAN flavour

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Tue Nov 22 13:50:17 UTC 2022



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


Commits:
18993c8c by Ben Gamari at 2022-11-22T08:49:38-05:00
hadrian: Enable Cmm instrumentation in TSAN flavour

- - - - -
3b8e437f by Ben Gamari at 2022-11-22T08:50:12-05:00
rts/Messages: Refactor

This doesn't change behavior but makes the code a bit easier to follow.

- - - - -
e7241bd3 by Ben Gamari at 2022-11-22T08:50:12-05:00
rts/ThreadPaused: Ordering fixes

- - - - -
dc180cf5 by Ben Gamari at 2022-11-22T08:50:12-05:00
eventlog: Silence spurious data race

- - - - -
cfd3c8e1 by Ben Gamari at 2022-11-22T08:50:12-05:00
Introduce SET_INFO_RELEASE for Cmm

- - - - -
0891b4b9 by Ben Gamari at 2022-11-22T08:50:12-05:00
rts: Use fences instead of explicit barriers

- - - - -
8dd59965 by Ben Gamari at 2022-11-22T08:50:12-05:00
rts/stm: Fix memory ordering in readTVarIO#

See #22421.

- - - - -
00e0a46d by Ben Gamari at 2022-11-22T08:50:12-05:00
Improve heap memory barrier Note

Also introduce MUT_FIELD marker in Closures.h to document mutable
fields.

- - - - -
cd19e23b by Ben Gamari at 2022-11-22T08:50:12-05:00
rts: Introduce getNumCapabilities

And ensure accesses to n_capabilities are atomic (although with relaxed
ordering). This is necessary as RTS API callers may concurrently call
into the RTS without holding a capability.

- - - - -
477d7349 by Ben Gamari at 2022-11-22T08:50:12-05:00
ghc: Fix data race in dump file handling

Previously the dump filename cache would use a non-atomic update which
could potentially result in lost dump contents. Note that this is still
a bit racy since the first writer may lag behind a later appending
writer.

- - - - -
5f84ff57 by Ben Gamari at 2022-11-22T08:50:12-05:00
rts: Always use atomics for context_switch and interrupt

Since these are modified by the timer handler.

- - - - -
b53d302f by Ben Gamari at 2022-11-22T08:50:12-05:00
rts/Timer: Always use atomic operations

As noted in #22447, the existence of the pthread-based ITimer
implementation means that we cannot assume that the program is
single-threaded.

- - - - -
46f9e19d by Ben Gamari at 2022-11-22T08:50:12-05:00
rts: Encapsulate recent_activity access

This makes it easier to ensure that it is accessed using the necessary
atomic operations.

- - - - -
80bf7fbc by Ben Gamari at 2022-11-22T08:50:12-05:00
rts: Encapsulate access to capabilities array

- - - - -
7a9168fd by Ben Gamari at 2022-11-22T08:50:12-05:00
rts: Encapsulate sched_state

- - - - -
745fa64e by Ben Gamari at 2022-11-22T08:50:12-05:00
PrimOps: Fix benign MutVar race

Relaxed ordering is fine here since the later CAS implies a release.

- - - - -
c4159b7c by Ben Gamari at 2022-11-22T08:50:12-05:00
rts: Style fix

- - - - -
3e10b5c7 by Ben Gamari at 2022-11-22T08:50:12-05:00
compiler: Use release store in eager blackholing

- - - - -
eb52c0eb by Ben Gamari at 2022-11-22T08:50:12-05:00
rts: Fix ordering of makeStableName

- - - - -
93503e6d by Ben Gamari at 2022-11-22T08:50:12-05:00
rts: Use ordered accesses instead of explicit barriers

- - - - -
39f1d02e by Ben Gamari at 2022-11-22T08:50:12-05:00
rts: Statically allocate capabilities

This is a rather simplistic way of solving #17289.

- - - - -
5a01c36a by Ben Gamari at 2022-11-22T08:50:12-05:00
rts: Ensure that all accesses to pending_sync are atomic

- - - - -
f3646154 by Ben Gamari at 2022-11-22T08:50:13-05:00
rts: Note race with wakeBlockingQueue

- - - - -


30 changed files:

- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/Utils/Logger.hs
- hadrian/src/Flavour.hs
- rts/Apply.cmm
- rts/Capability.c
- rts/Capability.h
- rts/HeapStackCheck.cmm
- rts/IOManager.c
- rts/Messages.c
- rts/Messages.h
- rts/PrimOps.cmm
- rts/Printer.c
- rts/ProfHeap.c
- rts/ProfilerReport.c
- rts/ProfilerReportJson.c
- rts/Profiling.c
- rts/Proftimer.c
- rts/RetainerProfile.c
- rts/RtsAPI.c
- rts/RtsStartup.c
- rts/SMPClosureOps.h
- rts/STM.c
- rts/Schedule.c
- rts/Schedule.h
- rts/Stats.c
- rts/StgMiscClosures.cmm
- rts/Task.c
- rts/ThreadPaused.c
- rts/Threads.c
- rts/Timer.c


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d4f3ea04bca4978203b2b366298d0a8edbe6975f...f36461543dddf16849673675a23d93a9c986e168

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d4f3ea04bca4978203b2b366298d0a8edbe6975f...f36461543dddf16849673675a23d93a9c986e168
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/20221122/d47d65b8/attachment-0001.html>


More information about the ghc-commits mailing list