| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
The number of distinct arguments passed to GarbageCollect was getting a
bit out of hand.
|
|
|
|
| |
This should be INLINE_HEADER lest we get unused declaration warnings.
|
|
|
|
|
| |
To reflect the fact that these are to do with the nonmoving collector,
now since they are exposed no longer static.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This makes it a bit easier to add instrumentation on this spinlock
while debugging.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Some references to Note [Deadlock detection under the non-moving
collector] were missing an article.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Previously we left various segment link pointers dangling. None of this
wrong per se, but it did make it harder than necessary to debug.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
This fixes the selector optimisation, adding a few write barriers which
are necessary for soundness. See the inline comments for details.
Fixes #22930.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
We must conservatively assume that new closures are reachable since we
are not guaranteed to mark such blocks.
|
| |
|
|
|
|
|
| |
Previously we only updated the state of the segment at the head of each
allocator's filled list.
|
| |
|
|
|
|
|
| |
Assert that entries in the nonmoving generation's generational
remembered set (a.k.a. mutable list) live in nonmoving generation.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
This makes the intent of this implementation a bit clearer.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
These can be quite expensive and it is sometimes useful to compile a
DEBUG RTS without them.
|
| |
|
| |
|
|
|
|
|
|
|
| |
This patch adds the rts_clearMemory function that does its best to
zero out unused RTS memory for a wasm backend use case. See the
comment above rts_clearMemory() prototype declaration for more
detailed explanation. Closes #22920.
|
|
|
|
|
|
|
|
| |
The MBLOCK_SHIFT macro must be the single source of truth for defining
the mblock size, and changing it should only affect performance, not
correctness. This patch makes it truly possible to reconfigure mblock
size, at least on 32-bit targets, by fixing places which implicitly
relied on the previous MBLOCK_SHIFT constant. Fixes #22901.
|
|
|
|
|
| |
Make the RTS compilable with a C++ compiler by inserting necessary
casts.
|
|
|
|
|
|
|
|
| |
When performing GC without work stealing there was no guarantee that
spark pruning was happening after marking of the sparks. This could
cause us to GC live sparks under certain circumstances.
Fixes #22528.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
The logic here was inverted. Reverting the commit to avoid confusion
when examining the commit history.
This reverts commit b3eacd64fb36724ed6c5d2d24a81211a161abef1.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Linux, `pthread_setname_np` (or rather, the kernel) only allows for
thread names up to 16 bytes, including the terminating null byte.
This commit adds a note pointing this out in `createOSThread`, and fixes
up two instances where a thread name of more than 15 characters long was
used (in the RTS, and in a test-case).
Fixes: #22366
Fixes: https://gitlab.haskell.org/ghc/ghc/-/issues/22366
See: https://gitlab.haskell.org/ghc/ghc/-/issues/22366#note_460796
|
|
|
|
| |
Since these may race with the allocator(s).
|
|
|
|
|
| |
We must use an acquire load to read the info table pointer since if we
find an indirection we must be certain that we see the indirectee.
|
|
|
|
|
| |
Relaxed load is fine here since we will take the lock before looking at
the list.
|
|
|
|
|
|
| |
This is a benign race on any sensible hard since these are byte
accesses. Nevertheless, atomic accesses are necessary to satisfy
TSAN.
|
|
|
|
| |
TSAN complains about this sort of thing.
|