1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-27 21:40:34 +02:00
Commit graph

21772 commits

Author SHA1 Message Date
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
Rob Browning
1c96e4ab6d Ensure tests have guile-procedures.txt
The tests depend on libguile/guile-procedures.txt, for example via
documented? in bit-operations.test.  Previously "make check -j..." in a
clean tree would fail because libguile/guile-procedures.txt is built by
./Makefile.am (rather than libguile/Makefile.am) so that it will have a
built module/ available, but when "." is not listed in SUBDIRS, it
builds last, and so the test-suite runs before guile-procedures.txt is
built.

To fix the problem add "." to SUBDIRS before the test-suite so that the
tests will be able depend on everything else, and move the existing
guile-procedures.txt target into libguile/ next to its
guile-procedures.texi dependency.  That gives a better overview and
simplifies the recipe a bit.  It also allows us to drop the explict
"all-local:" dependency, and to let the existing libguile/ code handle
the cleanup.

* Makefile.am (SUBDIRS): add . just before the test-suite.
(libguile/guile-procedures.txt): rely on libguile/Makefile.am.
(CLEANFILES): Drop libguile/procedures.txt.
* libguile/Makefile.am: (all-local): drop.
(libguile/guile-procedures.txt): move Makefile.am recipe here.
2024-09-27 19:51:00 -05:00
Ludovic Courtès
e134a1a6b1
Update NEWS. 2024-09-27 22:50:52 +02:00
Andy Wingo
aff9ac9688 Run sigbits fixpoint based on use/def graph, not cfg
* module/language/cps/specialize-numbers.scm (sigbits-ref): New helper.
(invert-graph*): New helper.
(compute-significant-bits): When visiting a term changes computed
needed-bits for one of its definitions, we need to revisit the variables
that contributed to its result (the uses), because they might need more
bits as well.  Previously we were doing this by enqueueing predecessors
to the term, which worked if the uses were defined in predecessors, or
if all defining terms were already in the worklist, which is the case
without loops.  But with loops, when revisiting a term, you could see
that it causes sigbits to change, enqueue its predecessors, but then the
predecessors don't change anything and the fixpoint stops before
reaching the definitions of the variables we need.  So instead we
compute the use-def graph and enqueue defs directly.
2024-09-26 11:14:52 +02:00
Andy Wingo
30c3849092 Tighten up range inference for scm->u64/truncate
* module/language/cps/types.scm (scm->u64/truncate): Better range
analysis.
2024-09-25 17:27:17 +02:00
Andy Wingo
e45b70dcde Fix boxing of non-fixnum negative u64 values
* module/language/cps/specialize-numbers.scm (u64->fixnum/truncate): New
helper.
(specialize-operations): Fix specialized boxing of u64 values to
truncate possibly-negative values, to avoid confusing CSE.  Fixes
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71891.
2024-09-25 17:24:51 +02:00
Andy Wingo
0dab58fc2a Fix fixpoint needed-bits computation in specialize-numbers
* module/language/cps/specialize-numbers.scm (next-power-of-two): Use
integer-length.  No change.
(compute-significant-bits): Fix the fixpoint computation, which was
failing to complete in some cases with loops.
2024-09-25 17:23:06 +02:00
Andy Wingo
b04071cc57 Partially revert d579848cb5
* module/language/cps/specialize-numbers.scm (specialize-operations):
Accept any operand to logand/immediate, provided the result is a u64 in
the right range.
2024-09-24 09:24:15 +02:00
Andy Wingo
5e6288c930 Narrow parameter of logand/immediate if no bits used
* module/language/cps/specialize-numbers.scm (specialize-operations):
Narrow ulogand/immediate param according to used bits.
2024-09-23 16:00:54 +02:00
Andy Wingo
d6af34c0e0 Remove needless constraints in type/range analysis
* module/language/cps/types.scm
(ulogand, ulogand/immediate, ulogsub, ulogior, ulogxor): Where we have
u64 inputs, there's no need to `restrict!`; the range will come from the
definition.
2024-09-23 15:32:45 +02:00
Andy Wingo
90e1205018 Add a workaround for pre-3.0.10 incorrect inlinable exports
* module/language/tree-il/peval.scm (peval)
(inlinable-kwargs-bug-fixup): Before 3.0.10, the inlinable exports pass
was incorrectly serializing functions with keyword arguments.  This was
fixed in 2c645571b3, but that meant that
3.0.10 compiling against 3.0.9 binaries could raise an exception at
compile-time; whoops.  Add a workaround so that 3.0.9 binaries still
work.

Fixes https://issues.guix.gnu.org/72936.
2024-09-23 14:07:53 +02:00
Andy Wingo
a411599d87 Update README.md 2024-09-18 11:56:54 +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
2b59efd9fc Fix semi-space with fixed-sized heaps 2024-09-16 15:06:50 +02:00
Andy Wingo
506b4187fc Update manual 2024-09-16 14:33:30 +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
317039d952 Relax assertion when expanding the heap
It could be that newly mapped blocks were already acquired by other threads.
2024-09-16 13:07:25 +02:00
Andy Wingo
dcfdc547f6 Whoops, fix refactor-induced locking problem 2024-09-16 11:45:01 +02:00
Andy Wingo
cf570d0206 Don't release shared worklist buffers when less than 256 kB
Fixes https://github.com/wingo/whippet/issues/8.
2024-09-16 10:51:07 +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
d19366bea2 Remove mention of concurrent marking for mmc 2024-09-10 11:35:28 +02:00
Andy Wingo
48085393f3 Update some doc links 2024-09-10 11:31:55 +02:00
Andy Wingo
4cdb47de6a There are four lights 2024-09-10 11:28:15 +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
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
2915b052e4 Whoops, typo on mmc docs 2024-09-02 14:20:52 +02:00
Andy Wingo
519949edf3 Update .gitignore 2024-09-02 13:24:38 +02:00
Andy Wingo
44a7240e16 Rename "whippet" collector to "mmc": mostly marking collector 2024-09-02 13:19:05 +02:00
Andy Wingo
cf129f10de nofl: Block marks are bytes
There was no need to use a bitvector, and the marks were only being
partially cleared.  More straightforward (and still low overhead) as
bytes.
2024-08-30 21:20:34 +02:00
Andy Wingo
8d6db735fd Nofl space can have discontiguous slabs 2024-08-30 16:53:20 +02:00
Andy Wingo
1a7d08baac Add separate extents header
Will be useful to let slab heaps grow.
2024-08-30 16:53:20 +02:00
Andy Wingo
c949e4e4a9 Refactor representation of blocks in nofl space 2024-08-30 16:53:20 +02:00
Andy Wingo
a970ed5bd5 Update psyntax copyright notice
* module/ice-9/psyntax.scm: Use the newer LGPLv3 header.  Add FSF
copyright lines for each year the file was modified.  Remove inline
changelogs.  Remove some comments describing psyntax in other Scheme
implementations.
2024-08-26 09:51:53 +02:00
Andy Wingo
a180be0cbd
Merge pull request #4 from Z572/fix-doc
fix guile.md link
2024-08-26 09:23:40 +02:00
Andy Wingo
59b85abbda Fix regarding memset of block marks 2024-08-25 20:46:05 +02:00
Andy Wingo
59c9f5dff9 Mark blocks that are targets of evacuation 2024-08-25 08:58:55 +02:00
Andy Wingo
7b4a56c51a nofl: Fix sticky mark bit treatment for block marks 2024-08-25 08:45:17 +02:00
Andy Wingo
b8c0fa0e90 nofl: simplify sweeping
No more need to identify empties during sweeping, as that is done
eagerly during the pause.
2024-08-24 21:52:47 +02:00
Andy Wingo
6dcec272b1 nofl: eagerly sweep empty blocks 2024-08-24 21:31:07 +02:00
Andy Wingo
010185f729 nofl: Refactor to trace visitor 2024-08-24 16:38:11 +02:00
Andy Wingo
7db72e7f80 whippet: ensure mutators release allocators before start_gc 2024-08-24 09:09:23 +02:00
Andy Wingo
19fdd481d5 Fix some corner cases with hole zeroing of empty blocks 2024-08-23 21:20:40 +02:00
Andy Wingo
d137e1397c Instead of partitioning blocks by flag, put them in separate lists
This way you can directly iterate blocks of a certain kind.  Also verify
these lists more thoroughly, and allow full blocks that are the results
of evacuation to skip being swept the next round.  Also!  Have
next_hole_in_block / next_hole_in_block ensure that the object data and
the mark bytes are clear.
2024-08-22 21:47:15 +02:00