[Git][ghc/ghc][wip/T22563] 37 commits: rts/Messages: Refactor

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Tue Dec 20 00:08:24 UTC 2022



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


Commits:
ed056bc3 by Ben Gamari at 2022-12-16T16:12:44-05:00
rts/Messages: Refactor

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

- - - - -
7356f8e0 by Ben Gamari at 2022-12-16T16:12:44-05:00
rts/ThreadPaused: Ordering fixes

- - - - -
914f0025 by Ben Gamari at 2022-12-16T16:12:44-05:00
eventlog: Silence spurious data race

- - - - -
fbc84244 by Ben Gamari at 2022-12-16T16:12:44-05:00
Introduce SET_INFO_RELEASE for Cmm

- - - - -
821b5472 by Ben Gamari at 2022-12-16T16:12:44-05:00
rts: Use fences instead of explicit barriers

- - - - -
2228c999 by Ben Gamari at 2022-12-16T16:12:44-05:00
rts/stm: Fix memory ordering in readTVarIO#

See #22421.

- - - - -
99269b9f by Ben Gamari at 2022-12-16T16:12:44-05:00
Improve heap memory barrier Note

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

- - - - -
70999283 by Ben Gamari at 2022-12-16T16:12:44-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.

- - - - -
98689f77 by Ben Gamari at 2022-12-16T16:12:44-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.

- - - - -
605d9547 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Always use atomics for context_switch and interrupt

Since these are modified by the timer handler.

- - - - -
86f20258 by Ben Gamari at 2022-12-16T16:12:45-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.

- - - - -
f8e901dc by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Encapsulate recent_activity access

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

- - - - -
e0affaa9 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Encapsulate access to capabilities array

- - - - -
7ca683e4 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Encapsulate sched_state

- - - - -
1cf13bd0 by Ben Gamari at 2022-12-16T16:12:45-05:00
PrimOps: Fix benign MutVar race

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

- - - - -
3d2a7e08 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Style fix

- - - - -
82c62074 by Ben Gamari at 2022-12-16T16:12:45-05:00
compiler: Use release store in eager blackholing

- - - - -
eb1a0136 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Fix ordering of makeStableName

- - - - -
ad0e260a by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Use ordered accesses instead of explicit barriers

- - - - -
a3eccf06 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Statically allocate capabilities

This is a rather simplistic way of solving #17289.

- - - - -
287fa3fb by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Ensure that all accesses to pending_sync are atomic

- - - - -
351eae58 by Ben Gamari at 2022-12-16T16:12:45-05:00
rts: Note race with wakeBlockingQueue

- - - - -
5acf33dd by Bodigrim at 2022-12-16T16:13:22-05:00
Bump submodule directory to 1.3.8.0 and hpc to HEAD

- - - - -
0dd95421 by Bodigrim at 2022-12-16T16:13:22-05:00
Accept allocations increase on Windows

This is because of `filepath-1.4.100.0` and AFPP, causing increasing round-trips
between lists and ByteArray. See #22625 for discussion.

Metric Increase:
    MultiComponentModules
    MultiComponentModulesRecomp
    MultiLayerModules
    MultiLayerModulesRecomp
    T10421
    T10547
    T12150
    T12227
    T12234
    T12425
    T13035
    T13253
    T13253-spj
    T13701
    T13719
    T15703
    T16875
    T18140
    T18282
    T18304
    T18698a
    T18698b
    T18923
    T20049
    T21839c
    T21839r
    T5837
    T6048
    T9198
    T9961
    TcPlugin_RewritePerf
    hard_hole_fits

- - - - -
ef9ac9d2 by Cheng Shao at 2022-12-16T16:13:59-05:00
testsuite: Mark T9405 as fragile instead of broken on Windows

It's starting to pass again, and the unexpected pass blocks CI.

- - - - -
1f3abd85 by Cheng Shao at 2022-12-16T21:16:28+00:00
compiler: remove obsolete commented code in wasm NCG

It was just a temporary hack to workaround a bug in the relooper, that
bug has been fixed long before the wasm backend is merged.

- - - - -
e3104eab by Cheng Shao at 2022-12-16T21:16:28+00:00
compiler: add missing export list of GHC.CmmToAsm.Wasm.FromCmm

Also removes some unreachable code here.

- - - - -
1c6930bf by Cheng Shao at 2022-12-16T21:16:28+00:00
compiler: change fallback function signature to Cmm function signature in wasm NCG

In the wasm NCG, when handling a `CLabel` of undefined function
without knowing its function signature, we used to fallback to `() ->
()` which is accepted by `wasm-ld`. This patch changes it to the
signature of Cmm functions, which equally works, but would be required
when we emit tail call instructions.

- - - - -
8a81d9d9 by Cheng Shao at 2022-12-16T21:16:28+00:00
compiler: add optional tail-call support in wasm NCG

When the `-mtail-call` clang flag is passed at configure time, wasm
tail-call extension is enabled, and the wasm NCG will emit
`return_call`/`return_call_indirect` instructions to take advantage of
it and avoid the `StgRun` trampoline overhead.

Closes #22461.

- - - - -
d1431cc0 by Cheng Shao at 2022-12-17T08:07:15-05:00
base: add missing autoconf checks for waitpid/umask

These are not present in wasi-libc. Required for fixing #22589

- - - - -
da3f1e91 by Cheng Shao at 2022-12-17T08:07:51-05:00
compiler: make .wasm the default executable extension on wasm32

Following convention as in other wasm toolchains. Fixes #22594.

- - - - -
ad21f4ef by Cheng Shao at 2022-12-17T08:07:51-05:00
ci: support hello.wasm in ci.sh cross testing logic

- - - - -
6fe2d778 by amesgen at 2022-12-18T19:33:49-05:00
Correct `exitWith` Haddocks

The `IOError`-specific `catch` in the Prelude is long gone.

- - - - -
b3eacd64 by Ben Gamari at 2022-12-18T19:34:24-05:00
rts: Drop racy assertion

0e274c39bf836d5bb846f5fa08649c75f85326ac added an assertion in
`dirty_MUT_VAR` checking that the MUT_VAR being dirtied was clean.
However, this isn't necessarily the case since another thread may have
raced us to dirty the object.

- - - - -
761c1f49 by Ben Gamari at 2022-12-18T19:35:00-05:00
rts/libdw: Silence uninitialized usage warnings

As noted in #22538, previously some GCC versions warned that various
locals in Libdw.c may be used uninitialized. Although this wasn't
strictly true (since they were initialized in an inline assembler block)
we fix this by providing explicit empty initializers.

Fixes #22538
- - - - -
3f96e175 by Ben Gamari at 2022-12-19T18:04:30-05:00
Revert "rts: Drop racy assertion"

The logic here was inverted. Reverting the commit to avoid confusion
when examining the commit history.

This reverts commit b3eacd64fb36724ed6c5d2d24a81211a161abef1.

- - - - -
6c699d0d by Ben Gamari at 2022-12-19T18:05:06-05:00
rts: Drop racy assertion

0e274c39bf836d5bb846f5fa08649c75f85326ac added an assertion in
`dirty_MUT_VAR` checking that the MUT_VAR being dirtied was clean.
However, this isn't necessarily the case since another thread may have
raced us to dirty the object.

- - - - -


30 changed files:

- .gitlab/ci.sh
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/Wasm.hs
- compiler/GHC/CmmToAsm/Wasm/Asm.hs
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/CmmToAsm/Wasm/Types.hs
- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Linker/Static/Utils.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/Utils/Logger.hs
- compiler/GHC/Wasm/ControlFlow.hs
- compiler/GHC/Wasm/ControlFlow/FromCmm.hs
- libraries/base/System/Exit.hs
- libraries/base/System/Posix/Internals.hs
- libraries/base/configure.ac
- libraries/directory
- libraries/hpc
- rts/Apply.cmm
- rts/Capability.c
- rts/Capability.h
- rts/HeapStackCheck.cmm
- rts/IOManager.c
- rts/Libdw.c
- rts/Messages.c
- rts/Messages.h
- rts/PrimOps.cmm
- rts/Printer.c
- rts/ProfHeap.c
- rts/ProfilerReport.c


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d703b5dfaa50c13de3eae2ed0a3af424c6cc863e...6c699d0df75dc372eac35361735964f46fc22456

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d703b5dfaa50c13de3eae2ed0a3af424c6cc863e...6c699d0df75dc372eac35361735964f46fc22456
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/20221219/a2d992a4/attachment-0001.html>


More information about the ghc-commits mailing list