[Git][ghc/ghc][wip/tsan/fixes] 15 commits: rts: Introduce getNumCapabilities

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



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


Commits:
1865aed5 by Ben Gamari at 2022-11-22T08:56:51-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.

- - - - -
43c565ae by Ben Gamari at 2022-11-22T08:56:51-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.

- - - - -
1be059e3 by Ben Gamari at 2022-11-22T08:56:51-05:00
rts: Always use atomics for context_switch and interrupt

Since these are modified by the timer handler.

- - - - -
d0dbbd49 by Ben Gamari at 2022-11-22T08:56:51-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.

- - - - -
37046343 by Ben Gamari at 2022-11-22T08:56:51-05:00
rts: Encapsulate recent_activity access

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

- - - - -
bee3c827 by Ben Gamari at 2022-11-22T08:56:51-05:00
rts: Encapsulate access to capabilities array

- - - - -
465fbb22 by Ben Gamari at 2022-11-22T08:56:51-05:00
rts: Encapsulate sched_state

- - - - -
6f6e960b by Ben Gamari at 2022-11-22T08:56:51-05:00
PrimOps: Fix benign MutVar race

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

- - - - -
61f76527 by Ben Gamari at 2022-11-22T08:56:51-05:00
rts: Style fix

- - - - -
f34d7795 by Ben Gamari at 2022-11-22T08:56:51-05:00
compiler: Use release store in eager blackholing

- - - - -
8e81b6b5 by Ben Gamari at 2022-11-22T08:56:51-05:00
rts: Fix ordering of makeStableName

- - - - -
e9254737 by Ben Gamari at 2022-11-22T08:56:51-05:00
rts: Use ordered accesses instead of explicit barriers

- - - - -
6ca2af23 by Ben Gamari at 2022-11-22T08:56:51-05:00
rts: Statically allocate capabilities

This is a rather simplistic way of solving #17289.

- - - - -
81be6c69 by Ben Gamari at 2022-11-22T08:56:51-05:00
rts: Ensure that all accesses to pending_sync are atomic

- - - - -
985cb0ac by Ben Gamari at 2022-11-22T08:56:51-05:00
rts: Note race with wakeBlockingQueue

- - - - -


30 changed files:

- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/Utils/Logger.hs
- rts/Capability.c
- rts/Capability.h
- rts/HeapStackCheck.cmm
- rts/IOManager.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/Threads.c
- rts/Timer.c
- rts/TraverseHeap.c
- rts/eventlog/EventLog.c
- rts/hooks/LongGCSync.c
- rts/include/Cmm.h


The diff was not included because it is too large.


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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f36461543dddf16849673675a23d93a9c986e168...985cb0ac8c08fd6455fe9a4aaae407a7af87914d
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/173be5e9/attachment.html>


More information about the ghc-commits mailing list