[Git][ghc/ghc][wip/T22264] 21 commits: nonmoving: Fix handling of weak pointers

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Mon Jan 9 20:23:10 UTC 2023



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


Commits:
1ecbf4ef by Ben Gamari at 2023-01-09T15:22:49-05:00
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.

- - - - -
c1271cfa by Ben Gamari at 2023-01-09T15:22:49-05:00
nonmoving: Sanity check nonmoving large objects and compacts

- - - - -
e061aa5a by Ben Gamari at 2023-01-09T15:22:49-05:00
nonmoving: Sanity check mutable list

Assert that entries in the nonmoving generation's generational
remembered set (a.k.a. mutable list) live in nonmoving generation.

- - - - -
25fdeee7 by Ben Gamari at 2023-01-09T15:22:49-05:00
nonmoving: Don't show occupancy if we didn't collect live words

- - - - -
8b82a2b0 by Ben Gamari at 2023-01-09T15:22:49-05:00
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.

- - - - -
f1c9a041 by Ben Gamari at 2023-01-09T15:22:49-05:00
nonmoving: Assert state of swept segments

- - - - -
915181d3 by Ben Gamari at 2023-01-09T15:22:49-05:00
nonmoving: Handle new closures in nonmovingIsNowAlive

- - - - -
b75229ae by Ben Gamari at 2023-01-09T15:22:49-05:00
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.

- - - - -
b45c529f by Ben Gamari at 2023-01-09T15:22:49-05:00
nonmoving: Add missing write barriers in selector optimisation

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

- - - - -
1cd74885 by Ben Gamari at 2023-01-09T15:22:49-05:00
nonmoving: Post-sweep sanity checking

- - - - -
2ab54d88 by Ben Gamari at 2023-01-09T15:22:49-05:00
nonmoving: Avoid n_caps race

- - - - -
b2763a51 by Ben Gamari at 2023-01-09T15:22:49-05:00
nonmoving: Don't push if nonmoving collector isn't enabled

- - - - -
a11bdf9e by Ben Gamari at 2023-01-09T15:22:49-05:00
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.

- - - - -
799e2a50 by Ben Gamari at 2023-01-09T15:22:50-05:00
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.

- - - - -
be328c31 by Ben Gamari at 2023-01-09T15:22:50-05:00
nonmoving: Allow pinned gen0 objects to be WEAK keys

- - - - -
7d7979eb by Ben Gamari at 2023-01-09T15:22:50-05:00
rts: Fix typo

"tracingAddCapabilities" was mis-named

- - - - -
570c3478 by Ben Gamari at 2023-01-09T15:22:50-05:00
rts: Reenable assertion

- - - - -
73f40a60 by Ben Gamari at 2023-01-09T15:22:50-05:00
rts: C++ typing issues

Make the RTS compilable with a C++ compiler by inserting necessary
casts.

- - - - -
814a8545 by Ben Gamari at 2023-01-09T15:22:50-05:00
rts: Drop SM spinlock

- - - - -
5cd834fc by Ben Gamari at 2023-01-09T15:22:50-05:00
rts: Fix non-atomic mutation of enabled_capabilities

- - - - -
89fba7d8 by Ben Gamari at 2023-01-09T15:22:50-05:00
nonmoving: Move current segment array into Capability

- - - - -


30 changed files:

- rts/Capability.c
- rts/Capability.h
- rts/CheckUnload.c
- rts/RtsStartup.c
- rts/Schedule.c
- rts/Schedule.h
- rts/Sparks.h
- rts/Stats.c
- rts/Trace.c
- rts/Trace.h
- rts/include/rts/storage/MBlock.h
- rts/sm/BlockAlloc.c
- rts/sm/Evac.c
- rts/sm/GC.c
- rts/sm/GC.h
- rts/sm/GCUtils.c
- rts/sm/GCUtils.h
- rts/sm/HeapAlloc.h
- rts/sm/MarkStack.h
- rts/sm/MarkWeak.c
- rts/sm/NonMoving.c
- rts/sm/NonMoving.h
- rts/sm/NonMovingCensus.c
- rts/sm/NonMovingCensus.h
- rts/sm/NonMovingMark.c
- rts/sm/NonMovingMark.h
- rts/sm/NonMovingShortcut.c
- rts/sm/NonMovingSweep.c
- rts/sm/Sanity.c
- rts/sm/Sanity.h


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8597d2bc2ed61910af3d8177715e16efbe2eb2ef...89fba7d861d11d91fdec1d6ee7da67d49780bd98

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8597d2bc2ed61910af3d8177715e16efbe2eb2ef...89fba7d861d11d91fdec1d6ee7da67d49780bd98
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/20230109/2b37bd32/attachment-0001.html>


More information about the ghc-commits mailing list