Releases: mmtk/mmtk-core
Releases · mmtk/mmtk-core
MMTk 0.21.0
0.21.0 (2023-11-03)
What's Changed
Plan
- Move some states from BasePlan to GlobalState by @qinsoon in #949
- Extract set_collection_kind and set_gc_status by @qinsoon in #957
- Expose
is_emergency_collection
to VM bindings by @wks in #997
Policy
- Clear all side forwarding bits by @wks in #974
- Stop using the name "ForwardingWord" by @wks in #976
- Implement get_gc_trigger() for LockFreeImmortalSpace by @qinsoon in #1003
API
- Expose alloc_slow. Add a section in user guide about allocation optimization by @qinsoon in #967
- Use BumpPointer::default() by @qinsoon in #993
- Fix mention of
to_object_reference()
in comment by @k-sareen in #998
Documentation
- Fix rustdoc warnings in Rust 1.73 by @qinsoon in #978
- Add a section about debugging tips in user guide by @qinsoon in #987
- Update doc comments by @wks in #1000
- Add document for release by @qinsoon in #1007
- Move constants and add comments for stress copying by @wks in #1008
- Update bibtex of the tracing paper to include the DOI by @caizixian in #1009
CI
- Fix performance baseline workflow by @qinsoon in #971
- Allow auto merge binding PRs by @qinsoon in #988
- Apply a delay before we enable auto merge on a PR by @qinsoon in #992
- Use
cargo generate-lockfile
to update JikesRVM's Cargo.lock by @qinsoon in #996
Misc
Full Changelog: v0.20.0...v0.21.0
MMTk 0.20.0
What's Changed
Plan
- Refactor derive macros and add HasSpaces trait by @wks in #934
- Make MarkCompact LOS support 2nd transitive closure by @wenyuzhao in #944
- Disabling PrepareMutator from PlanConstraints by @wks in #964
Policy
- Add ExternalPageResource and allow discontiguous VM space by @qinsoon in #864
- Discontiguous mark compact space support by @wenyuzhao in #939
- Discontiguous PageProtect GC support by @wenyuzhao in #946
- Fix vo-bit reset for discontiguous space by @wenyuzhao in #948
API
- Boot-time configurable heap constants by @wenyuzhao in #899
- This PR enables transitively pinning (TP) objects from particular roots for Immix/StickyImmix by @udesou in #897
- Let VM control when or if to read env var options by @wks in #955
Misc
- Update doc comment of Scanning::process_weak_refs by @wks in #919
- Binding test for Ruby by @wks in #916
- Fix api-check CI by @wks in #923
- Fix default value for RUBY_BINDING_REPO by @qinsoon in #926
- Add a ready-to-merge check by @qinsoon in #910
- Run ready to merge check for PRs by @qinsoon in #928
- Remove cast ref to mut everywhere by @playXE in #893
- Benchmark Rust code by @qinsoon in #933
- Fix broken links in the tutorial by @caizixian in #936
- Update doc to add a section for LTO by @qinsoon in #937
- Add CARGO_INCREMENTAL=0 to work around clippy 1.72 bug by @qinsoon in #938
- Fix issues for cargo fmt in 1.72 by @qinsoon in #940
- Use atomic operations for SFT map and remove unsafe code by @qinsoon in #931
- Fix outdated Rust version in README by @qinsoon in #942
- Fix length of Map64::descriptor_map by @wks in #956
Full Changelog: v0.19.0...v0.20.0
MMTk 0.19.0
0.19.0 (2023-08-18)
What's Changed
Plan
- Remove a warning in sticky immix trace_object_nursery by @qinsoon in #815
- Change default plan to GenImmix by @qinsoon in #819
Policy
- Remove redundant clear_nursery() by @tianleq in #799
- Introduce VMSpace, and allow VMSpace to be set lazily by @qinsoon in #802
- Fix an issue that the aligned VM space may not match the original location by @qinsoon in #809
- Remove some uses of mem::transmute in marksweep block by @qinsoon in #826
- Fix
is_live
for ImmixSpace by @wks in #842 - Sweep abandoned blocks in eager sweeping by @qinsoon in #830
- Fix VO bits for Immix by @wks in #849
- Fix unaligned access by @wks in #887
Scheduler
Misc
- Rename "alloc bit" to "valid-object bit" (VO bit), the second attempt. by @wks in #791
- Add MarkState. Use MarkState for ImmortalSpace. by @qinsoon in #796
- Change info logging to debug in ImmortalSpace by @qinsoon in #801
- Reset nursery_index in finalizable processor if we remove objects from candidates by @qinsoon in #807
- Allow bulk set side metadata by @qinsoon in #808
- Some fixes for sanity GC by @qinsoon in #806
- Use extreme assertion for metadata mapped assert by @wks in #812
- Install the missing deps for i686 CI tests by @qinsoon in #816
- Use min nursery as mem balancer's extra memory by @qinsoon in #820
- Sort dependencies in alphabetical order by @k-sareen in #822
- Use sysinfo instead of sys-info-rs by @k-sareen in #827
- Let sysinfo only load memory-related info by @wks in #836
- Add extreme assertion for barrier slow path calls by @ArberSephirotheca in #833
- Refactor: Use
Atomic<Address>
where appropriate by @ClSlaid in #843 - Update porting guide by @k-sareen in #857
- Fix typo in doc comment by @k-sareen in #859
- Replace debug_assert in side_after with assert by @qinsoon in #873
- Work around stack overflow in array_from_fn by @wks in #876
- Let ObjectReference implement Ord by @wks in #870
- Add USDT tracepoints for key GC activities by @caizixian in #883
- Fix UB in SFTMap implementations by @playXE in #879
- Run CI build/unit test with latest stable Rust toolchain by @qinsoon in #885
- Document MSRV policy by @wks in #881
- Fix performance regression test scripts by @qinsoon in #892
- Run V8 binding tests on GitHub hosted runner by @caizixian in #900
- Add tracing tools and documentation by @caizixian in #898
- Run benchmarks for more plans on OpenJDK by @qinsoon in #901
- Apply style check on auxiliary crates (macros and dummyvm) by @caizixian in #913
- Call Collection::out_of_memory if the allocation size is larger than max heap size by @qinsoon in #896
- Add a unit test for comma-separated bulk option parsing by @caizixian in #911
- Merge tutorial and porting guide into user guide by @qinsoon in #907
- Fix broken links in README and cargo doc warnings by @caizixian in #912
API
- Add object() in MemorySlice by @qinsoon in #798
- Remove Collection::COORDINATOR_ONLY_STW by @ArberSephirotheca in #814
- Refactor: Change
ActivePlan::mutators()
's return type by @ArberSephirotheca in #817 - Replace alloc-related
offset
type tousize
insteadisize
by @fepicture in #838 - Rename ambiguous
scan_thread_root{,s}
functions by @k-sareen in #846 - Update comments on bind_mutator by @qinsoon in #854
- Counting VM-allocated pages into heap size. by @wks in #866
- Expose Allocators type to public API by @playXE in #880
- Collect live bytes during GC by @qinsoon in #768
- Tidy up mutator scan API by @qinsoon in #875
- Implement transparent hugepage support by @caizixian in #905
- Implement AllocatorInfo by @playXE in #889
- Add comma as an alternative options string separator by @wenyuzhao in #909
New Contributors
- @ArberSephirotheca made their first contribution in #814
- @fepicture made their first contribution in #838
- @ClSlaid made their first contribution in #843
- @playXE made their first contribution in #880
Full Changelog: v0.18.0...v0.19.0
MMTk 0.18.0
0.18.0 (2023-04-03)
Plan
- Add a new plan,
StickyImmix
. This is an variant of immix using a sticky mark bit. This plan allows generational behaviors without using a compulsory copying nursery. - Side log bits in generational plans are now set using relaxed store for the entire byte as an optimization.
Policy
- Add constants
STRESS_DEFRAG
andDEFRAG_EVERY_BLOCK
to allow immix to stress defrag copying for debugging.
API
- Add a new write barrier method
object_probable_write
. The method can be called before the fields of an object may get updated without a normal write barrier. - Add a feature
immix_non_moving
to replace the currentimmix_no_defrag
feature. This is only intended for debugging uses to rule out issues from copying.
Misc
- Refactor
Mmapper
andVMMap
. Their implementation is now chosen dynamically, rather than statically based on the pointer size of the architecture. This allows
us to use a more appropriate implementation to support compressed pointers. - Revert changes in d341506 about forwarding bits, and bulk zero side forward bits for defrag source blocks.
- Fix a bug in the scheduler where a worker may spuriously wake up and attempt to open new buckets while the coordinator is executing a coordinator work packet,
which would result in an assertion failure. - Fix a bug in the mem balancer where subtraction may silently overflow and cause unexpected statistics to be used for computing new heap sizes.
- Fix a bug where
ScanObjectsWork
does not properly set the worker when it internally usesProcessEdgesWork
. - Fix a bug where nodes pushed during root scanning were not cached for sanity GC.
- Fix a bug where
harness_begin
does not force a full heap GC for generational plans. - Add info-level logging for each GC to show the memory usage before and after the GC, and elapsed time for the GC.
MMTk 0.17.0
Plan
- Fix a bug where
SemiSpace::get_available_pages
returned unused pages as 'available pages'. It should return half of the unused pages as 'available'. - Fix a bug where generational plans may make full-heap GC decision before all the releasing work is done. Now plans have a
Plan::end_of_gc()
method
that is executed after all the GC work is done. - Fix a bug where generational plans tended to trigger full heap GCs when heap is full. Now we properly use Appel-style nursery and allow
the nursery to extend to the heap size. - Add a feature
immix_zero_on_release
as a debug feature for Immix to eagerly zero any reclaimed memory. - Fix a bug where the alloc bits for dead objects were still set after the objects were reclaimed. Now Immix eagerly clears the alloc bits
once the memory is reclaimed. - Fix a bug where Immix uses forwarding bits and forwarding pointers but did not declare it.
Allocator
- Fix a bug about the maximum object size in
FreeListAllocator
. The allowed maximum object size depends on both the block size and the largest bin size.
Scheduler
- Add a 'sentinel' mechanism to execute a specified 'sentinel' work packet when a bucket is drained, and prevent the GC from entering the next stage depending
on the sentinel packet. This makes it possible to expand the transitive closure multiple times. It replacesGCWorkScheduler::closure_end()
.
API
- Add a new set of APIs to support binding-specific weak reference processing:
- Add
Scanning::process_weak_refs()
andScanning::forward_weak_refs()
. They both supply anObjectTracerContext
argument for retaining and
updating weak references.Scanning::process_weak_refs()
allows a boolean return value to indicate if the method should be called again
by MMTk after finishing transitive closures for the weak references, which can be used to implement ephemeron. - Add
Collection::post_forwarding()
which is called by MMTk after all weak reference related work is done. A binding can use this call
for any post processing for weak references, such as enqueue cleared weak references to a queue (Java). - These replace old methods for the same purpose, like
Collection::process_weak_refs()
,Collection::vm_release()
, andmemory_manager::on_closure_end
.
- Add
Misc
- Upgrade the Rust toolchain we use to 1.66.1 and upgrade MSRV to 1.61.0.
- Improve the boot time significantly for MMTk:
- Space descriptor map is created as an zeroed vector.
- Mmapper coalesces the mmap requests for adjancent chunks, and reduces our
mmap
system calls at boot time.
- Add
GCTrigger
to allow different heuristics to trigger a GC:- Implement
FixedHeapSizeTrigger
that triggers the GC when the maximum heap size is reached (the current approach). - Implement
MemBalancerTrigger
(https://dl.acm.org/doi/pdf/10.1145/3563323) as the dynamic heap resize heuristic.
- Implement
- Refactor
SFTMap
so it is dynamically created now. - Fix a bug where
Address::store
dropped the value after store. - Fix a bug about an incorrect pointer cast in unsafe code in
CommonFreeListPageResource
. - Remove all inline directives from our code base. We rely on Rust compiler and PGO for inlining decisions.
- Remove
SynchronizedCounter
.
MMTk 0.16.0
GC Plans
- Refactor
MarkSweep
to work with both our native mark sweep policy and the malloc mark sweep policy backed by malloc libraries.
Allocators
- Add
FreeListAllocator
which is implemented as aMiMalloc
allocator. - Fix a bug in
ImmixAllocator
that alignment is properly taken into consideration when deciding whether to do overflow allocation.
Policies
- Add
MarkSweepSpace
:- It uses our native MiMalloc implementation in MMTk core.
- When the feature
malloc_mark_sweep
is enabled, it uses the selected malloc library to back up its allocation.
- Malloc mark sweep now accounts for memory based on page usage, and each malloc library may use a different page size.
- The immix space now uses the newly added
BlockPageResource
. - Changes to Space Function Table (SFT) to improve our boot time and reduce the memory footprint:
- Rename the current SFT map to
SFTSparseChunkMap
, and only use it for 32 bits architectures. - Add
SFTSpaceMap
and by default use it for 64 bits architectures. - Add
SFTDenseChunkMap
and use it when we have no control of the virtual address range for a MMTk space on 64 bits architectures.
- Rename the current SFT map to
API
- Add an option
thread_affinity
to set processor affinity for MMTk GC threads. - Add
AllocationSemantics::NonMoving
to allocate objects that are known to be non-moving at allocation time. - Add
ReferenceGlue::is_referent_cleared
to allow some bindings to use a special value rather than a normal null reference for a cleared referent. - Add
pin
,unpin
, andis_pinned
for object pinning. Note that some spaces do not support object pinning, and using these methods may
cause panic if the space does not support object pinning. - Refactor
ObjectReference
:- MMTk core now pervasively uses
ObjectModel::ref_to_address
to get an address from an object reference for setting per-object side metadata. - Add
ObjectModel::address_to_ref
that does the opposite ofref_to_address
: getting an object reference from an address that is returned byref_to_address
. - Add
ObjectModel::ref_to_header
for the binding to tell us the base header address from an object reference. - Rename
ObjectModel::object_start_ref
toObjectModel::ref_to_object_start
(to be consistent with other methods). - Remove
ObjectModel::OBJECT_REF_OFFSET_BEYOND_CELL
, as we no longer use the raw address of an object reference. - Add
ObjectModel::UNIFIED_OBJECT_REFERENCE_ADDRESS
. If a binding uses the same address forObjectReference
,ref_to_address
andref_to_object_start
,
they should set this totrue
. MMTk can utilize this information for optimization. - Add
ObjectModel::OBJECT_REF_OFFSET_LOWER_BOUND
to specify the minimam value of the possible offsets between an allocation result and object reference's raw address.
- MMTk core now pervasively uses
destroy_mutator()
no longer requires a boxed mutator as its argument. Instead, a mutable reference to the mutator is required. It is made clear that the binding should
manage the lifetime of the boxed mutator from abind_mutator()
call.- Remove
VMBinding::LOG_MIN_ALIGNMENT
andVMBinding::MAX_ALIGNMENT_SHIFT
(so we only keepVMBinding::MIN_ALIGNMENT
andVMBinding::MAX_ALIGNMENT
).
Misc
- Add a lock-free
BlockPageResource
that can be used for policies that always allocate memory at the granularity of a fixed sized block.
This page resource facilitates block allocation and reclamation, and uses lock-free operations where possible. - Fix a race condition in
FreeListPageResource
when multiple threads release pages. - Fix a bug in
fetch_and/or
in our metadata implementation. - Fix a bug in side metadata bulk zeroing that may zero unrelated bits if the zeroed region cannot be mapped to whole metadata bytes.
- Remove unused
meta_data_pages_per_region
in page resource implementations. - Remove the use of
MaybeUninit::uninit().assume_init()
inFreeListPageResource
which has undefined behaviors
and causes the illegal instruction error with newer Rust toolchains. - Remove the trait bound
From<Address>
andInto<Address>
forRegion
, as we cannot guarantee safe conversion between those two types. - Extract
Chunk
andChunkMap
from the immix policy, and make it available for all the policies.
MMTk 0.15.0
GC Plans
- Generational plans now support bounded nursery size and fixed nursery size.
- Immix can be used in a non-moving variant (with no defragmentation) to facilitate early porting stages
where a non-moving GC is expected by the VM. Enable the featureimmix_no_defrag
to use the variant.
Note that this variant performs poorly, compared to normal immix.
API
- Add
mod build_info
for bindings to get information about the current build. - Add
trait Edge
. A binding can implement its own edge type if they need more sophisiticated edges than a simple address slot,
e.g. to support compressed pointers, base pointers with offsets, or tagged pointers. - Add APIs for implementing write barriers. MMTk provides subusming barriers
object_reference_write()
and pre/post write barriersobject_reference_write_pre/post()
. - Add APIs for implementing barriers for memory copying such as
array_copy
in Java. MMTk providesmemory_region_copy()
(subsuming) andmemory_region_copy_pre/post()
. - The
ignore_system_g_c
option is renamed toignore_system_gc
to be consistent with our naming convention. - The
max/min_nursery
option is replaced bynursery
. Bindings can usenursery=Fixed:<size>
orBounded:<size>
to config the nursery size. - Metadata access methods now requires a type parameter for the metadata value.
- Metadata compare-exchange methods now return a
Result
rather than a boolean, which is more consistent with Rust atomic types. - Metadata now supports
fetch_and
,fetch_or
andfetch_update
. - Header metadata access methods in
ObjectModel
now have default implementations.
Misc
- Remove all stdout printing in MMTk.
- Fix a bug that
CopySpace
should not try zeroing alloc bit if there is no allocation in the space. - Fix a few issues in documentation.
MMTk 0.14.0
API
ProcessEdgesWork
is no longer exposed in theScanning
trait. Instead,RootsWorkFactory
is introduced
for the bindings to create more work packets.Collection::stop_all_mutators()
now provides a callbackmutator_visitor
. The implementation is required
to callmutator_visitor
for each mutator once it is stopped. This requirement was implicit prior to this change.- Now MMTk creation is done in the builder pattern:
MMTKBuilder
is introduced. Command line argument processing API (process()
andprocess_bulk()
) now
takes&MMTKBuilder
as an argument instead of&MMTK
.gc_init()
is renamed tommtk_init()
.mmtk_init()
now takes&MMTKBuilder
as an argument,
and returns an MMTk instanceBox<MMTK>
.heap_size
(which used to be an argument forgc_init()
) is now an MMTk option.- All the options now can be set through the command line argument processing API.
- Node enqueuing is supported:
- Add
Scanning::support_edge_enqueuing()
. A binding may returnfalse
if they cannot do edge scanning for certain objects. - For objects that cannot be enqueued as edges,
Scanning::scan_object_and_trace_edges()
will be called.
- Add
Scheduler
- Fixed a bug that may cause deadlock when GC workers are parked and the coordinator is still executing work.
Misc
Plan::gc_init()
andSpace::init()
are removed. Initialization is now properly done in the respective constructors.
MMTk 0.13.0
Allocators
- Fixed a bug that in GC stress testing, the allocator slowpath may double count the allocated bytes.
- Fixed a bug that in GC stress testing, the Immix allocator may miss the updates to the allocated bytes in some cases.
Scheduler
- Added work stealing mechanisms to the scheduler: a GC worker may steal work packets from other workers.
- Fixed a bug that work buckets may be incorrectly opened when there is still work left in workers' local bucket.
API
- Added an associate type
Finalizable
toReferenceGlue
, with which, a binding can define their own finalizer type. - Added a set of malloc APIs that allows a binding to do malloc using MMTk.
- Added
vm_trace_object()
toActivePlan
. When tracing an object that is not in any of MMTk spaces, MMTk will call this method
and allow bindings to handle the object.
Misc
trait TransitiveClosure
is split into two different traits:EdgeVisitor
andObjectQueue
, andTransitiveClosure
is now removed.- Fixed a bug that the work packet statistics were not collected correctly if different work packets used the same display name.
- Fixed a bug that the work packet statistics and the phase statistics use different time units. Now they both use milliseconds.
- Fixed a bug that
acquire_lock
was used to lock a larger scope than what was necessary, which caused bad performance when we have many
allocation threads (e.g. more than 24 threads).
MMTk 0.12.0
GC Plans
- Introduced
trait PlanTraceObject
and procedural macros to derive implementation for it for all the current plans. - Introduced a work packet type
PlanProcessEdges
that usesPlanTraceObject
. All the current plans use this type for tracing objects.
Policy
- Introduced
trait PolicyTraceObject
. Added an implementation for each policy.
API
- Preliminary support for Java-style weak reference is added (set the option
no_reference_types=false
to enable it). Related APIs are slightly changed. - The type parameter
TransitiveClosure
inScanning::scan_object()/scan_objects()
is now replaced withvm::EdgeVisitor
. - Minor changes to
Scanning::scan_object()/scan_objects()
so they are more consistent.
Misc
- Fixed a bug in object forwarding: an object can leave the being-forwarded state without actually being forwarded, and this
now won't cause a panic.