[Git][ghc/ghc][wip/T22264] 37 commits: nonmoving: Fix style

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Wed Jan 25 17:33:47 UTC 2023



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


Commits:
0cd532e1 by Ben Gamari at 2023-01-25T11:01:25-05:00
nonmoving: Fix style

- - - - -
412662f4 by Ben Gamari at 2023-01-25T11:01:25-05:00
nonmoving: Deduplicate assertion

- - - - -
4d0f0aef by Ben Gamari at 2023-01-25T11:01:25-05:00
rts: Fix type issues in Sparks.h

Adds explicit casts to satisfy a C++ compiler.

- - - - -
9f772ef5 by Ben Gamari at 2023-01-25T11:01:25-05:00
rts/BlockAlloc: Allow disabling of internal assertions

These can be quite expensive and it is sometimes useful to compile a
DEBUG RTS without them.

- - - - -
ae15e69d by Ben Gamari at 2023-01-25T11:01:25-05:00
rts/Sanity: Mark pinned_object_blocks

- - - - -
321d758a by Ben Gamari at 2023-01-25T11:01:26-05:00
rts/Sanity: Look at nonmoving saved_filled lists

- - - - -
da793084 by Ben Gamari at 2023-01-25T11:01:26-05:00
Evac: Squash data race in eval_selector_chain

- - - - -
f24ee701 by Ben Gamari at 2023-01-25T11:01:26-05:00
nonmoving: Clarify implementation

This makes the intent of this implementation a bit clearer.

- - - - -
85e903ad by Ben Gamari at 2023-01-25T11:01:26-05:00
nonmoving: Clarify comment

- - - - -
ff5acc2e by Ben Gamari at 2023-01-25T11:01:26-05:00
nonmoving: Add missing no-op in busy-wait loop

- - - - -
3c8af87e by Ben Gamari at 2023-01-25T11:01:26-05:00
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.

- - - - -
fbc51408 by Ben Gamari at 2023-01-25T11:01:26-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.

- - - - -
4c5daac6 by Ben Gamari at 2023-01-25T11:01:26-05:00
nonmoving: Sanity check nonmoving large objects and compacts

- - - - -
328b683e by Ben Gamari at 2023-01-25T11:01:26-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.

- - - - -
dd99d945 by Ben Gamari at 2023-01-25T11:01:26-05:00
nonmoving: Don't show occupancy if we didn't collect live words

- - - - -
a78cb59c by Ben Gamari at 2023-01-25T11:01:26-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.

- - - - -
fbef885a by Ben Gamari at 2023-01-25T11:01:26-05:00
nonmoving: Assert state of swept segments

- - - - -
a5c69dbe by Ben Gamari at 2023-01-25T11:01:26-05:00
nonmoving: Handle new closures in nonmovingIsNowAlive

- - - - -
816336e3 by Ben Gamari at 2023-01-25T11:01:26-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.

- - - - -
cdb75f21 by Ben Gamari at 2023-01-25T11:01:26-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.

- - - - -
817d8785 by Ben Gamari at 2023-01-25T11:01:26-05:00
nonmoving: Post-sweep sanity checking

- - - - -
6a5dca4a by Ben Gamari at 2023-01-25T11:01:26-05:00
nonmoving: Avoid n_caps race

- - - - -
bfc5f704 by Ben Gamari at 2023-01-25T11:01:26-05:00
nonmoving: Don't push if nonmoving collector isn't enabled

- - - - -
313c0b30 by Ben Gamari at 2023-01-25T11:01:27-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.

- - - - -
52f04b5f by Ben Gamari at 2023-01-25T11:01:27-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.

- - - - -
a2e2df8c by Ben Gamari at 2023-01-25T11:01:27-05:00
nonmoving: Allow pinned gen0 objects to be WEAK keys

- - - - -
c0cab8f1 by Ben Gamari at 2023-01-25T11:01:27-05:00
rts: Fix typo

"tracingAddCapabilities" was mis-named

- - - - -
b08bced8 by Ben Gamari at 2023-01-25T11:01:27-05:00
rts: Reenable assertion

- - - - -
9ce64147 by Ben Gamari at 2023-01-25T11:01:27-05:00
rts: C++ typing issues

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

- - - - -
11e9da04 by Ben Gamari at 2023-01-25T11:01:27-05:00
rts: Drop SM spinlock

- - - - -
eff4f3ab by Ben Gamari at 2023-01-25T11:01:27-05:00
rts: Fix non-atomic mutation of enabled_capabilities

- - - - -
b31a233b by Ben Gamari at 2023-01-25T11:01:27-05:00
nonmoving: Move current segment array into Capability

- - - - -
c3b895bb by Ben Gamari at 2023-01-25T11:01:59-05:00
hadrian: Add +boot_nonmoving_gc flavour transformer

For using GHC bootstrapping to validate the non-moving GC.

- - - - -
410af41c by Ben Gamari at 2023-01-25T11:02:00-05:00
testsuite: Make listThreads more robust

Previously it was sensitive to the labels of threads which it did not
create (e.g. the IO manager event loop threads). Fix this.

- - - - -
24244f43 by Ben Gamari at 2023-01-25T11:02:01-05:00
rts/Sanity: Fix block count assertion with non-moving collector

The nonmoving collector does not use `oldest_gen->blocks` to track its
block list. However, it nevertheless updates `oldest_gen->n_blocks` to
ensure that its size is accounted for by the storage manager.
Consequently, we must not attempt to assert consistency between the two.

- - - - -
6f6b8cff by Ben Gamari at 2023-01-25T11:02:01-05:00
nonmoving: Fix Note references

Some references to Note [Deadlock detection under the non-moving
collector] were missing an article.

- - - - -
6756fddb by Ben Gamari at 2023-01-25T11:02:01-05:00
testsuite: Fix race in UnliftedTVar2

Previously UnliftedTVar2 would fail when run with multiple capabilities
(and possibly even with one capability) as it would assume that
`killThread#` would immediately kill the "increment" thread.

Also, refactor the the executable to now succeed with no output and
fails with an exit code.

- - - - -


30 changed files:

- .gitlab/gen_ci.hs
- .gitlab/jobs.yaml
- hadrian/src/Flavour.hs
- libraries/base/tests/listThreads.hs
- − libraries/base/tests/listThreads.stdout
- rts/Capability.c
- rts/Capability.h
- rts/CheckUnload.c
- rts/PrimOps.cmm
- 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


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/16336e05d88f08be08fefd106cd0aa9bf3b22504...6756fddb5308ad6f2d94e4b1af87d5c19d2f904d

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/16336e05d88f08be08fefd106cd0aa9bf3b22504...6756fddb5308ad6f2d94e4b1af87d5c19d2f904d
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/20230125/cbc03254/attachment-0001.html>


More information about the ghc-commits mailing list