Andy Wingo
ba65e32b00
pcc / copy-space: Allow allocations to fail
...
This fixes an issue in which minor collection of a nursery full of live
data can fail because of fragmentation, whereas really it should just
fall back to promotion.
2025-01-13 17:22:43 +01:00
Andy Wingo
5fdb14cc5e
Remove "ABORTED" atomic forwarding state
...
It was not distinguishable from "NOT_FORWARDED".
2025-01-13 16:44:12 +01:00
Andy Wingo
b23b77218c
nofl space: Fix a bug for parallel optimistic evacuation
...
If two tracer threads visit edges to the same object on an evacuation
candidate block, and they first see that the object is unmarked, then
they both try to evacuate it at the same time. Thread A might try and
fail before thread B manages to acquire the forwarding word. B needs to
see that A marked it in place, and to do that it needs to re-load the
mark byte after acquiring the forwarding word. Otherwise perhaps B
could succeed and you would end up with two copies of an object, one of
them garbled!
2025-01-13 16:28:40 +01:00
Andy Wingo
e41000094d
Add missing write barriers to finalizers.c
2025-01-13 10:23:47 +01:00
Andy Wingo
b37a7f3862
copy-space: Fix bug computing field logging byte location
...
Also re-enable survivors in generational-pcc :)
2025-01-13 09:12:34 +01:00
Andy Wingo
27f9a1f01e
gpcc: Temporarily always promote survivors
...
Generational PCC is still a bit buggy.
2025-01-10 16:40:19 +01:00
Andy Wingo
4ab72e92b0
gpcc: Don't mix survivors and new objects in same block
2025-01-10 16:40:19 +01:00
Andy Wingo
c95b7ef046
New collector configuration: generational-pcc
2025-01-10 16:40:19 +01:00
Andy Wingo
65b74b5abb
Add generational support to pcc
2025-01-10 16:40:14 +01:00
Andy Wingo
0b8630145a
Copy space clears log bits when obtaining fresh blocks
2025-01-10 16:05:34 +01:00
Andy Wingo
555694965d
Looking up large object for edge returns the object
2025-01-10 16:05:34 +01:00
Andy Wingo
e4048b5296
Add offset to field-logging fast path
2025-01-10 16:05:34 +01:00
Andy Wingo
209be38640
Pushing logged edges takes ownership of edge buffers
...
This allows field logging to proceed during collection, which might add
new edge buffers. Also fix a bug that would cause debug-mode assertion
failures, where clearing a field set didn't clear edge buffer next
pointers.
2025-01-10 16:03:53 +01:00
Andy Wingo
8b96d8cf90
Fix embarassing use of uninitialized variable
2025-01-10 16:03:53 +01:00
Andy Wingo
47aa6f041f
Add ALWAYS_INLINE to gc_field_set_visit_edge_buffer
2025-01-10 16:03:53 +01:00
Andy Wingo
e65c81518d
Fix copy space compilation in debug mode
...
Also add copy_space_should_promote
2025-01-10 16:02:37 +01:00
Andy Wingo
0318770266
pcc: abstract space that has blocks paged out and in
2025-01-06 16:59:54 +01:00
Andy Wingo
c7645975bf
pcc: abstract space into which small objects are allocated
...
This may be the nursery, in future.
2025-01-06 16:59:54 +01:00
Andy Wingo
095d2ff953
Copy space maintains block flag indicating which are survivors
2025-01-06 16:59:54 +01:00
Andy Wingo
336c2dfadd
Beginnings of scaffolding for generational pcc
2025-01-06 16:59:54 +01:00
Andy Wingo
4f8c7bef61
Refactor copy_space_forward to take src and dst spaces
2025-01-06 16:59:54 +01:00
Andy Wingo
274cf43864
Add new old-gen predicate method: check a range of addresses
2025-01-06 16:59:54 +01:00
Andy Wingo
d96b53facd
Missing inline decl: gc_old_generation_check_alloc_table_bit_pattern
2025-01-06 16:59:54 +01:00
Andy Wingo
b33efb2759
Copy space can reserve some blocks for field-logging bits
...
Useful for an oldgen
2025-01-06 16:59:54 +01:00
Andy Wingo
a74a2c129c
Copy space has flags, can indicate that space is aligned
...
This will be useful for copy-space nurseries.
2025-01-06 16:59:54 +01:00
Andy Wingo
d2e745ac23
Rework large object space
...
Store allocations in a splay tree so that we can efficiently map from an
edge originating in the lospace to its object. Defer returning memory
to the OS to a periodic background thread, using a similar strategy as
for nofl and copy-space pages. Use a size-segregated freelist instead
of requiring a full best-fit search for those pages that haven't yet
been returned to the OS.
2025-01-06 16:59:54 +01:00
Andy Wingo
8e631ca3f3
Remove embedder requirement for per-object remset bits
...
Since we now have a field-logging write barrier, we don't need
per-object log bits.
2025-01-06 16:59:54 +01:00
Andy Wingo
4be3e69ac1
Add asserts to address map / address set
2025-01-06 16:59:54 +01:00
Andy Wingo
95868c70a2
Add splay tree
2025-01-06 16:59:54 +01:00
Andy Wingo
2dcdfc24bc
Field set: per-edge clear callback is optional
2025-01-06 16:59:54 +01:00
Andy Wingo
6a6f5b09e3
Use PROT_NONE to reserve memory, then remap within that memory
...
Should play better with the kernel's overcommit heuristics.
2025-01-06 16:59:54 +01:00
Andy Wingo
922c13a183
Move mmap / munmap / madvise to gc-platform
2025-01-06 16:59:54 +01:00
Andy Wingo
ac016d5f83
nofl: Fix hole count / size computation for promoted blocks
2024-10-07 15:00:45 +02:00
Andy Wingo
cff99c75a8
Fix bug clearing field set
2024-10-04 14:00:47 +02:00
Andy Wingo
da4f1ec806
Fix bug in which head byte's logged bits were not cleared
2024-10-04 13:51:49 +02:00
Andy Wingo
b4ea55b9c4
Don't clear log bits when marking
...
This happens in a post-pass.
2024-10-04 13:51:27 +02:00
Andy Wingo
6d48e12f78
Add assertions when forgetting nofl edges
2024-10-04 13:51:17 +02:00
Andy Wingo
745a5ab558
Don't clear remembered set in non-generational mode
2024-10-04 13:50:57 +02:00
Andy Wingo
478b9de798
Add assertions when pushing edge buffers
2024-10-04 13:50:35 +02:00
Andy Wingo
15a51c8a85
Fix embarrassing bugs in write buffer fast path
...
Check edge address, not object address, and reverse the sense of the
check!
2024-10-04 13:50:01 +02:00
Andy Wingo
e1ae9819cf
gc_object_is_old_generation uses relaxed atomics
2024-10-04 13:49:45 +02:00
Andy Wingo
3c8c956f4c
Add gc_edge_address
2024-10-04 13:49:27 +02:00
Andy Wingo
1a79c3a451
mmc: only serialize root-tracing if there are pinned roots
2024-10-04 11:41:08 +02:00
Andy Wingo
b5c36b9fd8
Explicitly support immediate values
...
Because we have to deref edges ourselves, as part of generational
marking, we need to ignore edges that don't point to heap objects.
2024-10-04 11:40:09 +02:00
Andy Wingo
10017daa0c
Inline set_field in mt-gcbench
2024-10-03 10:05:07 +02:00
Andy Wingo
095515eaed
Rework write barrier fast/slow paths
2024-10-02 21:36:33 +02:00
Andy Wingo
1ecb45a437
Switch mmc to field-logging write barrier
...
Instead of the card table, use metadata bytes for field-logging. More
precision should lead to less work during the pause.
2024-10-02 21:25:09 +02:00
Andy Wingo
1493bf6398
Add gc_object_is_old_generation
...
Will be useful for write barriers.
2024-10-01 15:48:55 +02:00
Andy Wingo
42bf36d7cc
Add nursery for lospace
2024-10-01 14:38:08 +02:00
Andy Wingo
cc04761271
gc_object_set_remembered returns nonzero on success
2024-10-01 14:36:55 +02:00