Andy Wingo
fbcdffdc62
Fix bogus assert in mmc.c:deactivate_mutator
2025-05-16 22:01:15 +02:00
Andy Wingo
2018a77f36
Fix bogus static debug check in mmc init
2025-05-16 22:00:48 +02:00
Andy Wingo
e59fde2edf
Fix build issue with mmc in Guile
...
For some reason we need to include gc-api with GC_IMPL already defined,
otherwise the attrs don't get picked up.
2025-05-16 22:00:02 +02:00
Andy Wingo
8a157bc616
Add allocation counter to prepare_gc event
...
Adapt all users
2025-05-16 21:59:07 +02:00
Andy Wingo
08e6633f93
Add embedder API to provide heap and mutator conservative roots
2025-05-15 14:46:34 +02:00
Andy Wingo
2f13187f62
Add gc_safepoint_signal_number() API
2025-05-15 11:59:51 +02:00
Andy Wingo
6a554e5dd7
Add gc_deactivate / gc_reactivate
...
Guile needs this.
2025-05-15 11:39:12 +02:00
Andy Wingo
675d8d649a
Rework gc_call_without_gc to allow reentrancy
...
Rename to gc_deactivate_for_call / gc_reactivate_for_call
2025-05-15 11:26:27 +02:00
Andy Wingo
d58aa71281
Add API to inihibit pre-emption
...
This is really only for BDW. It uses GC_alloc_lock() /
GC_alloc_unlock().
2025-05-15 09:01:28 +02:00
Andy Wingo
a5c69fb920
Add try-push, swap-value API to ephemerons
...
The former allows for knowing whether a push succeeded or not, which is
useful for concurrent hash tables. The latter makes ephemerons mutable,
if the embedder wants to use them that way.
2025-05-09 09:56:17 +02:00
Andy Wingo
c7fe77de0e
Add gc_heap_contains API
2025-05-04 12:10:03 +02:00
Andy Wingo
e2b75d302d
Add gc_heap_set_allocation_failure_handler
...
Also wire it up to bdw.
2025-04-23 11:42:21 +02:00
Andy Wingo
1e41f0e093
mmc: Tail-call an out-of-memory handler if allocation fails
2025-04-23 11:31:15 +02:00
Andy Wingo
2dab407ec1
Expose definition of gc_stack_addr, rework API
2025-04-18 15:08:01 +02:00
Andy Wingo
05e8aba462
Add gc_allocation_counter API
2025-03-14 09:44:18 +01:00
Andy Wingo
d22eb88948
nofl space / mmc supports untagged allocations
2025-03-07 13:37:59 +01:00
Andy Wingo
521cd44ebd
Add gc_allocation_kind argument to gc_allocate
...
Adapt all users. Will eventually allow for mmc to have untagged
allocations.
2025-03-07 13:37:59 +01:00
Andy Wingo
5bddd522cf
Rework large_object_space_alloc to also map if needed
...
Also fix a bug in which objects reclaimed from freelists were not
zeroed.
2025-03-07 13:37:59 +01:00
Andy Wingo
461efa98a0
Wire up tracepoints for event-listener interface
2025-02-10 13:41:19 +01:00
Andy Wingo
2c72034a1c
Fix bug in mmc for new lospace locking discipline
2025-01-23 15:19:09 +01:00
Andy Wingo
7a9de35aaa
lospace: Rely on object_map to be immutable during collection
...
This avoids having multiple threads serialize through a mutex. We still
have to allow for mutation on object_tree and remembered_edges, though.
2025-01-23 15:06:44 +01:00
Andy Wingo
685c63ab3a
Trim remembered-set during minor GC
...
When visiting remembered-set roots, if the target is no longer in
newspace, forget the edge.
2025-01-15 22:31:48 +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
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
745a5ab558
Don't clear remembered set in non-generational mode
2024-10-04 13:50:57 +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
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
8e1574491a
Fix ephemerons test for mmc
...
Change to avoid detecting OOM based on no allocation since last GC, if
the collection was explicitly triggered by the user.
2024-10-01 13:16:43 +02:00
Andy Wingo
1f4e3bdf37
Add field-logging write barrier (fast path only)
...
Add a new kind of write barrier, one which has a bit per field; the
mutator that sets the bit will need to add the field's location (the
edge) to a remembered set. Here we just have the fast-path
implementation.
2024-10-01 10:34:27 +02:00
Andy Wingo
326e925f4c
Fix an ABA problem in the nofl space
...
We use Treiber stacks to represent sets of blocks: blocks to sweep, full
blocks, and so on. This is fine as long as we are only adding to or
only removing from those sets, but as soon as we have concurrent add and
remove, we need to avoid the ABA problem.
Concurrent add and remove occurs for partly-full blocks, which are both
acquired and released by mutators; empty blocks, which can be added to
by heap growth at the same time as the mutator acquires them; and the
paged-out queue, which is also concurrent with heap growth/shrinkage.
2024-09-30 10:59:47 +02:00
Andy Wingo
8fba0e5322
Implement cooperative safepoint API
...
Fixes https://github.com/wingo/whippet/issues/9 .
2024-09-18 11:54:36 +02:00
Andy Wingo
9f26dbb1fc
Implement per-object pinning API
...
Fixes https://github.com/wingo/whippet/issues/6 .
2024-09-18 10:55:02 +02:00
Andy Wingo
a722b9c13f
Force major GC before signalling OOM
2024-09-16 15:46:49 +02:00
Andy Wingo
b7306950bc
Implement adaptive heap sizing for semi
2024-09-16 14:19:54 +02:00
Andy Wingo
1bf250f62a
Heap growth can compete with lospace for nofl blocks
2024-09-16 13:40:09 +02:00
Andy Wingo
7984f60eae
MMC and PCC defer actual page-out operations to background thread
...
Should avoid excessive VM traffic when allocating large objects, or when
the adaptive heap sizer is on and we see frequent expansions and
resizes.
2024-09-16 10:00:01 +02:00
Andy Wingo
d785f082b1
Factor out adapative heap sizer background thread to own file
...
This will let us piggy-back on the thread to asynchronously release
memory to the OS.
2024-09-16 10:00:01 +02:00
Andy Wingo
2818958c59
First version of adaptive heap sizing for pcc and mcc
2024-09-16 09:59:55 +02:00
Andy Wingo
6545b34073
Reorder events in event listener; refactors to mmc and pcc
...
In GC, request mutators to stop before doing anything else; changes the
order of the event listener interface. Also, refactor mmc to look more
like pcc.
2024-09-10 10:55:38 +02:00
Andy Wingo
9f437485ec
MMC marks roots in parallel during the pause, not while stopping
...
Following the analysis in
https://wingolog.org/archives/2024/09/06/on-taking-advantage-of-ragged-stops ,
we simplify MMC by traversing roots only during the pause. This lets us
use gc_tracer parallel root-tracing.
2024-09-09 15:03:49 +02:00
Andy Wingo
8604ad6beb
mmc reformatting
2024-09-08 09:54:16 +02:00
Andy Wingo
44a7240e16
Rename "whippet" collector to "mmc": mostly marking collector
2024-09-02 13:19:05 +02:00