[Git][ghc/ghc][wip/9.2.6-backports] 21 commits: rts: Introduce getNumCapabilities

Zubin (@wz1000) gitlab at gitlab.haskell.org
Wed Feb 8 09:27:26 UTC 2023



Zubin pushed to branch wip/9.2.6-backports at Glasgow Haskell Compiler / GHC


Commits:
804cd4c7 by Ben Gamari at 2023-02-08T14:54:08+05:30
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.

(cherry picked from commit 70999283156f527c5aea6dee57a3d14989a9903a)

- - - - -
04e9ae57 by Ben Gamari at 2023-02-08T14:54:16+05:30
nonmoving: Don't show occupancy if we didn't collect live words

(cherry picked from commit fcd9794163f6ae7af8783676ee79e0b8e78167ba)

- - - - -
67b43a14 by Ben Gamari at 2023-02-08T14:54:22+05:30
nonmoving: Refactor update remembered set initialization

This avoids a lock inversion between the storage manager mutex and
the stable pointer table mutex by not dropping the SM_MUTEX in
nonmovingCollect. This requires quite a bit of rejiggering but it
does seem like a better strategy.

(cherry picked from commit 543cae0084a72ca767a443d857f9e65a5a79f71d)

- - - - -
0c85bf30 by Ben Gamari at 2023-02-08T14:54:29+05:30
nonmoving: Fix style

(cherry picked from commit b642ef1dc4cbe19c3479b2c014e7d1f7959f8e4a)

- - - - -
3d26addf by Ben Gamari at 2023-02-08T14:54:43+05:30
Evac: Squash data race in eval_selector_chain

(cherry picked from commit dd784b3b01f076fa7f5715150c53ad4c183ae79d)

- - - - -
1c4ce072 by Ben Gamari at 2023-02-08T14:54:52+05:30
nonmoving: Don't push empty arrays to update remembered set

Previously the write barrier of resizeSmallArray# incorrectly handled
resizing of zero-sized arrays, pushing an invalid pointer to the update
remembered set.

Likely fixes the cause of #22264.

(cherry picked from commit f8988a9c53ae73ff5b9c6008f467a7171e99c61f)

- - - - -
90dbc9e8 by Ben Gamari at 2023-02-08T14:55:02+05:30
nonmoving: Fix handling of weak pointers

This fixes an interaction between aging and weak pointer handling which
prevented the finalization of some weak pointers. In particular, weak
pointers could have their keys incorrectly marked by the preparatory
collector, preventing their finalization by the subsequent concurrent
collection.

While in the area, we also significantly improve the assertions
regarding weak pointers.

Fixes #22327.

(cherry picked from commit a999f7b5b4b7316c088d7233a452fb33dc17646f)

- - - - -
6e9c60cc by Ben Gamari at 2023-02-08T14:55:09+05:30
nonmoving: Fix tracking of FILLED_SWEEPING segments

Previously we only updated the state of the segment at the head of each
allocator's filled list.

(cherry picked from commit 48b89dba91640fa977d038ea5283019c73f1b18e)

- - - - -
20591cb0 by Ben Gamari at 2023-02-08T14:55:21+05:30
nonmoving: Handle new closures in nonmovingIsNowAlive

(cherry picked from commit 36ca160d0f199a688cf5fbc91d4bb92d2d4ea14e)

- - - - -
03f575a3 by Ben Gamari at 2023-02-08T14:55:27+05:30
nonmoving: Don't clobber update rem sets of old capabilities

Previously `storageAddCapabilities` (called by `setNumCapabilities`) would
clobber the update remembered sets of existing capabilities when
increasing the capability count. Fix this by only initializing the
update remembered sets of the newly-created capabilities.

(cherry picked from commit 8b64aff0fa978c762dfae8df235dd2b2a340656a)

- - - - -
fe9cec4c by Ben Gamari at 2023-02-08T14:55:34+05:30
nonmoving: Add missing write barriers in selector optimisation

This fixes the selector optimisation, adding a few write barriers which
are necessary for soundness.

(cherry picked from commit dde67d6e32ecff0e400f98213d42ae790babac09)

- - - - -
20727b6a by Ben Gamari at 2023-02-08T14:55:41+05:30
nonmoving: Don't push if nonmoving collector isn't enabled

(cherry picked from commit 8adc1750c02e596b4014d2837b4eb3d76bd130f2)

- - - - -
f3866802 by Ben Gamari at 2023-02-08T14:56:15+05:30
nonmoving: Sync-phase mark budgeting

Here we significantly improve the bound on sync phase pause times by
imposing a limit on the amount of work that we can perform during the
sync. If we find that we have exceeded our marking budget then we allow
the mutators to resume, return to concurrent marking, and try
synchronizing again later.

(cherry picked from commit c620669651c52fd228af61040747dd7236c4ba2b)

- - - - -
0bb408be by Ben Gamari at 2023-02-08T14:56:23+05:30
nonmoving: Allow pinned gen0 objects to be WEAK keys

(cherry picked from commit 3887132fcd20f0a1edfc9f7006bdbed2634e2a8d)

- - - - -
ab2f238f by Ben Gamari at 2023-02-08T14:56:29+05:30
nonmoving: Be more paranoid in segment tracking

Previously we left various segment link pointers dangling. None of this
wrong per se, but it did make it harder than necessary to debug.

(cherry picked from commit cc75031b4d93d4565e0428cb5910d9b9a645485b)

- - - - -
ce7573df by Ben Gamari at 2023-02-08T14:56:36+05:30
nonmoving: Add missing no-op in busy-wait loop

(cherry picked from commit 9f931a8801c84b8ae473f91349e144eebc73b415)

- - - - -
fb3b83b4 by Ben Gamari at 2023-02-08T14:56:43+05:30
nonmoving: Move current segment array into Capability

(cherry picked from commit 9d245c1baec91ee79d715062b127e487456d9c9e)

- - - - -
3003bf06 by Ben Gamari at 2023-02-08T14:56:50+05:30
nonmoving: Don't call prepareUnloadCheck

When the nonmoving GC is in use we do not call `checkUnload` (since we
don't unload code) and therefore should not call `prepareUnloadCheck`,
lest we run into assertions.

(cherry picked from commit 6bdce35cdd59112a8cb4a4a3b061e854ada3ff63)

- - - - -
f68e52df by Ben Gamari at 2023-02-08T14:56:56+05:30
nonmoving: Fix unregisterised build

(cherry picked from commit 6df2709e7215ea80d7267800e0318aee2a7c277f)

- - - - -
2cc446ff by Ben Gamari at 2023-02-08T14:57:03+05:30
nonmoving: Avoid n_caps race

(cherry picked from commit c00d6de815d4e125c1c4d8ff06549042f502f759)

- - - - -
df5d85dc by Ben Gamari at 2023-02-08T14:57:11+05:30
relnotes: Mention various non-moving GC fixes

- - - - -


30 changed files:

- docs/users_guide/9.2.6-notes.rst
- includes/rts/Threads.h
- rts/Capability.c
- rts/Capability.h
- 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/Stats.c
- rts/Task.c
- rts/Threads.c
- rts/TraverseHeap.c
- rts/eventlog/EventLog.c
- rts/hooks/LongGCSync.c
- rts/posix/Signals.c
- rts/sm/Compact.c
- rts/sm/Evac.c
- rts/sm/GC.c
- rts/sm/MarkWeak.c
- rts/sm/NonMoving.c


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/67ec973ce40d8a66d48c0f5f40458380957b6e6f...df5d85dc201a6d66e6272abda448ebdff67dd6a2

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/67ec973ce40d8a66d48c0f5f40458380957b6e6f...df5d85dc201a6d66e6272abda448ebdff67dd6a2
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/20230208/56a39bc1/attachment-0001.html>


More information about the ghc-commits mailing list