1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-06 04:00:26 +02:00
Commit graph

71 commits

Author SHA1 Message Date
Andy Wingo
41de2dfd91 Update conservative roots embedder interface 2025-05-21 14:27:17 +02:00
Andy Wingo
0277953efc gc_extern_space_visit doesn't take an edge
The whole extern space interface is a bit wonky but for now let's assume
that external objects can't move and therefore we don't need the edge.
2025-05-21 14:04:24 +02:00
Andy Wingo
8b9fe196a1 No need to clear allocation table during allocation
The mmc clears holes eagerly; there is no need to memset during
allocation.
2025-05-21 14:01:42 +02:00
Andy Wingo
9512c8b806 Simplify mmc-attrs.h 2025-05-16 21:59:27 +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
c9063b8027 bdw: Disable thread-local freelists for pointerless allocations
There was a race between GC and popping the head off freelists.  We
could have separate freelists for tagged and untagged normal allocations
though.
2025-04-23 17:28:46 +02:00
Andy Wingo
06b53470f4 For freelist allocators, clear the freelist link on the returned obj
* api/gc-api.h (gc_allocate_small_fast_freelist):
* src/bdw.c (allocate_small): Clear freelist link, so the object is
completely zeroed.  In some cases the embedder / compiler / JIT will be
able to elide this write.
2025-04-23 16:44:59 +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
2dab407ec1 Expose definition of gc_stack_addr, rework API 2025-04-18 15:08:01 +02:00
Andy Wingo
d3df1a632a Record last live data size in basic stats. 2025-04-17 12:29:30 +02:00
Andy Wingo
75700ec3ed More build system reworking 2025-04-16 12:40:44 +02:00
Andy Wingo
05e8aba462 Add gc_allocation_counter API 2025-03-14 09:44:18 +01:00
Andy Wingo
0cff6ffba4 Basic stats also record CPU time 2025-03-13 13:44:02 +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
6c444b33f1 Remove card-marking barriers
Field barriers aren't slower and are more precise.
2025-03-07 13:37:59 +01:00
Andy Wingo
4a95a514b7 Fix inline old-generation check for nofl space mark byte changes 2025-03-07 13:37:59 +01:00
Andy Wingo
f1b660484e Remove gc_allocator_needs_clear
Whether the returned object needs to be cleared or not depends on a
couple things:
 - Whether the embedder actually needs the object to be cleared.
 - Whether the collector allocated the object from memory that was all
   zeroes already.

The goal of course would be to prevent clearing memory if the mutator
was just going to write all over it.  But it's hard to know statically
if the memory would have been all zeroes anyway, and in that case if you
did clear it you'd be doing double work.  In the end it's simpler to
just require collectors to clear memory in bulk.  We can revisit this
later if it is an issue.
2025-03-07 13:37:59 +01:00
Andy Wingo
ed5db9bc36 nofl: Reclaim another mark bit if concurrent tracing is disabled 2025-03-05 17:17:55 +01:00
Andy Wingo
81da950ebe Steal becomes an instant event 2025-02-12 14:33:05 +01:00
Andy Wingo
d675a9b8f1 Add tracepoints to tracer itself
Also fix an issue whereby the main thread would spin, waiting for other
active threads to finish, doing no work itself.
2025-02-11 16:14:27 +01:00
Andy Wingo
cca54736a0 Add build support for tracepoints via lttng-ust 2025-02-10 12:45:25 +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
65b74b5abb Add generational support to pcc 2025-01-10 16:40:14 +01:00
Andy Wingo
e4048b5296 Add offset to field-logging fast path 2025-01-10 16:05:34 +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
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
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
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
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
cc04761271 gc_object_set_remembered returns nonzero on success 2024-10-01 14:36:55 +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
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
2818958c59 First version of adaptive heap sizing for pcc and mcc 2024-09-16 09:59:55 +02:00
Andy Wingo
1ff082705e Remove scc
PCC with GC_PARALLEL=0 is exactly equivalent to SCC.  Also now that PCC
will dynamically avoid atomic forwarding if parallelism is disabled at
run-time, there is no need to keep SCC around.
2024-09-10 11:10:47 +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
44a7240e16 Rename "whippet" collector to "mmc": mostly marking collector 2024-09-02 13:19:05 +02:00