summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fixes #19627.wip/T19627Apoorv Ingle2023-03-084-2/+156
| | | | | | | | | Previously the solver failed with an unhelpful "solver reached too may iterations" error. With the fix for #21909 in place we no longer have the possibility of generating such an error if we have `-fconstraint-solver-iteration` > `-fgivens-fuel > `-fwanteds-fuel`. This is true by default, and the said fix also gives programmers a knob to control how hard the solver should try before giving up. This commit adds: * Reference to ticket #19627 in the Note [Expanding Recursive Superclasses and ExpansionFuel] * Test `typecheck/should_fail/T19627.hs` for regression purposes
* hadrian: Fix flavour compiler stage options off-by-one errorAlexis King2023-03-089-33/+61
| | | | | | | | | | | | | | | !9193 pointed out that ghcDebugAssertions was supposed to be a predicate on the stage of the built compiler, but in practice it was a predicate on the stage of the compiler used to build. Unfortunately, while it fixed that issue for ghcDebugAssertions, it documented every other similar option as behaving the same way when in fact they all used the old behavior. The new behavior of ghcDebugAssertions seems more intuitive, so this commit changes the interpretation of every other option to match. It also improves the enableProfiledGhc and debugGhc flavour transformers by making them more selective about which stages in which they build additional library/RTS ways.
* nonmoving: Non-concurrent collectionBen Gamari2023-03-088-83/+133
|
* rts: Capture GC configuration in a structBen Gamari2023-03-083-19/+34
| | | | | The number of distinct arguments passed to GarbageCollect was getting a bit out of hand.
* testsuite: Skip T7160 in the nonmoving wayBen Gamari2023-03-081-2/+2
| | | | Finalization order is different under the nonmoving collector.
* testsuite: Mark ffi023 as broken due to #23089Ben Gamari2023-03-081-0/+1
|
* rts: Fix incorrect STATIC_INLINEBen Gamari2023-03-081-1/+1
| | | | This should be INLINE_HEADER lest we get unused declaration warnings.
* rts: Rename clear_segment(_free_blocks)?Ben Gamari2023-03-083-9/+9
| | | | | To reflect the fact that these are to do with the nonmoving collector, now since they are exposed no longer static.
* testsuite: Only run T22795* in the normal wayBen Gamari2023-03-081-3/+3
| | | | | It doesn't make sense to run these in multiple ways as they merely test whether `-threaded`/`-single-threaded` flags.
* nonmoving: Split out nonmovingAllocateGCBen Gamari2023-03-084-15/+55
|
* nonmoving: Move allocator into new source fileBen Gamari2023-03-087-198/+237
|
* gitlab-ci: Add job bootstrapping with nonmoving GCBen Gamari2023-03-082-72/+267
|
* hadrian: Add +boot_nonmoving_gc flavour transformerBen Gamari2023-03-081-0/+8
| | | | For using GHC bootstrapping to validate the non-moving GC.
* nonmoving: Ensure that sanity checker accounts for saved_filled segmentsBen Gamari2023-03-081-0/+1
|
* nonmoving: Fix unregisterised buildBen Gamari2023-03-081-0/+4
|
* testsuite: Skip some tests when sanity checking is enabledBen Gamari2023-03-084-6/+12
|
* rts: Encapsulate block allocator spinlockBen Gamari2023-03-087-21/+28
| | | | | This makes it a bit easier to add instrumentation on this spinlock while debugging.
* nonmoving: Don't call prepareUnloadCheckBen Gamari2023-03-081-1/+2
| | | | | | 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.
* rts/Sanity: Fix block count assertion with non-moving collectorBen Gamari2023-03-081-3/+13
| | | | | | | 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.
* nonmoving: Fix Note referencesBen Gamari2023-03-087-8/+8
| | | | | Some references to Note [Deadlock detection under the non-moving collector] were missing an article.
* nonmoving: Move current segment array into CapabilityBen Gamari2023-03-0811-137/+89
| | | | | | | | | | | | | | The current segments are conceptually owned by the mutator, not the collector. Consequently, it was quite tricky to prove that the mutator would not race with the collect due to this shared state. It turns out that such races are possible: when resizing the current segment array we may concurrently try to take a heap census. This will attempt to walk the current segment array, causing a data race. Fix this by moving the current segment array into `Capability`, where it belongs. Fixes #22926.
* rts: Reenable assertionBen Gamari2023-03-081-1/+1
|
* nonmoving: Allow pinned gen0 objects to be WEAK keysBen Gamari2023-03-081-4/+14
|
* nonmoving: Sync-phase mark budgetingBen Gamari2023-03-083-12/+86
| | | | | | | | | | 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. Fixes #22929.
* nonmoving: Be more paranoid in segment trackingBen Gamari2023-03-083-1/+7
| | | | | Previously we left various segment link pointers dangling. None of this wrong per se, but it did make it harder than necessary to debug.
* nonmoving: Don't push if nonmoving collector isn't enabledBen Gamari2023-03-081-1/+1
|
* nonmoving: Avoid n_caps raceBen Gamari2023-03-081-4/+4
|
* nonmoving: Post-sweep sanity checkingBen Gamari2023-03-081-1/+13
|
* nonmoving: Add missing write barriers in selector optimisationBen Gamari2023-03-082-6/+62
| | | | | | | This fixes the selector optimisation, adding a few write barriers which are necessary for soundness. See the inline comments for details. Fixes #22930.
* nonmoving: Don't clobber update rem sets of old capabilitiesBen Gamari2023-03-081-1/+1
| | | | | | | | | 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. Fixes #22927.
* nonmoving: Handle new closures in nonmovingIsNowAliveBen Gamari2023-03-082-8/+18
| | | | | We must conservatively assume that new closures are reachable since we are not guaranteed to mark such blocks.
* nonmoving: Assert state of swept segmentsBen Gamari2023-03-082-0/+3
|
* nonmoving: Fix tracking of FILLED_SWEEPING segmentsBen Gamari2023-03-081-1/+1
| | | | | Previously we only updated the state of the segment at the head of each allocator's filled list.
* nonmoving: Don't show occupancy if we didn't collect live wordsBen Gamari2023-03-083-17/+41
|
* nonmoving: Sanity check mutable listBen Gamari2023-03-081-0/+1
| | | | | Assert that entries in the nonmoving generation's generational remembered set (a.k.a. mutable list) live in nonmoving generation.
* nonmoving: Sanity check nonmoving large objects and compactsBen Gamari2023-03-081-0/+5
|
* nonmoving: Fix handling of weak pointersBen Gamari2023-03-086-79/+162
| | | | | | | | | | | | | 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.
* nonmoving: Don't push empty arrays to update remembered setBen Gamari2023-03-081-2/+2
| | | | | | | | Previously the write barrier of resizeSmallArray# incorrectly handled resizing of zero-sized arrays, pushing an invalid pointer to the update remembered set. Fixes #22931.
* nonmoving: Add missing no-op in busy-wait loopBen Gamari2023-03-081-2/+5
|
* nonmoving: Clarify commentBen Gamari2023-03-081-1/+1
|
* nonmoving: Clarify implementationBen Gamari2023-03-081-10/+11
| | | | This makes the intent of this implementation a bit clearer.
* Evac: Squash data race in eval_selector_chainBen Gamari2023-03-081-2/+3
|
* rts/Sanity: Look at nonmoving saved_filled listsBen Gamari2023-03-081-0/+2
|
* rts/Sanity: Mark pinned_object_blocksBen Gamari2023-03-081-0/+1
|
* rts/BlockAlloc: Allow disabling of internal assertionsBen Gamari2023-03-081-6/+16
| | | | | These can be quite expensive and it is sometimes useful to compile a DEBUG RTS without them.
* rts: Use release ordering when storing thread labelsBen Gamari2023-03-081-1/+1
| | | | Since this makes the ByteArray# visible from other cores.
* rts: Fix type issues in Sparks.hBen Gamari2023-03-081-2/+2
| | | | Adds explicit casts to satisfy a C++ compiler.
* nonmoving: Deduplicate assertionBen Gamari2023-03-081-2/+9
|
* nonmoving: Fix styleBen Gamari2023-03-081-2/+3
|
* rts: Drop redundant prototypeBen Gamari2023-03-081-2/+0
|