From 67c5a649713cecf5e171d3ac234a54f7e49a02d7 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 16 Aug 2023 02:21:41 +0000 Subject: [PATCH 01/41] Updating to the latest master in mmtk-julia --- julia/mmtk_julia.c | 125 +++++++++++++++++++++++++++++++++++- mmtk/Cargo.lock | 2 - mmtk/Cargo.toml | 9 +-- mmtk/api/mmtk.h | 5 ++ mmtk/src/api.rs | 24 +++++++ mmtk/src/edges.rs | 28 ++++++++ mmtk/src/julia_finalizer.rs | 13 ++-- mmtk/src/lib.rs | 2 + mmtk/src/object_model.rs | 87 ++++++++++++++++++++++--- mmtk/src/scanning.rs | 42 ++++++++---- 10 files changed, 302 insertions(+), 35 deletions(-) diff --git a/julia/mmtk_julia.c b/julia/mmtk_julia.c index d948bd0d..2bbbfeb8 100644 --- a/julia/mmtk_julia.c +++ b/julia/mmtk_julia.c @@ -247,8 +247,24 @@ static void add_node_to_roots_buffer(RootsWorkClosure* closure, RootsWorkBuffer* } } +static void add_node_to_tpinned_roots_buffer(RootsWorkClosure* closure, RootsWorkBuffer* buf, size_t* buf_len, void* root) { + if (root == NULL) + return; + + buf->ptr[*buf_len] = root; + *buf_len += 1; + if (*buf_len >= buf->cap) { + RootsWorkBuffer new_buf = (closure->report_tpinned_nodes_func)(buf->ptr, *buf_len, buf->cap, closure->data, true); + *buf = new_buf; + *buf_len = 0; + } +} + void scan_vm_specific_roots(RootsWorkClosure* closure) { + + + // Create a new buf RootsWorkBuffer buf = (closure->report_nodes_func)((void**)0, 0, 0, closure->data, true); size_t len = 0; @@ -275,10 +291,16 @@ void scan_vm_specific_roots(RootsWorkClosure* closure) // constants add_node_to_roots_buffer(closure, &buf, &len, jl_emptytuple_type); add_node_to_roots_buffer(closure, &buf, &len, cmpswap_names); - add_node_to_roots_buffer(closure, &buf, &len, jl_global_roots_table); + + + // jl_global_roots_table must be tpinned + RootsWorkBuffer tpinned_buf = (closure->report_tpinned_nodes_func)((void**)0, 0, 0, closure->data, true); + size_t tpinned_len = 0; + add_node_to_tpinned_roots_buffer(closure, &tpinned_buf, &tpinned_len, jl_global_roots_table); // Push the result of the work. (closure->report_nodes_func)(buf.ptr, len, buf.cap, closure->data, false); + (closure->report_tpinned_nodes_func)(tpinned_buf.ptr, tpinned_len, tpinned_buf.cap, closure->data, false); } JL_DLLEXPORT void scan_julia_exc_obj(void* obj_raw, void* closure, ProcessEdgeFn process_edge) { @@ -322,6 +344,105 @@ JL_DLLEXPORT void scan_julia_exc_obj(void* obj_raw, void* closure, ProcessEdgeFn } } +// number of stacks to always keep available per pool - from gc-stacks.c +#define MIN_STACK_MAPPINGS_PER_POOL 5 + +// if data is inlined inside the array object --- to->data needs to be updated when copying the array +void update_inlined_array(void* from, void* to) { + jl_value_t* jl_from = (jl_value_t*) from; + jl_value_t* jl_to = (jl_value_t*) to; + + uintptr_t tag_to = (uintptr_t)jl_typeof(jl_to); + jl_datatype_t *vt = (jl_datatype_t*)tag_to; + + if(vt->name == jl_array_typename) { + jl_array_t *a = (jl_array_t*)jl_from; + jl_array_t *b = (jl_array_t*)jl_to; + if (a->flags.how == 0) { + assert(object_is_managed_by_mmtk(a->data)); + size_t pre_data_bytes = ((size_t)a->data - a->offset*a->elsize) - (size_t)a; + if (pre_data_bytes > 0 && pre_data_bytes <= ARRAY_INLINE_NBYTES) { + b->data = (void*)((size_t) b + pre_data_bytes); + } + } + } +} + +// modified sweep_stack_pools from gc-stacks.c +void mmtk_sweep_stack_pools(void) +{ + // Stack sweeping algorithm: + // // deallocate stacks if we have too many sitting around unused + // for (stk in halfof(free_stacks)) + // free_stack(stk, pool_sz); + // // then sweep the task stacks + // for (t in live_tasks) + // if (!gc-marked(t)) + // stkbuf = t->stkbuf + // bufsz = t->bufsz + // if (stkbuf) + // push(free_stacks[sz], stkbuf) + for (int i = 0; i < jl_n_threads; i++) { + jl_ptls_t ptls2 = jl_all_tls_states[i]; + + // free half of stacks that remain unused since last sweep + for (int p = 0; p < JL_N_STACK_POOLS; p++) { + arraylist_t *al = &ptls2->heap.free_stacks[p]; + size_t n_to_free; + if (al->len > MIN_STACK_MAPPINGS_PER_POOL) { + n_to_free = al->len / 2; + if (n_to_free > (al->len - MIN_STACK_MAPPINGS_PER_POOL)) + n_to_free = al->len - MIN_STACK_MAPPINGS_PER_POOL; + } + else { + n_to_free = 0; + } + for (int n = 0; n < n_to_free; n++) { + void *stk = arraylist_pop(al); + free_stack(stk, pool_sizes[p]); + } + } + + arraylist_t *live_tasks = &ptls2->heap.live_tasks; + size_t n = 0; + size_t ndel = 0; + size_t l = live_tasks->len; + void **lst = live_tasks->items; + if (l == 0) + continue; + while (1) { + jl_task_t *t = (jl_task_t*)lst[n]; + assert(jl_is_task(t)); + if (mmtk_is_live_object(t)) { + if (t->stkbuf == NULL) + ndel++; // jl_release_task_stack called + else + n++; + } else { + ndel++; + void *stkbuf = t->stkbuf; + size_t bufsz = t->bufsz; + if (stkbuf) { + t->stkbuf = NULL; + _jl_free_stack(ptls2, stkbuf, bufsz); + } +#ifdef _COMPILER_TSAN_ENABLED_ + if (t->ctx.tsan_state) { + __tsan_destroy_fiber(t->ctx.tsan_state); + t->ctx.tsan_state = NULL; + } +#endif + } + if (n >= l - ndel) + break; + void *tmp = lst[n]; + lst[n] = lst[n + ndel]; + lst[n + ndel] = tmp; + } + live_tasks->len -= ndel; + } +} + #define jl_array_data_owner_addr(a) (((jl_value_t**)((char*)a + jl_array_data_owner_offset(jl_array_ndims(a))))) JL_DLLEXPORT void* get_stackbase(int16_t tid) { @@ -410,6 +531,7 @@ Julia_Upcalls mmtk_upcalls = (Julia_Upcalls) { .mmtk_jl_run_finalizers = mmtk_jl_run_finalizers, .jl_throw_out_of_memory_error = jl_throw_out_of_memory_error, .sweep_malloced_array = mmtk_sweep_malloced_arrays, + .sweep_stack_pools = mmtk_sweep_stack_pools, .wait_in_a_safepoint = mmtk_wait_in_a_safepoint, .exit_from_safepoint = mmtk_exit_from_safepoint, .jl_hrtime = jl_hrtime, @@ -421,4 +543,5 @@ Julia_Upcalls mmtk_upcalls = (Julia_Upcalls) { .arraylist_grow = (void (*)(void*, long unsigned int))arraylist_grow, .get_jl_gc_have_pending_finalizers = get_jl_gc_have_pending_finalizers, .scan_vm_specific_roots = scan_vm_specific_roots, + .update_inlined_array = update_inlined_array, }; diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 8540cdcd..53897de0 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -474,7 +474,6 @@ dependencies = [ [[package]] name = "mmtk" version = "0.18.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=04a47feb4598b2120598453c2cceec83986c2122#04a47feb4598b2120598453c2cceec83986c2122" dependencies = [ "atomic 0.5.3", "atomic-traits", @@ -522,7 +521,6 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.18.0" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=04a47feb4598b2120598453c2cceec83986c2122#04a47feb4598b2120598453c2cceec83986c2122" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 301f017d..b4a1f718 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -31,9 +31,9 @@ lazy_static = "1.1" # - change branch # - change repo name # But other changes including adding/removing whitespaces in commented lines may break the CI -mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "04a47feb4598b2120598453c2cceec83986c2122" } +# mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "04a47feb4598b2120598453c2cceec83986c2122" } # Uncomment the following to build locally -# mmtk = { path = "../repos/mmtk-core" } +mmtk = { path = "../../mmtk-core" } log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] } enum-map = ">=2.1" atomic = "0.4.6" @@ -43,13 +43,14 @@ thread-id = "*" # ykstackmaps = { git = "https://github.com/udesou/ykstackmaps.git", branch = "udesou-master", version = "*" } [features] -default = ["mmtk/vm_space", "julia_copy_stack"] +default = ["mmtk/vm_space", "julia_copy_stack", "object_pinning"] # Plans nogc = [] -immix = ["non_moving_immix"] +immix = [] stickyimmix = ["non_moving_immix"] marksweep = [] +object_pinning = ["mmtk/object_pinning"] # TODO remove this when we properly support moving non_moving_immix = ["mmtk/immix_non_moving", "mmtk/immix_smaller_block"] diff --git a/mmtk/api/mmtk.h b/mmtk/api/mmtk.h index 3a40d8c3..9e937acc 100644 --- a/mmtk/api/mmtk.h +++ b/mmtk/api/mmtk.h @@ -22,6 +22,7 @@ typedef struct { typedef struct { RootsWorkBuffer (*report_edges_func)(void** buf, size_t size, size_t cap, void* data, bool renew); RootsWorkBuffer (*report_nodes_func)(void** buf, size_t size, size_t cap, void* data, bool renew); + RootsWorkBuffer (*report_tpinned_nodes_func)(void** buf, size_t size, size_t cap, void* data, bool renew); void* data; } RootsWorkClosure; @@ -48,6 +49,8 @@ extern void mmtk_modify_check(void* ref); extern int mmtk_object_is_managed_by_mmtk(void* addr); extern void mmtk_runtime_panic(void); extern void mmtk_unreachable(void); +extern unsigned char mmtk_pin_object(void* obj); +extern bool mmtk_is_pinned(void* obj); extern void mmtk_set_vm_space(void* addr, size_t size); extern void mmtk_immortal_region_post_alloc(void* addr, size_t size); @@ -79,6 +82,7 @@ typedef struct { void (* mmtk_jl_run_finalizers) (void* tls); void (* jl_throw_out_of_memory_error) (void); void (* sweep_malloced_array) (void); + void (* sweep_stack_pools) (void); void (* wait_in_a_safepoint) (void); void (* exit_from_safepoint) (int8_t old_state); uint64_t (* jl_hrtime) (void); @@ -90,6 +94,7 @@ typedef struct { void (*arraylist_grow)(void* a, size_t n); int* (*get_jl_gc_have_pending_finalizers)(void); void (*scan_vm_specific_roots)(RootsWorkClosure* closure); + void (*update_inlined_array) (void* from, void* to); } Julia_Upcalls; /** diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 750823a0..14e69521 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -516,3 +516,27 @@ pub extern "C" fn mmtk_get_obj_size(obj: ObjectReference) -> usize { addr_size.load::() as usize } } + +#[cfg(feature = "object_pinning")] +#[no_mangle] +pub extern "C" fn mmtk_pin_object(object: ObjectReference) -> bool { + if !mmtk_object_is_managed_by_mmtk(object.to_raw_address().as_usize()) { + return false; + } + memory_manager::pin_object::(object) +} + +#[cfg(feature = "object_pinning")] +#[no_mangle] +pub extern "C" fn mmtk_unpin_object(object: ObjectReference) -> bool { + if !mmtk_object_is_managed_by_mmtk(object.to_raw_address().as_usize()) { + return false; + } + memory_manager::unpin_object::(object) +} + +#[cfg(feature = "object_pinning")] +#[no_mangle] +pub extern "C" fn mmtk_is_pinned(object: ObjectReference) -> bool { + memory_manager::is_pinned::(object) +} diff --git a/mmtk/src/edges.rs b/mmtk/src/edges.rs index 0e7eafdd..8f79c746 100644 --- a/mmtk/src/edges.rs +++ b/mmtk/src/edges.rs @@ -206,6 +206,13 @@ pub struct RootsWorkClosure { factory_ptr: *mut libc::c_void, renew: bool, ) -> RootsWorkBuffer, + pub report_tpinned_nodes_func: extern "C" fn( + buf: *mut ObjectReference, + size: usize, + cap: usize, + factory_ptr: *mut libc::c_void, + renew: bool, + ) -> RootsWorkBuffer, pub factory_ptr: *mut libc::c_void, } @@ -253,10 +260,31 @@ impl RootsWorkClosure { } } + extern "C" fn report_tpinned_nodes>( + buf: *mut ObjectReference, + size: usize, + cap: usize, + factory_ptr: *mut libc::c_void, + renew: bool, + ) -> RootsWorkBuffer { + if !buf.is_null() { + let buf = unsafe { Vec::::from_raw_parts(buf, size, cap) }; + let factory: &mut F = unsafe { &mut *(factory_ptr as *mut F) }; + factory.create_immovable_process_node_roots_work(buf); + } + + if renew { + RootsWorkBuffer::new() + } else { + RootsWorkBuffer::empty() + } + } + pub fn from_roots_work_factory>(factory: &mut F) -> Self { RootsWorkClosure { report_edges_func: Self::report_simple_edges::, report_nodes_func: Self::report_nodes::, + report_tpinned_nodes_func: Self::report_tpinned_nodes::, factory_ptr: factory as *mut F as *mut libc::c_void, } } diff --git a/mmtk/src/julia_finalizer.rs b/mmtk/src/julia_finalizer.rs index 754fe81d..fb8534ab 100644 --- a/mmtk/src/julia_finalizer.rs +++ b/mmtk/src/julia_finalizer.rs @@ -186,6 +186,9 @@ fn mark_finlist(list: &mut ArrayListT, start: usize, tracer: &m let mut i = start; while i < list.len { let cur = list.get(i); + let cur_i = i; + let mut cur_tag: usize = 0; + if cur.is_zero() { i += 1; continue; @@ -195,6 +198,7 @@ fn mark_finlist(list: &mut ArrayListT, start: usize, tracer: &m // Skip next i += 1; debug_assert!(i < list.len); + cur_tag = 1; gc_ptr_clear_tag(cur, 1) } else { ObjectReference::from_raw_address(cur) @@ -205,10 +209,11 @@ fn mark_finlist(list: &mut ArrayListT, start: usize, tracer: &m } let traced = tracer.trace_object(new_obj); - debug_assert_eq!( - traced, new_obj, - "Object is moved -- we need to save the new object back to the finalizer list" - ); + // if object has moved, update the list applying the tag + list.set(cur_i, unsafe { + Address::from_usize(traced.to_raw_address() | cur_tag) + }); + i += 1; } } diff --git a/mmtk/src/lib.rs b/mmtk/src/lib.rs index e973d9e4..bbf7f20d 100644 --- a/mmtk/src/lib.rs +++ b/mmtk/src/lib.rs @@ -107,6 +107,7 @@ pub struct Julia_Upcalls { pub mmtk_jl_run_finalizers: extern "C" fn(tls: OpaquePointer), pub jl_throw_out_of_memory_error: extern "C" fn(), pub mmtk_sweep_malloced_array: extern "C" fn(), + pub mmtk_sweep_stack_pools: extern "C" fn(), pub wait_in_a_safepoint: extern "C" fn(), pub exit_from_safepoint: extern "C" fn(old_state: i8), pub jl_hrtime: extern "C" fn() -> u64, @@ -118,6 +119,7 @@ pub struct Julia_Upcalls { pub arraylist_grow: extern "C" fn(Address, usize), pub get_jl_gc_have_pending_finalizers: extern "C" fn() -> *mut i32, pub scan_vm_specific_roots: extern "C" fn(closure: *mut crate::edges::RootsWorkClosure), + pub update_inlined_array: extern "C" fn(to: Address, from: Address), } pub static mut UPCALLS: *const Julia_Upcalls = null_mut(); diff --git a/mmtk/src/object_model.rs b/mmtk/src/object_model.rs index a7723839..da361f93 100644 --- a/mmtk/src/object_model.rs +++ b/mmtk/src/object_model.rs @@ -4,8 +4,10 @@ use crate::julia_scanning::{ jl_task_type, mmtk_jl_array_len, mmtk_jl_array_ndimwords, mmtk_jl_tparam0, mmtk_jl_typeof, mmtk_jl_typetagof, }; -use crate::julia_types::*; +use crate::{julia_types::*, UPCALLS}; use crate::{JuliaVM, JULIA_BUFF_TAG, JULIA_HEADER_SIZE}; +use atomic::Ordering; +use log::info; use mmtk::util::copy::*; use mmtk::util::{Address, ObjectReference}; use mmtk::vm::ObjectModel; @@ -20,6 +22,10 @@ pub(crate) const LOGGING_SIDE_METADATA_SPEC: VMGlobalLogBitSpec = VMGlobalLogBit pub(crate) const MARKING_METADATA_SPEC: VMLocalMarkBitSpec = VMLocalMarkBitSpec::side_after(LOS_METADATA_SPEC.as_spec()); +#[cfg(feature = "object_pinning")] +pub(crate) const LOCAL_PINNING_METADATA_BITS_SPEC: VMLocalPinningBitSpec = + VMLocalPinningBitSpec::side_after(MARKING_METADATA_SPEC.as_spec()); + // pub(crate) const LOCAL_FORWARDING_POINTER_METADATA_SPEC: VMLocalForwardingPointerSpec = // VMLocalForwardingPointerSpec::side_after(MARKING_METADATA_SPEC.as_spec()); @@ -34,20 +40,82 @@ pub(crate) const LOS_METADATA_SPEC: VMLocalLOSMarkNurserySpec = impl ObjectModel for VMObjectModel { const GLOBAL_LOG_BIT_SPEC: VMGlobalLogBitSpec = LOGGING_SIDE_METADATA_SPEC; const LOCAL_FORWARDING_POINTER_SPEC: VMLocalForwardingPointerSpec = - VMLocalForwardingPointerSpec::in_header(0); + VMLocalForwardingPointerSpec::in_header(-64); const LOCAL_FORWARDING_BITS_SPEC: VMLocalForwardingBitsSpec = - VMLocalForwardingBitsSpec::in_header(0); + VMLocalForwardingBitsSpec::in_header(-64); const LOCAL_MARK_BIT_SPEC: VMLocalMarkBitSpec = MARKING_METADATA_SPEC; const LOCAL_LOS_MARK_NURSERY_SPEC: VMLocalLOSMarkNurserySpec = LOS_METADATA_SPEC; const UNIFIED_OBJECT_REFERENCE_ADDRESS: bool = false; const OBJECT_REF_OFFSET_LOWER_BOUND: isize = 0; + #[cfg(feature = "object_pinning")] + const LOCAL_PINNING_BIT_SPEC: VMLocalPinningBitSpec = LOCAL_PINNING_METADATA_BITS_SPEC; + fn copy( - _from: ObjectReference, - _semantics: CopySemantics, - _copy_context: &mut GCWorkerCopyContext, + from: ObjectReference, + semantics: CopySemantics, + copy_context: &mut GCWorkerCopyContext, ) -> ObjectReference { - unimplemented!() + let bytes = Self::get_current_size(from); + let from_start_ref = ObjectReference::from_raw_address(Self::ref_to_object_start(from)); + let header_offset = + from.to_raw_address().as_usize() - from_start_ref.to_raw_address().as_usize(); + + let dst = if header_offset == 8 { + // regular object + copy_context.alloc_copy(from_start_ref, bytes, 16, 8, semantics) + } else if header_offset == 16 { + // buffer should not be copied + unimplemented!(); + } else { + unimplemented!() + }; + + let src = Self::ref_to_object_start(from); + unsafe { + std::ptr::copy_nonoverlapping::(src.to_ptr(), dst.to_mut_ptr(), bytes); + } + let to_obj = ObjectReference::from_raw_address(dst + header_offset); + + // use std::fs::OpenOptions; + // use std::io::Write; + + // let mut file = OpenOptions::new() + // .write(true) + // .append(true) + // .create(true) + // .open("/home/eduardo/mmtk-julia/copied_objs.log") + // .unwrap(); + + // if let Err(e) = writeln!(file, "Copying object from {} to {}", from, to_obj) { + // eprintln!("Couldn't write to file: {}", e); + // } + + info!("Copying object from {} to {}", from, to_obj); + + copy_context.post_copy(to_obj, bytes, semantics); + + unsafe { + let vt = mmtk_jl_typeof(from.to_raw_address()); + + if (*vt).name == jl_array_typename { + ((*UPCALLS).update_inlined_array)(from.to_raw_address(), to_obj.to_raw_address()) + } + } + + // zero from_obj + unsafe { + libc::memset(from_start_ref.to_raw_address().to_mut_ptr(), 0, bytes); + } + + Self::LOCAL_FORWARDING_BITS_SPEC.store_atomic::( + from, + 0b10 as u8, // BEING_FORWARDED + None, + Ordering::SeqCst, + ); + + to_obj } fn copy_to(_from: ObjectReference, _to: ObjectReference, _region: Address) -> Address { @@ -101,9 +169,8 @@ impl ObjectModel for VMObjectModel { } #[inline(always)] - fn ref_to_header(_object: ObjectReference) -> Address { - unreachable!() - // object.to_raw_address() - 8 + fn ref_to_header(object: ObjectReference) -> Address { + object.to_raw_address() } fn dump_object(_object: ObjectReference) { diff --git a/mmtk/src/scanning.rs b/mmtk/src/scanning.rs index a2ec71a6..d7535b60 100644 --- a/mmtk/src/scanning.rs +++ b/mmtk/src/scanning.rs @@ -37,22 +37,35 @@ impl Scanning for VMScanning { use mmtk::util::Address; let ptls: &mut mmtk__jl_tls_states_t = unsafe { std::mem::transmute(mutator.mutator_tls) }; - let mut edge_buffer = EdgeBuffer { buffer: vec![] }; + let mut edge_buffer = EdgeBuffer { buffer: vec![] }; // need to be tpinned as they're all from the shadow stack let mut node_buffer = vec![]; // Scan thread local from ptls: See gc_queue_thread_local in gc.c - let mut root_scan_task = |task: *const mmtk__jl_task_t| { + let mut root_scan_task = |task: *const mmtk__jl_task_t, queue_task: bool| { if !task.is_null() { unsafe { crate::julia_scanning::mmtk_scan_gcstack(task, &mut edge_buffer); } - node_buffer.push(ObjectReference::from_raw_address(Address::from_ptr(task))); + if queue_task { + node_buffer.push(ObjectReference::from_raw_address(Address::from_ptr(task))); + } } }; - root_scan_task(ptls.root_task); - root_scan_task(ptls.current_task as *mut mmtk__jl_task_t); - root_scan_task(ptls.next_task); - root_scan_task(ptls.previous_task); + root_scan_task(ptls.root_task, true); + + // need to iterate over live tasks as well to process their shadow stacks + let mut i = 0; + while i < ptls.heap.live_tasks.len { + let mut task_address = Address::from_ptr(ptls.heap.live_tasks.items); + task_address = task_address.shift::
(i as isize); + let task = unsafe { task_address.load::<*const mmtk_jl_task_t>() }; + root_scan_task(task, false); + i += 1; + } + + root_scan_task(ptls.current_task as *mut mmtk__jl_task_t, true); + root_scan_task(ptls.next_task, true); + root_scan_task(ptls.previous_task, true); if !ptls.previous_exception.is_null() { node_buffer.push(ObjectReference::from_raw_address(Address::from_mut_ptr( ptls.previous_exception, @@ -85,7 +98,7 @@ impl Scanning for VMScanning { .chunks(CAPACITY_PER_PACKET) .map(|c| c.to_vec()) { - factory.create_process_edge_roots_work(edges); + factory.create_immovable_process_edge_roots_work(edges); } for nodes in node_buffer.chunks(CAPACITY_PER_PACKET).map(|c| c.to_vec()) { factory.create_process_node_roots_work(nodes); @@ -111,11 +124,11 @@ impl Scanning for VMScanning { process_object(object, edge_visitor); } fn notify_initial_thread_scan_complete(_partial_scan: bool, _tls: VMWorkerThread) { - let sweep_malloced_arrays_work = SweepMallocedArrays::new(); + let sweep_vm_specific_work = SweepVMSpecific::new(); memory_manager::add_work_packet( &SINGLETON, WorkBucketStage::Compact, - sweep_malloced_arrays_work, + sweep_vm_specific_work, ); } fn supports_return_barrier() -> bool { @@ -150,20 +163,21 @@ pub fn process_object>(object: ObjectReference, clo } // Sweep malloced arrays work -pub struct SweepMallocedArrays { +pub struct SweepVMSpecific { swept: bool, } -impl SweepMallocedArrays { +impl SweepVMSpecific { pub fn new() -> Self { Self { swept: false } } } -impl GCWork for SweepMallocedArrays { +impl GCWork for SweepVMSpecific { fn do_work(&mut self, _worker: &mut GCWorker, _mmtk: &'static MMTK) { - // call sweep malloced arrays from UPCALLS + // call sweep malloced arrays and sweep stack pools from UPCALLS unsafe { ((*UPCALLS).mmtk_sweep_malloced_array)() } + unsafe { ((*UPCALLS).mmtk_sweep_stack_pools)() } self.swept = true; } } From 357354b9ae767198c1fd97fdc6f30c1dccd8da64 Mon Sep 17 00:00:00 2001 From: Luis Eduardo de Souza Amorim Date: Mon, 21 Aug 2023 04:01:20 +0000 Subject: [PATCH 02/41] latest changes --- julia/mmtk_julia.c | 9 +++- julia/mmtk_julia.dbg.obj | Bin 0 -> 81872 bytes mmtk/Cargo.lock | 53 +++++++++---------- mmtk/Cargo.toml | 3 +- mmtk/api/mmtk.h | 1 + mmtk/src/collection.rs | 6 +-- mmtk/src/edges.rs | 2 +- mmtk/src/julia_scanning.rs | 102 ++++++++++++++++++++++++++++++------- mmtk/src/scanning.rs | 2 +- mmtk/src/util.rs | 9 ++++ 10 files changed, 134 insertions(+), 53 deletions(-) create mode 100644 julia/mmtk_julia.dbg.obj diff --git a/julia/mmtk_julia.c b/julia/mmtk_julia.c index 2bbbfeb8..cfcd4c96 100644 --- a/julia/mmtk_julia.c +++ b/julia/mmtk_julia.c @@ -111,6 +111,8 @@ static void mmtk_sweep_malloced_arrays(void) JL_NOTSAFEPOINT continue; } if (mmtk_is_live_object(ma->a)) { + jl_array_t *maybe_forwarded = (jl_array_t*)mmtk_get_possibly_forwared(ma->a); + ma->a = maybe_forwarded; pma = &ma->next; } else { @@ -359,7 +361,7 @@ void update_inlined_array(void* from, void* to) { jl_array_t *a = (jl_array_t*)jl_from; jl_array_t *b = (jl_array_t*)jl_to; if (a->flags.how == 0) { - assert(object_is_managed_by_mmtk(a->data)); + assert(mmtk_object_is_managed_by_mmtk(a->data)); size_t pre_data_bytes = ((size_t)a->data - a->offset*a->elsize) - (size_t)a; if (pre_data_bytes > 0 && pre_data_bytes <= ARRAY_INLINE_NBYTES) { b->data = (void*)((size_t) b + pre_data_bytes); @@ -412,8 +414,11 @@ void mmtk_sweep_stack_pools(void) continue; while (1) { jl_task_t *t = (jl_task_t*)lst[n]; - assert(jl_is_task(t)); if (mmtk_is_live_object(t)) { + jl_task_t *maybe_forwarded = (jl_task_t*)mmtk_get_possibly_forwared(t); + live_tasks->items[n] = maybe_forwarded; + t = maybe_forwarded; + assert(jl_is_task(t)); if (t->stkbuf == NULL) ndel++; // jl_release_task_stack called else diff --git a/julia/mmtk_julia.dbg.obj b/julia/mmtk_julia.dbg.obj new file mode 100644 index 0000000000000000000000000000000000000000..75398961697b39a4af373389fe5ed9c3e31ecf01 GIT binary patch literal 81872 zcmdqKd3;sX)jxdBJvqs}h9ox=86_785=16N1qBU4G$3Hgpx|@~$;}{{%)Mc7s60kn z(r626E$zcov9&EvA8d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$qh2TCev;o}5 zqjrP)cv=zruiD__sMWxIJhmmckLzZF`*`v=a39BB2=3$I8^C>BeK)v|&lf3}XZ~aM z_xXit;66Xn65QvHGQoX*a2&YLpDqOV`S%Urz8+vVxUVZHQt0^l`}%}L>d+Abv(tM; z>+B(6o#{_QG6tllW@ik~PNeop&rVOI_8K}gkve2h_>%W){4q896yaF7Pe!lX`u6CT zb@QNTlf2LAy?PDF7mq+ZqLhKq(~r}w@^-}`3WmO6OIpurhKvPVd7MrMzjhole82xj=yE#VHohI?gvwRR5l52Z3D4 zd6nW1S~rN+C$eAK>p>t*6^rc`_Yv*aI%2d*yk&~^E9Wc!k6FA>wq?XlRQ~8U^28HG z`iFH~eq1)o?-DWUjJJ5>=JmTRCCn~?a%8$3pzfg8^^dng;-(TDRo}7Q{|CD_&`uRllU!nT%h<}Wh zxE}GLIM)BMh{ff*ozcgt^k250JU49b z{k`z*@AiB9Ty5{)y?#a8`@7fP&fnv_IW{rJZ?3jav7pwrpYiVKL#&hA@9_4TZ!FL4 zzm9%5QUA@T8)}*>`^EiNI{NeWj(;aAJFl#`W1{7`II)eESiW-f$L)(o3|$nFXuG9( etHjv<#s5k~Vkg?ZbNx{N13}HP|A8L+n)n}g@zq2C literal 0 HcmV?d00001 diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 53897de0..552e4f04 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "aho-corasick" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" +checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" dependencies = [ "memchr", ] @@ -50,9 +50,9 @@ dependencies = [ [[package]] name = "atomic_refcell" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79d6dc922a2792b006573f60b2648076355daeae5ce9cb59507e5908c9625d31" +checksum = "112ef6b3f6cb3cb6fc5b6b494ef7a848492cff1ab0ef4de10b0f7d572861c905" [[package]] name = "autocfg" @@ -452,9 +452,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" @@ -514,6 +514,7 @@ dependencies = [ "lazy_static", "libc", "log", + "memoffset", "mmtk", "thread-id", ] @@ -856,18 +857,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "d9207952ae1a003f42d3d5e892dac3c6ba42aa6ac0c79a6a91a2b5cb4253e75c" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "f1728216d3244de4f14f14f8c15c79be1a7c67867d28d69b719690e2a19fb445" dependencies = [ "proc-macro2", "quote", @@ -1081,9 +1082,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "d1eeca1c172a285ee6c2c84c341ccea837e7c01b12fbb2d0fe3c9e550ce49ec8" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -1096,42 +1097,42 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "b10d0c968ba7f6166195e13d593af609ec2e3d24f916f081690695cf5eaffb2f" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "571d8d4e62f26d4932099a9efe89660e8bd5087775a2ab5cdd8b747b811f1058" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "2229ad223e178db5fbbc8bd8d3835e51e566b8474bfca58d2e6150c48bb723cd" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "600956e2d840c194eedfc5d18f8242bc2e17c7775b6684488af3a9fff6fe3287" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "ea99ff3f8b49fb7a8e0d305e5aec485bd068c2ba691b6e277d29eaeac945868a" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "8f1a05a1ece9a7a0d5a7ccf30ba2c33e3a61a30e042ffd247567d1de1d94120d" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "d419259aba16b663966e29e6d7c6ecfa0bb8425818bb96f6f1f3c3eb71a6e7b9" diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index b4a1f718..7ff85937 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -34,11 +34,12 @@ lazy_static = "1.1" # mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "04a47feb4598b2120598453c2cceec83986c2122" } # Uncomment the following to build locally mmtk = { path = "../../mmtk-core" } -log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] } +log = {version = "0.4", features = ["max_level_debug", "release_max_level_off"] } enum-map = ">=2.1" atomic = "0.4.6" chrono = "*" thread-id = "*" +memoffset = "*" # ykstackmaps = { git = "https://github.com/udesou/ykstackmaps.git", branch = "udesou-master", version = "*" } diff --git a/mmtk/api/mmtk.h b/mmtk/api/mmtk.h index 9e937acc..970c8201 100644 --- a/mmtk/api/mmtk.h +++ b/mmtk/api/mmtk.h @@ -116,6 +116,7 @@ extern void mmtk_run_finalizers_for_obj(void* obj); extern void mmtk_run_finalizers(bool at_exit); extern void mmtk_gc_poll(void *tls); extern void mmtk_julia_copy_stack_check(int copy_stack); +extern void* mmtk_get_possibly_forwared(void* object); /** * VM Accounting diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index b396ff7b..bd37f4b2 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -1,6 +1,6 @@ use crate::{JuliaVM, USER_TRIGGERED_GC}; use crate::{SINGLETON, UPCALLS}; -use log::{info, trace}; +use log::{info, trace, warn}; use mmtk::util::alloc::AllocationError; use mmtk::util::opaque_pointer::*; use mmtk::vm::{Collection, GCThreadContext}; @@ -64,7 +64,7 @@ impl Collection for VMCollection { } fn block_for_gc(tls: VMMutatorThread) { - info!("Triggered GC!"); + warn!("Triggered GC!"); AtomicBool::store(&BLOCK_FOR_GC, true, Ordering::SeqCst); @@ -109,7 +109,7 @@ impl Collection for VMCollection { unsafe { ((*UPCALLS).mmtk_jl_run_finalizers)(tls_ptr) }; unsafe { ((*UPCALLS).set_jl_last_err)(last_err) }; - info!("Finished blocking mutator for GC!"); + warn!("Finished blocking mutator for GC!"); } fn spawn_gc_thread(_tls: VMThread, ctx: GCThreadContext) { diff --git a/mmtk/src/edges.rs b/mmtk/src/edges.rs index 8f79c746..bfc9133a 100644 --- a/mmtk/src/edges.rs +++ b/mmtk/src/edges.rs @@ -270,7 +270,7 @@ impl RootsWorkClosure { if !buf.is_null() { let buf = unsafe { Vec::::from_raw_parts(buf, size, cap) }; let factory: &mut F = unsafe { &mut *(factory_ptr as *mut F) }; - factory.create_immovable_process_node_roots_work(buf); + factory.create_process_tp_node_roots_work(buf); } if renew { diff --git a/mmtk/src/julia_scanning.rs b/mmtk/src/julia_scanning.rs index 4cc4862d..7aeb9d4d 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -1,9 +1,12 @@ +use crate::api::mmtk_object_is_managed_by_mmtk; use crate::edges::JuliaVMEdge; use crate::edges::OffsetEdge; use crate::julia_types::*; use crate::object_model::mmtk_jl_array_ndims; +use crate::util::mmtk_get_possibly_forwared; use crate::JULIA_BUFF_TAG; use crate::UPCALLS; +use memoffset::offset_of; use mmtk::util::{Address, ObjectReference}; use mmtk::vm::edge_shape::SimpleEdge; use mmtk::vm::EdgeVisitor; @@ -11,6 +14,8 @@ use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering; const JL_MAX_TAGS: usize = 64; // from vm/julia/src/jl_exports.h +const OFFSET_OF_INLINED_SPACE_IN_MODULE: usize = + offset_of!(mmtk_jl_module_t, usings) + offset_of!(mmtk_arraylist_t, _space); extern "C" { pub static jl_simplevector_type: *const mmtk_jl_datatype_t; @@ -96,7 +101,64 @@ pub unsafe fn scan_julia_object>(obj: Address, clos } else if flags.how_custom() == 3 { // has a pointer to the object that owns the data let owner_addr = mmtk_jl_array_data_owner_addr(array); + + if mmtk_object_is_managed_by_mmtk((*array).data as usize) { + let data_owner = owner_addr.load::(); + // if the owner moves and a->data points to it, it needs to be updated as well + // first check if it has moved already (as we need to query type info from it) + let owner = + if mmtk_object_is_managed_by_mmtk(data_owner.to_raw_address().as_usize()) { + mmtk_get_possibly_forwared(data_owner) + } else { + data_owner + }; + + // owner may be either a string or another array + let owner_type = mmtk_jl_typeof(owner.to_raw_address()); + if owner_type == jl_string_type { + // if it is a string, a->data will point into the string object (not always the beginning of the string!!!) + // see (#define jl_string_data(s) ((char*)s + sizeof(void*)) from julia.h + let offset = std::mem::size_of::<*const ::std::os::raw::c_void>() + + ((*array).offset as usize * (*array).elsize as usize); + let data_addr = ::std::ptr::addr_of!((*array).data); + process_offset_edge(closure, Address::from_ptr(data_addr), offset); + } else if (*owner_type).name == jl_array_typename { + // if it is an array we need to check with type of array it is to update the a->data accordingly + let array_owner = owner.to_raw_address().to_ptr::(); + let owner_flags = (*array_owner).flags; + if owner_flags.how_custom() == 0 { + let offset_isize = (*array_owner).data as isize - array_owner as isize; + assert!( + offset_isize >= 0 && offset_isize <= 2032, + "Offset is larger than small object size" + ); // FIXME: might not hold after removing Julia's size classes + assert!( + ((*array_owner).offset == 0 && (*array).offset == 0) + || (*array).offset == (*array_owner).offset + ); + // owner has inlined data => a->data is an internal pointer into owner (not always the beginning of owner.data!!) + let offset = offset_isize as usize + + ((*array).offset as usize * (*array).elsize as usize); + let data_addr = ::std::ptr::addr_of!((*array).data); + process_offset_edge(closure, Address::from_ptr(data_addr), offset); + } else if owner_flags.how_custom() == 1 { + // the data inside the owner array is a julia allocated buffer (which at least currently is always pinned) + // FIXME: if buffers may move a->data needs to be updated! + } else if owner_flags.how_custom() == 2 { + // the data inside the owner array is malloc-allocated + // don't need to do anything because the malloc-allocated data won't move + } else if owner_flags.how_custom() == 3 { + // owner itself has a pointer to another owner + println!("owner_flags.how = 3"); + unreachable!() // FIXME: is this even possible? + } + } else { + unreachable!() + } + } + process_edge(closure, owner_addr); + return; } @@ -175,25 +237,6 @@ pub unsafe fn scan_julia_object>(obj: Address, clos } let m = obj.to_ptr::(); - let bindings = (*m).bindings; - let table = mmtk_jl_svec_data(Address::from_mut_ptr(bindings)); - let bsize = mmtk_jl_svec_len(Address::from_mut_ptr(bindings)); - let mut begin = table.shift::
(1); - let end = table.shift::
(bsize as isize); - - while begin < end { - let b: *mut mmtk_jl_binding_t = begin.load::<*mut mmtk_jl_binding_t>(); - if b == crate::reference_glue::jl_nothing as *mut mmtk_jl_binding_t { - begin = begin.shift::
(1); - continue; - } - if PRINT_OBJ_TYPE { - println!(" - scan table: {}\n", obj); - } - - process_edge(closure, begin); - begin = begin.shift::
(1); - } let parent_edge = ::std::ptr::addr_of!((*m).parent); if PRINT_OBJ_TYPE { @@ -213,6 +256,16 @@ pub unsafe fn scan_julia_object>(obj: Address, clos } process_edge(closure, Address::from_ptr(bindings_edge)); + // m.usings.items may be inlined in the module when the array list size <= AL_N_INLINE (cf. arraylist_new) + // In that case it may be an mmtk object and not a malloced address. + // If it is an mmtk object, (*m).usings.items will then be an internal pointer to the module + // which means we will need to trace and update it if the module moves + if mmtk_object_is_managed_by_mmtk((*m).usings.items as usize) { + let offset = OFFSET_OF_INLINED_SPACE_IN_MODULE; + let slot = Address::from_ptr(::std::ptr::addr_of!((*m).usings.items)); + process_offset_edge(closure, slot, offset); + } + let nusings = (*m).usings.len; if nusings != 0 { let mut objary_begin = Address::from_mut_ptr((*m).usings.items); @@ -412,6 +465,17 @@ pub fn process_edge>(closure: &mut EV, slot: Addres simple_edge.load(), simple_edge ); + + let obj = simple_edge.load().to_raw_address().as_usize(); + + // captures wrong edges before creating the work + debug_assert!( + obj % 16 == 0 || obj % 8 == 0, + "Object {:?} in slot {:?} is not aligned to 8 or 16", + simple_edge.load(), + simple_edge + ); + closure.visit_edge(JuliaVMEdge::Simple(simple_edge)); } diff --git a/mmtk/src/scanning.rs b/mmtk/src/scanning.rs index d7535b60..bf260011 100644 --- a/mmtk/src/scanning.rs +++ b/mmtk/src/scanning.rs @@ -98,7 +98,7 @@ impl Scanning for VMScanning { .chunks(CAPACITY_PER_PACKET) .map(|c| c.to_vec()) { - factory.create_immovable_process_edge_roots_work(edges); + factory.create_process_tp_edge_roots_work(edges); } for nodes in node_buffer.chunks(CAPACITY_PER_PACKET).map(|c| c.to_vec()) { factory.create_process_node_roots_work(nodes); diff --git a/mmtk/src/util.rs b/mmtk/src/util.rs index 13bc4456..6d702ff8 100644 --- a/mmtk/src/util.rs +++ b/mmtk/src/util.rs @@ -1,4 +1,5 @@ use enum_map::Enum; +use mmtk::util::ObjectReference; #[repr(i32)] #[derive(Clone, Copy, Debug, Enum, PartialEq, Hash, Eq)] @@ -143,3 +144,11 @@ pub extern "C" fn mmtk_julia_copy_stack_check(c_flag_is_defined: bool) { panic!("COPY_STACK flag has not been defined in C, but `julia_copy_stack` feature has been set.") } } + +#[no_mangle] +pub extern "C" fn mmtk_get_possibly_forwared(object: ObjectReference) -> ObjectReference { + match object.get_forwarded_object() { + Some(forwarded) => forwarded, + None => object, + } +} From 9bfb2f21bd0aa320f33802a6f022d19ea0752fcd Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Tue, 22 Aug 2023 05:35:20 +0000 Subject: [PATCH 03/41] Adding debug asserts; fixing assertion when copying array --- julia/mmtk_julia.c | 3 +-- julia/mmtk_julia.dbg.obj | Bin 81872 -> 0 bytes mmtk/src/collection.rs | 6 +++--- mmtk/src/julia_scanning.rs | 6 +++--- mmtk/src/scanning.rs | 17 +++++++++++++++++ 5 files changed, 24 insertions(+), 8 deletions(-) delete mode 100644 julia/mmtk_julia.dbg.obj diff --git a/julia/mmtk_julia.c b/julia/mmtk_julia.c index cfcd4c96..ff87578e 100644 --- a/julia/mmtk_julia.c +++ b/julia/mmtk_julia.c @@ -360,8 +360,7 @@ void update_inlined_array(void* from, void* to) { if(vt->name == jl_array_typename) { jl_array_t *a = (jl_array_t*)jl_from; jl_array_t *b = (jl_array_t*)jl_to; - if (a->flags.how == 0) { - assert(mmtk_object_is_managed_by_mmtk(a->data)); + if (a->flags.how == 0 && mmtk_object_is_managed_by_mmtk(a->data)) { // a is inlined (a->data is an mmtk object) size_t pre_data_bytes = ((size_t)a->data - a->offset*a->elsize) - (size_t)a; if (pre_data_bytes > 0 && pre_data_bytes <= ARRAY_INLINE_NBYTES) { b->data = (void*)((size_t) b + pre_data_bytes); diff --git a/julia/mmtk_julia.dbg.obj b/julia/mmtk_julia.dbg.obj deleted file mode 100644 index 75398961697b39a4af373389fe5ed9c3e31ecf01..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 81872 zcmdqKd3;sX)jxdBJvqs}h9ox=86_785=16N1qBU4G$3Hgpx|@~$;}{{%)Mc7s60kn z(r626E$zcov9&EvA8dI#DAl$P+CgfqMLXG1+G@pWE3F-9A6wt=cddQSJ@-P|zMuE^ zzJI*ulbo~H+H0@9_S$Q&z4kuCy{&2ar6Jq4yu-FGveJ-;wXBx;X>6mQ8?9=q%39kz z@^bUYtuKuHZsf?w(>vCFcSqBa=Fz4XnuiZnHIFnMFM6a2s5fxIKXZ=nh;G02h?Oee ze(QIwp(3FjZHzXLS|C3Gx+B+p#V|e5{BO6Oc-yh8EtMcU(fq_Qr+MVb=24gRH;?8V zc`b){LqGg_BLq3tJTi2&d1UPi%_A$0EFWn)ynJNEAy6G^{xeW0+;o&xO=IeC^YAgd zdEybusTmLhNt>7x&7*7akJbR3-}FM!J%@@OIn;dTq11%tQL}(;)q1inE^=hrGxiPv_WIfS*_dvLL^j1`};sr2< z>>wU~J$!?;bmT8fM-DfSJhy!0c~*Yn?{B}|Jp9$Dsc7WZ6VSwQXyVw;fI_K8G=KQS z+ePnZdwkuY0Vu(2@cP! zx$R`0*Zqq;+3`N#)o6aD=#Z*_urXmgR4=LlJRNZJ$X7gYfS^r#487(aq!BldUgvd( z*XH3v(JW0+cSak}3qyA1@#ZIvIxw0jZDQ2YhEgE56uKTdCPWb8!=4ap4eI+8^+P_V zW6jf!q?w^>eUX%zcHZb(BZQQ`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/collection.rs b/mmtk/src/collection.rs index bd37f4b2..b396ff7b 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -1,6 +1,6 @@ use crate::{JuliaVM, USER_TRIGGERED_GC}; use crate::{SINGLETON, UPCALLS}; -use log::{info, trace, warn}; +use log::{info, trace}; use mmtk::util::alloc::AllocationError; use mmtk::util::opaque_pointer::*; use mmtk::vm::{Collection, GCThreadContext}; @@ -64,7 +64,7 @@ impl Collection for VMCollection { } fn block_for_gc(tls: VMMutatorThread) { - warn!("Triggered GC!"); + info!("Triggered GC!"); AtomicBool::store(&BLOCK_FOR_GC, true, Ordering::SeqCst); @@ -109,7 +109,7 @@ impl Collection for VMCollection { unsafe { ((*UPCALLS).mmtk_jl_run_finalizers)(tls_ptr) }; unsafe { ((*UPCALLS).set_jl_last_err)(last_err) }; - warn!("Finished blocking mutator for GC!"); + info!("Finished blocking mutator for GC!"); } fn spawn_gc_thread(_tls: VMThread, ctx: GCThreadContext) { diff --git a/mmtk/src/julia_scanning.rs b/mmtk/src/julia_scanning.rs index 7aeb9d4d..f328beed 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -471,7 +471,7 @@ pub fn process_edge>(closure: &mut EV, slot: Addres // captures wrong edges before creating the work debug_assert!( obj % 16 == 0 || obj % 8 == 0, - "Object {:?} in slot {:?} is not aligned to 8 or 16", + "Object {:?} in slot {:?} is not aligned to 8 or 16", simple_edge.load(), simple_edge ); @@ -616,14 +616,14 @@ const JL_BT_NON_PTR_ENTRY: usize = usize::MAX; pub fn mmtk_jl_bt_is_native(bt_entry: *mut mmtk_jl_bt_element_t) -> bool { let entry = unsafe { (*bt_entry).__bindgen_anon_1.uintptr }; - entry == JL_BT_NON_PTR_ENTRY + entry != JL_BT_NON_PTR_ENTRY } pub fn mmtk_jl_bt_entry_size(bt_entry: *mut mmtk_jl_bt_element_t) -> usize { if mmtk_jl_bt_is_native(bt_entry) { 1 } else { - 2 + mmtk_jl_bt_num_jlvals(bt_entry) + mmtk_jl_bt_num_jlvals(bt_entry) + 2 + mmtk_jl_bt_num_jlvals(bt_entry) + mmtk_jl_bt_num_uintvals(bt_entry) } } diff --git a/mmtk/src/scanning.rs b/mmtk/src/scanning.rs index bf260011..cd6a2481 100644 --- a/mmtk/src/scanning.rs +++ b/mmtk/src/scanning.rs @@ -47,6 +47,14 @@ impl Scanning for VMScanning { crate::julia_scanning::mmtk_scan_gcstack(task, &mut edge_buffer); } if queue_task { + // captures wrong root nodes before creating the work + debug_assert!( + Address::from_ptr(task).as_usize() % 16 == 0 + || Address::from_ptr(task).as_usize() % 8 == 0, + "root node {:?} is not aligned to 8 or 16", + Address::from_ptr(task) + ); + node_buffer.push(ObjectReference::from_raw_address(Address::from_ptr(task))); } } @@ -84,6 +92,15 @@ impl Scanning for VMScanning { let njlvals = mmtk_jl_bt_num_jlvals(bt_entry); for j in 0..njlvals { let bt_entry_value = mmtk_jl_bt_entry_jlvalue(bt_entry, j); + + // captures wrong root nodes before creating the work + debug_assert!( + bt_entry_value.to_raw_address().as_usize() % 16 == 0 + || bt_entry_value.to_raw_address().as_usize() % 8 == 0, + "root node {:?} is not aligned to 8 or 16", + bt_entry_value + ); + node_buffer.push(bt_entry_value); } i += bt_entry_size; From 978cbfaa5858284159ae250f8e20a173965d0ef4 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 23 Aug 2023 00:41:49 +0000 Subject: [PATCH 04/41] Cleanup and adding a few comments --- julia/mmtk_julia.c | 7 ++----- mmtk/Cargo.lock | 3 +++ mmtk/Cargo.toml | 6 +++--- mmtk/src/julia_scanning.rs | 13 ++++++------- mmtk/src/object_model.rs | 39 ++++++++++++++------------------------ mmtk/src/scanning.rs | 5 +++-- 6 files changed, 31 insertions(+), 42 deletions(-) diff --git a/julia/mmtk_julia.c b/julia/mmtk_julia.c index ff87578e..3dd327fd 100644 --- a/julia/mmtk_julia.c +++ b/julia/mmtk_julia.c @@ -111,6 +111,7 @@ static void mmtk_sweep_malloced_arrays(void) JL_NOTSAFEPOINT continue; } if (mmtk_is_live_object(ma->a)) { + // if the array has been forwarded, the reference needs to be updated jl_array_t *maybe_forwarded = (jl_array_t*)mmtk_get_possibly_forwared(ma->a); ma->a = maybe_forwarded; pma = &ma->next; @@ -264,9 +265,6 @@ static void add_node_to_tpinned_roots_buffer(RootsWorkClosure* closure, RootsWor void scan_vm_specific_roots(RootsWorkClosure* closure) { - - - // Create a new buf RootsWorkBuffer buf = (closure->report_nodes_func)((void**)0, 0, 0, closure->data, true); size_t len = 0; @@ -294,8 +292,7 @@ void scan_vm_specific_roots(RootsWorkClosure* closure) add_node_to_roots_buffer(closure, &buf, &len, jl_emptytuple_type); add_node_to_roots_buffer(closure, &buf, &len, cmpswap_names); - - // jl_global_roots_table must be tpinned + // jl_global_roots_table must be transitively pinned RootsWorkBuffer tpinned_buf = (closure->report_tpinned_nodes_func)((void**)0, 0, 0, closure->data, true); size_t tpinned_len = 0; add_node_to_tpinned_roots_buffer(closure, &tpinned_buf, &tpinned_len, jl_global_roots_table); diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 552e4f04..12b2003a 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -474,6 +474,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.18.0" +source = "git+https://github.com/udesou/mmtk-core.git?rev=5a8c8a6ab69dda697e3ce58c15c5271558ae20e3#5a8c8a6ab69dda697e3ce58c15c5271558ae20e3" dependencies = [ "atomic 0.5.3", "atomic-traits", @@ -490,6 +491,7 @@ dependencies = [ "lazy_static", "libc", "log", + "memoffset", "mmtk-macros", "num-traits", "num_cpus", @@ -522,6 +524,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.18.0" +source = "git+https://github.com/udesou/mmtk-core.git?rev=5a8c8a6ab69dda697e3ce58c15c5271558ae20e3#5a8c8a6ab69dda697e3ce58c15c5271558ae20e3" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 7ff85937..b9f6c77b 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -31,10 +31,10 @@ lazy_static = "1.1" # - change branch # - change repo name # But other changes including adding/removing whitespaces in commented lines may break the CI -# mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "04a47feb4598b2120598453c2cceec83986c2122" } +mmtk = { git = "https://github.com/udesou/mmtk-core.git", rev = "5a8c8a6ab69dda697e3ce58c15c5271558ae20e3" } # Uncomment the following to build locally -mmtk = { path = "../../mmtk-core" } -log = {version = "0.4", features = ["max_level_debug", "release_max_level_off"] } +# mmtk = { path = "../../mmtk-core" } +log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] } enum-map = ">=2.1" atomic = "0.4.6" chrono = "*" diff --git a/mmtk/src/julia_scanning.rs b/mmtk/src/julia_scanning.rs index f328beed..eb866a04 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -128,11 +128,12 @@ pub unsafe fn scan_julia_object>(obj: Address, clos let owner_flags = (*array_owner).flags; if owner_flags.how_custom() == 0 { let offset_isize = (*array_owner).data as isize - array_owner as isize; - assert!( + debug_assert!( + // FIXME: might not hold after removing Julia's size classes offset_isize >= 0 && offset_isize <= 2032, "Offset is larger than small object size" - ); // FIXME: might not hold after removing Julia's size classes - assert!( + ); + debug_assert!( ((*array_owner).offset == 0 && (*array).offset == 0) || (*array).offset == (*array_owner).offset ); @@ -158,7 +159,6 @@ pub unsafe fn scan_julia_object>(obj: Address, clos } process_edge(closure, owner_addr); - return; } @@ -466,11 +466,10 @@ pub fn process_edge>(closure: &mut EV, slot: Addres simple_edge ); - let obj = simple_edge.load().to_raw_address().as_usize(); - // captures wrong edges before creating the work debug_assert!( - obj % 16 == 0 || obj % 8 == 0, + simple_edge.load().to_raw_address().as_usize() % 16 == 0 + || simple_edge.load().to_raw_address().as_usize() % 8 == 0, "Object {:?} in slot {:?} is not aligned to 8 or 16", simple_edge.load(), simple_edge diff --git a/mmtk/src/object_model.rs b/mmtk/src/object_model.rs index da361f93..2d296b4d 100644 --- a/mmtk/src/object_model.rs +++ b/mmtk/src/object_model.rs @@ -6,7 +6,6 @@ use crate::julia_scanning::{ }; use crate::{julia_types::*, UPCALLS}; use crate::{JuliaVM, JULIA_BUFF_TAG, JULIA_HEADER_SIZE}; -use atomic::Ordering; use log::info; use mmtk::util::copy::*; use mmtk::util::{Address, ObjectReference}; @@ -77,20 +76,6 @@ impl ObjectModel for VMObjectModel { } let to_obj = ObjectReference::from_raw_address(dst + header_offset); - // use std::fs::OpenOptions; - // use std::io::Write; - - // let mut file = OpenOptions::new() - // .write(true) - // .append(true) - // .create(true) - // .open("/home/eduardo/mmtk-julia/copied_objs.log") - // .unwrap(); - - // if let Err(e) = writeln!(file, "Copying object from {} to {}", from, to_obj) { - // eprintln!("Couldn't write to file: {}", e); - // } - info!("Copying object from {} to {}", from, to_obj); copy_context.post_copy(to_obj, bytes, semantics); @@ -103,17 +88,21 @@ impl ObjectModel for VMObjectModel { } } - // zero from_obj - unsafe { - libc::memset(from_start_ref.to_raw_address().to_mut_ptr(), 0, bytes); - } + // zero from_obj (for debugging purposes) + #[cfg(debug_assertions)] + { + use atomic::Ordering; + unsafe { + libc::memset(from_start_ref.to_raw_address().to_mut_ptr(), 0, bytes); + } - Self::LOCAL_FORWARDING_BITS_SPEC.store_atomic::( - from, - 0b10 as u8, // BEING_FORWARDED - None, - Ordering::SeqCst, - ); + Self::LOCAL_FORWARDING_BITS_SPEC.store_atomic::( + from, + 0b10 as u8, // BEING_FORWARDED + None, + Ordering::SeqCst, + ); + } to_obj } diff --git a/mmtk/src/scanning.rs b/mmtk/src/scanning.rs index cd6a2481..8c5d3dd3 100644 --- a/mmtk/src/scanning.rs +++ b/mmtk/src/scanning.rs @@ -41,12 +41,12 @@ impl Scanning for VMScanning { let mut node_buffer = vec![]; // Scan thread local from ptls: See gc_queue_thread_local in gc.c - let mut root_scan_task = |task: *const mmtk__jl_task_t, queue_task: bool| { + let mut root_scan_task = |task: *const mmtk__jl_task_t, task_is_root: bool| { if !task.is_null() { unsafe { crate::julia_scanning::mmtk_scan_gcstack(task, &mut edge_buffer); } - if queue_task { + if task_is_root { // captures wrong root nodes before creating the work debug_assert!( Address::from_ptr(task).as_usize() % 16 == 0 @@ -62,6 +62,7 @@ impl Scanning for VMScanning { root_scan_task(ptls.root_task, true); // need to iterate over live tasks as well to process their shadow stacks + // we should not set the task themselves as roots as we will know which ones are still alive after GC let mut i = 0; while i < ptls.heap.live_tasks.len { let mut task_address = Address::from_ptr(ptls.heap.live_tasks.items); From 08b1b461dc16e39c3ba1b8d85a564613d534c231 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 23 Aug 2023 00:43:50 +0000 Subject: [PATCH 05/41] Minor --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index b9f6c77b..113507f9 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -33,7 +33,7 @@ lazy_static = "1.1" # But other changes including adding/removing whitespaces in commented lines may break the CI mmtk = { git = "https://github.com/udesou/mmtk-core.git", rev = "5a8c8a6ab69dda697e3ce58c15c5271558ae20e3" } # Uncomment the following to build locally -# mmtk = { path = "../../mmtk-core" } +# mmtk = { path = "../repos/mmtk-core" } log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] } enum-map = ">=2.1" atomic = "0.4.6" From 82d8c4ea3257cf74297bdb8dd056e4e01bf64d85 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 23 Aug 2023 01:49:14 +0000 Subject: [PATCH 06/41] Adding comment about updating a->data when data is inlined --- julia/mmtk_julia.c | 8 +++++--- mmtk/src/julia_scanning.rs | 8 +++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/julia/mmtk_julia.c b/julia/mmtk_julia.c index 3dd327fd..0c34c1a1 100644 --- a/julia/mmtk_julia.c +++ b/julia/mmtk_julia.c @@ -21,6 +21,8 @@ extern void mmtk_store_obj_size_c(void* obj, size_t size); extern void jl_gc_free_array(jl_array_t *a); extern size_t mmtk_get_obj_size(void* obj); extern void jl_rng_split(uint64_t to[JL_RNG_SIZE], uint64_t from[JL_RNG_SIZE]); +extern void _jl_free_stack(jl_ptls_t ptls, void *stkbuf, size_t bufsz); +extern void free_stack(void *stkbuf, size_t bufsz); extern void* new_mutator_iterator(void); extern jl_ptls_t get_next_mutator_tls(void*); @@ -358,9 +360,9 @@ void update_inlined_array(void* from, void* to) { jl_array_t *a = (jl_array_t*)jl_from; jl_array_t *b = (jl_array_t*)jl_to; if (a->flags.how == 0 && mmtk_object_is_managed_by_mmtk(a->data)) { // a is inlined (a->data is an mmtk object) - size_t pre_data_bytes = ((size_t)a->data - a->offset*a->elsize) - (size_t)a; - if (pre_data_bytes > 0 && pre_data_bytes <= ARRAY_INLINE_NBYTES) { - b->data = (void*)((size_t) b + pre_data_bytes); + size_t offset_of_data = ((size_t)a->data - a->offset*a->elsize) - (size_t)a; + if (offset_of_data > 0 && offset_of_data <= ARRAY_INLINE_NBYTES) { + b->data = (void*)((size_t) b + offset_of_data); } } } diff --git a/mmtk/src/julia_scanning.rs b/mmtk/src/julia_scanning.rs index eb866a04..5580334a 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -90,7 +90,13 @@ pub unsafe fn scan_julia_object>(obj: Address, clos let array = obj.to_ptr::(); let flags = (*array).flags; - if flags.how_custom() == 1 { + if flags.how_custom() == 0 { + // data is inlined, or a foreign pointer we don't manage + // if data is inlined (i.e. it is an internal pointer) and the array moves, + // a->data is currently updated when copying the array since there may be other hidden + // fields before the inlined data affecting the offset in which a->data points to + // see jl_array_t in julia.h + } else if flags.how_custom() == 1 { // julia-allocated buffer that needs to be marked let offset = (*array).offset as usize * (*array).elsize as usize; let data_addr = ::std::ptr::addr_of!((*array).data); From b2c81f01b29c722227bd9a009748deee47eda34a Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 23 Aug 2023 02:18:51 +0000 Subject: [PATCH 07/41] Temporarily updating the julia_version, so the tests in the CI uses the correct version --- mmtk/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 113507f9..8b58d8a6 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -9,8 +9,8 @@ edition = "2018" # Metadata for the Julia repository [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. -julia_repo = "https://github.com/mmtk/julia.git" -julia_version = "5733c287d803316e6da1771db35e49c767804112" +julia_repo = "https://github.com/udesou/julia.git" +julia_version = "9314e70d61e0684c79e2a9c9f76065cf86d526e4" [lib] crate-type = ["cdylib"] From 5b6678241aad05ebc6017af81bf21a7809831915 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 23 Aug 2023 05:02:19 +0000 Subject: [PATCH 08/41] Updating reference to mmtk core; switching log from info to trace for when copying objects --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 4 ++-- mmtk/src/object_model.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 12b2003a..505ce7c3 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -474,7 +474,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.18.0" -source = "git+https://github.com/udesou/mmtk-core.git?rev=5a8c8a6ab69dda697e3ce58c15c5271558ae20e3#5a8c8a6ab69dda697e3ce58c15c5271558ae20e3" +source = "git+https://github.com/udesou/mmtk-core.git?rev=48dde0783407ec16fa6fc048391758aca38aba93#48dde0783407ec16fa6fc048391758aca38aba93" dependencies = [ "atomic 0.5.3", "atomic-traits", @@ -524,7 +524,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.18.0" -source = "git+https://github.com/udesou/mmtk-core.git?rev=5a8c8a6ab69dda697e3ce58c15c5271558ae20e3#5a8c8a6ab69dda697e3ce58c15c5271558ae20e3" +source = "git+https://github.com/udesou/mmtk-core.git?rev=48dde0783407ec16fa6fc048391758aca38aba93#48dde0783407ec16fa6fc048391758aca38aba93" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 8b58d8a6..4d55cc72 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -31,7 +31,7 @@ lazy_static = "1.1" # - change branch # - change repo name # But other changes including adding/removing whitespaces in commented lines may break the CI -mmtk = { git = "https://github.com/udesou/mmtk-core.git", rev = "5a8c8a6ab69dda697e3ce58c15c5271558ae20e3" } +mmtk = { git = "https://github.com/udesou/mmtk-core.git", rev = "48dde0783407ec16fa6fc048391758aca38aba93" } # Uncomment the following to build locally # mmtk = { path = "../repos/mmtk-core" } log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] } @@ -49,7 +49,7 @@ default = ["mmtk/vm_space", "julia_copy_stack", "object_pinning"] # Plans nogc = [] immix = [] -stickyimmix = ["non_moving_immix"] +stickyimmix = ["mmtk/sticky_immix_non_moving_nursery"] marksweep = [] object_pinning = ["mmtk/object_pinning"] diff --git a/mmtk/src/object_model.rs b/mmtk/src/object_model.rs index 2d296b4d..aa643d10 100644 --- a/mmtk/src/object_model.rs +++ b/mmtk/src/object_model.rs @@ -6,7 +6,7 @@ use crate::julia_scanning::{ }; use crate::{julia_types::*, UPCALLS}; use crate::{JuliaVM, JULIA_BUFF_TAG, JULIA_HEADER_SIZE}; -use log::info; +use log::trace; use mmtk::util::copy::*; use mmtk::util::{Address, ObjectReference}; use mmtk::vm::ObjectModel; @@ -76,7 +76,7 @@ impl ObjectModel for VMObjectModel { } let to_obj = ObjectReference::from_raw_address(dst + header_offset); - info!("Copying object from {} to {}", from, to_obj); + trace!("Copying object from {} to {}", from, to_obj); copy_context.post_copy(to_obj, bytes, semantics); From bd8bdc28ad78480ae6b353d37bb73e745d8dab19 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 23 Aug 2023 05:02:43 +0000 Subject: [PATCH 09/41] Skipping tests that check for number of stock GC threads --- .github/scripts/ci-test-patching.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/scripts/ci-test-patching.sh b/.github/scripts/ci-test-patching.sh index 19a9cbbe..cc8ff0b3 100755 --- a/.github/scripts/ci-test-patching.sh +++ b/.github/scripts/ci-test-patching.sh @@ -16,6 +16,17 @@ declare -a tests_to_skip=( # This test checks GC logging '@test occursin("GC: pause", read(tmppath, String))' "$JULIA_PATH/test/misc.jl" + + # These tests check for the number of stock GC threads (which we set to 0 with mmtk) + '@test (cpu_threads == 1 ? "1" : string(div(cpu_threads, 2))) == + read(`$exename --threads auto -e $code`, String) == + read(`$exename --threads=auto -e $code`, String) == + read(`$exename -tauto -e $code`, String) == + read(`$exename -t auto -e $code`, String)' "$JULIA_PATH/test/cmdlineargs.jl" + + '@test read(`$exename --gcthreads=2 -e $code`, String) == "2"' "$JULIA_PATH/test/cmdlineargs.jl" + + '@test read(`$exename -e $code`, String) == "2"' "$JULIA_PATH/test/cmdlineargs.jl" ) for (( i=0; i < ${#tests_to_skip[@]}; i+=2 )); do From 03f4763828c6b98e99dc1a2c393beb80035b3f6d Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 23 Aug 2023 05:21:24 +0000 Subject: [PATCH 10/41] Testing with mmtk-core with STRESS_DEFRAG and DEFRAG_EVERY_BLOCK set to true --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 505ce7c3..34a663ad 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -474,7 +474,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.18.0" -source = "git+https://github.com/udesou/mmtk-core.git?rev=48dde0783407ec16fa6fc048391758aca38aba93#48dde0783407ec16fa6fc048391758aca38aba93" +source = "git+https://github.com/udesou/mmtk-core.git?rev=cb73c2983faae38017236ef5d3e327be4c6fa358#cb73c2983faae38017236ef5d3e327be4c6fa358" dependencies = [ "atomic 0.5.3", "atomic-traits", @@ -524,7 +524,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.18.0" -source = "git+https://github.com/udesou/mmtk-core.git?rev=48dde0783407ec16fa6fc048391758aca38aba93#48dde0783407ec16fa6fc048391758aca38aba93" +source = "git+https://github.com/udesou/mmtk-core.git?rev=cb73c2983faae38017236ef5d3e327be4c6fa358#cb73c2983faae38017236ef5d3e327be4c6fa358" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 4d55cc72..c64baa38 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -31,7 +31,7 @@ lazy_static = "1.1" # - change branch # - change repo name # But other changes including adding/removing whitespaces in commented lines may break the CI -mmtk = { git = "https://github.com/udesou/mmtk-core.git", rev = "48dde0783407ec16fa6fc048391758aca38aba93" } +mmtk = { git = "https://github.com/udesou/mmtk-core.git", rev = "cb73c2983faae38017236ef5d3e327be4c6fa358" } # Uncomment the following to build locally # mmtk = { path = "../repos/mmtk-core" } log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] } From 37bada0a1748c89780995826fabaab276001a1ed Mon Sep 17 00:00:00 2001 From: Luis Eduardo de Souza Amorim Date: Wed, 23 Aug 2023 06:15:17 +0000 Subject: [PATCH 11/41] Second attempt to try to skip tests for number of stock GC threads --- .github/scripts/ci-test-patching.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/scripts/ci-test-patching.sh b/.github/scripts/ci-test-patching.sh index cc8ff0b3..50942842 100755 --- a/.github/scripts/ci-test-patching.sh +++ b/.github/scripts/ci-test-patching.sh @@ -18,14 +18,8 @@ declare -a tests_to_skip=( '@test occursin("GC: pause", read(tmppath, String))' "$JULIA_PATH/test/misc.jl" # These tests check for the number of stock GC threads (which we set to 0 with mmtk) - '@test (cpu_threads == 1 ? "1" : string(div(cpu_threads, 2))) == - read(`$exename --threads auto -e $code`, String) == - read(`$exename --threads=auto -e $code`, String) == - read(`$exename -tauto -e $code`, String) == - read(`$exename -t auto -e $code`, String)' "$JULIA_PATH/test/cmdlineargs.jl" - + '@test (cpu_threads == 1 ? "1" : string(div(cpu_threads, 2))) ==' "$JULIA_PATH/test/cmdlineargs.jl" '@test read(`$exename --gcthreads=2 -e $code`, String) == "2"' "$JULIA_PATH/test/cmdlineargs.jl" - '@test read(`$exename -e $code`, String) == "2"' "$JULIA_PATH/test/cmdlineargs.jl" ) From 9eb3df410439db019549dc875c59e6c913ba027b Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 24 Aug 2023 04:04:52 +0000 Subject: [PATCH 12/41] Using mmtk without stress copying --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index c64baa38..4d55cc72 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -31,7 +31,7 @@ lazy_static = "1.1" # - change branch # - change repo name # But other changes including adding/removing whitespaces in commented lines may break the CI -mmtk = { git = "https://github.com/udesou/mmtk-core.git", rev = "cb73c2983faae38017236ef5d3e327be4c6fa358" } +mmtk = { git = "https://github.com/udesou/mmtk-core.git", rev = "48dde0783407ec16fa6fc048391758aca38aba93" } # Uncomment the following to build locally # mmtk = { path = "../repos/mmtk-core" } log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] } From 22a8003771543de73a1fdbe17c3a0989014e7e09 Mon Sep 17 00:00:00 2001 From: Luis Eduardo de Souza Amorim Date: Thu, 24 Aug 2023 04:13:34 +0000 Subject: [PATCH 13/41] Using side metadata to implement forwarding bits --- mmtk/src/object_model.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mmtk/src/object_model.rs b/mmtk/src/object_model.rs index aa643d10..ce152430 100644 --- a/mmtk/src/object_model.rs +++ b/mmtk/src/object_model.rs @@ -40,8 +40,14 @@ impl ObjectModel for VMObjectModel { const GLOBAL_LOG_BIT_SPEC: VMGlobalLogBitSpec = LOGGING_SIDE_METADATA_SPEC; const LOCAL_FORWARDING_POINTER_SPEC: VMLocalForwardingPointerSpec = VMLocalForwardingPointerSpec::in_header(-64); + + #[cfg(feature = "object_pinning")] + const LOCAL_FORWARDING_BITS_SPEC: VMLocalForwardingBitsSpec = + VMLocalForwardingBitsSpec::side_after(LOCAL_PINNING_METADATA_BITS_SPEC.as_spec()); + #[cfg(not(feature = "object_pinning"))] const LOCAL_FORWARDING_BITS_SPEC: VMLocalForwardingBitsSpec = - VMLocalForwardingBitsSpec::in_header(-64); + VMLocalForwardingBitsSpec::side_after(MARKING_METADATA_SPEC.as_spec()); + const LOCAL_MARK_BIT_SPEC: VMLocalMarkBitSpec = MARKING_METADATA_SPEC; const LOCAL_LOS_MARK_NURSERY_SPEC: VMLocalLOSMarkNurserySpec = LOS_METADATA_SPEC; const UNIFIED_OBJECT_REFERENCE_ADDRESS: bool = false; From 48a673bd690244c98480450e22f53f660f22ac74 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 24 Aug 2023 04:47:30 +0000 Subject: [PATCH 14/41] Applying cargo fmt --- mmtk/src/object_model.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/src/object_model.rs b/mmtk/src/object_model.rs index ce152430..ed838ff1 100644 --- a/mmtk/src/object_model.rs +++ b/mmtk/src/object_model.rs @@ -40,7 +40,7 @@ impl ObjectModel for VMObjectModel { const GLOBAL_LOG_BIT_SPEC: VMGlobalLogBitSpec = LOGGING_SIDE_METADATA_SPEC; const LOCAL_FORWARDING_POINTER_SPEC: VMLocalForwardingPointerSpec = VMLocalForwardingPointerSpec::in_header(-64); - + #[cfg(feature = "object_pinning")] const LOCAL_FORWARDING_BITS_SPEC: VMLocalForwardingBitsSpec = VMLocalForwardingBitsSpec::side_after(LOCAL_PINNING_METADATA_BITS_SPEC.as_spec()); From 9cb83034d958d1ba8952bc6bfedbb65fdf010645 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 7 Sep 2023 00:05:38 +0000 Subject: [PATCH 15/41] Enabling moving only for immix for now --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 7518fe74..4cc257f4 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -49,7 +49,7 @@ default = ["mmtk/vm_space", "julia_copy_stack", "object_pinning"] # Plans nogc = [] immix = [] -stickyimmix = ["mmtk/sticky_immix_non_moving_nursery"] +stickyimmix = ["non_moving_immix"] marksweep = [] object_pinning = ["mmtk/object_pinning"] From 3cff40b81ea79f8e4ebe556a61ce67bf4038c6ce Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 7 Sep 2023 00:08:20 +0000 Subject: [PATCH 16/41] Applying cargo fmt --- mmtk/src/scanning.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmtk/src/scanning.rs b/mmtk/src/scanning.rs index 1b72421b..d62ecea9 100644 --- a/mmtk/src/scanning.rs +++ b/mmtk/src/scanning.rs @@ -30,7 +30,7 @@ impl Scanning for VMScanning { impl mmtk::vm::EdgeVisitor for EdgeBuffer { fn visit_edge(&mut self, edge: JuliaVMEdge) { match edge { - JuliaVMEdge::Simple(se) => { + JuliaVMEdge::Simple(se) => { let slot = se.as_address(); let object = unsafe { slot.load::() }; self.buffer.push(object); @@ -38,7 +38,7 @@ impl Scanning for VMScanning { JuliaVMEdge::Offset(_) => { unimplemented!() // transitively pinned roots in Julia only come from the stack } - } + } } } From 7b449aa483bf93f77ec3d90fbde835a5605d79da Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Mon, 11 Sep 2023 00:08:39 +0000 Subject: [PATCH 17/41] Setting up smaller block for sticky immix, and only move objects in mature collections --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 4cc257f4..7033031b 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -49,7 +49,7 @@ default = ["mmtk/vm_space", "julia_copy_stack", "object_pinning"] # Plans nogc = [] immix = [] -stickyimmix = ["non_moving_immix"] +stickyimmix = ["mmtk/sticky_immix_non_moving_nursery", "mmtk/immix_smaller_block"] marksweep = [] object_pinning = ["mmtk/object_pinning"] From fe9d0e2af226cfd39a2cd3b7a003a64ff42630e6 Mon Sep 17 00:00:00 2001 From: Luis Eduardo de Souza Amorim Date: Fri, 15 Sep 2023 06:50:42 +0000 Subject: [PATCH 18/41] Removing if statement in mmtk_pin_object; Pinning owners and buffers to avoid introspecting into owner object during scanning --- mmtk/Cargo.toml | 2 +- mmtk/src/api.rs | 14 ++++---- mmtk/src/julia_scanning.rs | 69 ++++++-------------------------------- 3 files changed, 20 insertions(+), 65 deletions(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 857b20bb..7fda4dc6 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. julia_repo = "https://github.com/udesou/julia.git" -julia_version = "d14df55c99560ba629aae8f01202f84256677ccb" +julia_version = "f9da153bddb2b494feb3cd1840021ea574aa7f36" [lib] crate-type = ["cdylib"] diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 4c8cb0f3..27a8c95a 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -521,18 +521,20 @@ pub extern "C" fn mmtk_get_obj_size(obj: ObjectReference) -> usize { #[cfg(feature = "object_pinning")] #[no_mangle] pub extern "C" fn mmtk_pin_object(object: ObjectReference) -> bool { - if !mmtk_object_is_managed_by_mmtk(object.to_raw_address().as_usize()) { - return false; - } + debug_assert!( + mmtk_object_is_managed_by_mmtk(object.to_raw_address().as_usize()), + "Object is not managed by mmtk - pinning it via this function isn't supported." + ); memory_manager::pin_object::(object) } #[cfg(feature = "object_pinning")] #[no_mangle] pub extern "C" fn mmtk_unpin_object(object: ObjectReference) -> bool { - if !mmtk_object_is_managed_by_mmtk(object.to_raw_address().as_usize()) { - return false; - } + debug_assert!( + mmtk_object_is_managed_by_mmtk(object.to_raw_address().as_usize()), + "Object is not managed by mmtk - pinning it via this function isn't supported." + ); memory_manager::unpin_object::(object) } diff --git a/mmtk/src/julia_scanning.rs b/mmtk/src/julia_scanning.rs index 5580334a..102f5e6a 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -1,9 +1,9 @@ +use crate::api::mmtk_is_pinned; use crate::api::mmtk_object_is_managed_by_mmtk; use crate::edges::JuliaVMEdge; use crate::edges::OffsetEdge; use crate::julia_types::*; use crate::object_model::mmtk_jl_array_ndims; -use crate::util::mmtk_get_possibly_forwared; use crate::JULIA_BUFF_TAG; use crate::UPCALLS; use memoffset::offset_of; @@ -107,63 +107,16 @@ pub unsafe fn scan_julia_object>(obj: Address, clos } else if flags.how_custom() == 3 { // has a pointer to the object that owns the data let owner_addr = mmtk_jl_array_data_owner_addr(array); - - if mmtk_object_is_managed_by_mmtk((*array).data as usize) { - let data_owner = owner_addr.load::(); - // if the owner moves and a->data points to it, it needs to be updated as well - // first check if it has moved already (as we need to query type info from it) - let owner = - if mmtk_object_is_managed_by_mmtk(data_owner.to_raw_address().as_usize()) { - mmtk_get_possibly_forwared(data_owner) - } else { - data_owner - }; - - // owner may be either a string or another array - let owner_type = mmtk_jl_typeof(owner.to_raw_address()); - if owner_type == jl_string_type { - // if it is a string, a->data will point into the string object (not always the beginning of the string!!!) - // see (#define jl_string_data(s) ((char*)s + sizeof(void*)) from julia.h - let offset = std::mem::size_of::<*const ::std::os::raw::c_void>() - + ((*array).offset as usize * (*array).elsize as usize); - let data_addr = ::std::ptr::addr_of!((*array).data); - process_offset_edge(closure, Address::from_ptr(data_addr), offset); - } else if (*owner_type).name == jl_array_typename { - // if it is an array we need to check with type of array it is to update the a->data accordingly - let array_owner = owner.to_raw_address().to_ptr::(); - let owner_flags = (*array_owner).flags; - if owner_flags.how_custom() == 0 { - let offset_isize = (*array_owner).data as isize - array_owner as isize; - debug_assert!( - // FIXME: might not hold after removing Julia's size classes - offset_isize >= 0 && offset_isize <= 2032, - "Offset is larger than small object size" - ); - debug_assert!( - ((*array_owner).offset == 0 && (*array).offset == 0) - || (*array).offset == (*array_owner).offset - ); - // owner has inlined data => a->data is an internal pointer into owner (not always the beginning of owner.data!!) - let offset = offset_isize as usize - + ((*array).offset as usize * (*array).elsize as usize); - let data_addr = ::std::ptr::addr_of!((*array).data); - process_offset_edge(closure, Address::from_ptr(data_addr), offset); - } else if owner_flags.how_custom() == 1 { - // the data inside the owner array is a julia allocated buffer (which at least currently is always pinned) - // FIXME: if buffers may move a->data needs to be updated! - } else if owner_flags.how_custom() == 2 { - // the data inside the owner array is malloc-allocated - // don't need to do anything because the malloc-allocated data won't move - } else if owner_flags.how_custom() == 3 { - // owner itself has a pointer to another owner - println!("owner_flags.how = 3"); - unreachable!() // FIXME: is this even possible? - } - } else { - unreachable!() - } - } - + // to avoid having to update a->data, which requires introspecting the owner object + // we simply expect that both owner and buffers are pinned + assert!( + (mmtk_object_is_managed_by_mmtk(owner_addr.load()) + && mmtk_is_pinned(owner_addr.load()) + || !(mmtk_object_is_managed_by_mmtk(owner_addr.load()))), + "Owner ({:?}) may move (is_pinned = {}), a->data may become outdated!", + owner_addr.load::(), + mmtk_is_pinned(owner_addr.load()) + ); process_edge(closure, owner_addr); return; } From a9a17835c51894e01d065f523f42d21453e781f2 Mon Sep 17 00:00:00 2001 From: Luis Eduardo de Souza Amorim Date: Fri, 15 Sep 2023 06:54:56 +0000 Subject: [PATCH 19/41] Updating julia version --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 7fda4dc6..d3c3504d 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. julia_repo = "https://github.com/udesou/julia.git" -julia_version = "f9da153bddb2b494feb3cd1840021ea574aa7f36" +julia_version = "cfb6d90e1fcba32a088f073ebf71ac6a98f2cf1d" [lib] crate-type = ["cdylib"] From 5a392513aba4af6f844f06576089a2eb8d9cdf30 Mon Sep 17 00:00:00 2001 From: Luis Eduardo de Souza Amorim Date: Mon, 18 Sep 2023 01:32:52 +0000 Subject: [PATCH 20/41] Changing assert to debug_assert --- mmtk/src/julia_scanning.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/src/julia_scanning.rs b/mmtk/src/julia_scanning.rs index 102f5e6a..c07f413e 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -109,7 +109,7 @@ pub unsafe fn scan_julia_object>(obj: Address, clos let owner_addr = mmtk_jl_array_data_owner_addr(array); // to avoid having to update a->data, which requires introspecting the owner object // we simply expect that both owner and buffers are pinned - assert!( + debug_assert!( (mmtk_object_is_managed_by_mmtk(owner_addr.load()) && mmtk_is_pinned(owner_addr.load()) || !(mmtk_object_is_managed_by_mmtk(owner_addr.load()))), From 9330aa239554fe2d23e3fa76796daa8da6bc8dbf Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Mon, 30 Oct 2023 23:36:24 +0000 Subject: [PATCH 21/41] Changing loop in mmtk_disable_connection to if clause --- mmtk/src/api.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 32f3a890..5be816de 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -256,7 +256,7 @@ pub extern "C" fn mmtk_disable_collection() { } // if user has triggered GC, wait until GC is finished - while AtomicIsize::load(&USER_TRIGGERED_GC, Ordering::SeqCst) != 0 + if AtomicIsize::load(&USER_TRIGGERED_GC, Ordering::SeqCst) != 0 || AtomicBool::load(&BLOCK_FOR_GC, Ordering::SeqCst) { info!("Waiting for a triggered gc to finish..."); From 26bfa3b5636b5b2a8b0ff80b1509bb5f21bc15f6 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Tue, 31 Oct 2023 23:10:24 +0000 Subject: [PATCH 22/41] Setting JULIA_NUM_THREADS back to 1 since the CI tests are not safe to run with multiple threads --- .github/scripts/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/common.sh b/.github/scripts/common.sh index 13ef3cf5..748b6149 100644 --- a/.github/scripts/common.sh +++ b/.github/scripts/common.sh @@ -24,7 +24,7 @@ ci_run_jl_test() { cd $JULIA_PATH export JULIA_CPU_THREADS=$threads - export JULIA_NUM_THREADS=4 # set default to 4 mutator threads to try to capture bad races + export JULIA_NUM_THREADS=1 # Julia CI tests are not safe to run with multiple threads (yet!) # Directly run runtests.jl: There could be some issues with some test suites. We better just use their build script. # $JULIA_PATH/julia $JULIA_TEST_ARGS $JULIA_PATH/test/runtests.jl --exit-on-error $test From b7d5345393359bcf9884725d35126da1ce653949 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 1 Feb 2024 01:46:06 +0000 Subject: [PATCH 23/41] Removing functions to call mmtk's enable and disable collection --- mmtk/Cargo.toml | 6 +++--- mmtk/src/api.rs | 24 ------------------------ mmtk/src/collection.rs | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 27 deletions(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 9c1d1287..8c514be9 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -9,8 +9,8 @@ edition = "2018" # Metadata for the Julia repository [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. -julia_repo = "https://github.com/mmtk/julia.git" -julia_version = "5c406d9bb20d76e2298a6101f171cfac491f651c" +julia_repo = "https://github.com/udesou/julia.git" +julia_version = "4792b73132850aa153fe22023b8a45af29a3554f" [lib] crate-type = ["cdylib"] @@ -31,7 +31,7 @@ lazy_static = "1.1" # - change branch # - change repo name # But other changes including adding/removing whitespaces in commented lines may break the CI -mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev="ef2bd6d043d8675badaa415db89be7b52439725f" } +mmtk = { git = "https://github.com/udesou/mmtk-core.git", rev="e9660c7ffca6a0d7fb5efb159482d89053f5d203" } # Uncomment the following to build locally # mmtk = { path = "../repos/mmtk-core" } log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] } diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 0e647ed2..5bdfd7e6 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -240,30 +240,6 @@ pub extern "C" fn mmtk_initialize_collection(tls: VMThread) { memory_manager::initialize_collection(&SINGLETON, tls); } -#[no_mangle] -pub extern "C" fn mmtk_enable_collection() { - if AtomicBool::load(&DISABLED_GC, Ordering::SeqCst) { - memory_manager::enable_collection(&SINGLETON); - AtomicBool::store(&DISABLED_GC, false, Ordering::SeqCst); - } -} - -#[no_mangle] -pub extern "C" fn mmtk_disable_collection() { - if AtomicBool::load(&DISABLED_GC, Ordering::SeqCst) == false { - AtomicBool::store(&DISABLED_GC, true, Ordering::SeqCst); - memory_manager::disable_collection(&SINGLETON); - } - - // if user has triggered GC, wait until GC is finished - while AtomicIsize::load(&USER_TRIGGERED_GC, Ordering::SeqCst) != 0 - || AtomicBool::load(&BLOCK_FOR_GC, Ordering::SeqCst) - { - info!("Waiting for a triggered gc to finish..."); - unsafe { ((*UPCALLS).wait_in_a_safepoint)() }; - } -} - #[no_mangle] pub extern "C" fn mmtk_used_bytes() -> usize { memory_manager::used_bytes(&SINGLETON) diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index a2c30c14..92e157c8 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -11,6 +11,10 @@ use crate::{BLOCK_FOR_GC, STW_COND, WORLD_HAS_STOPPED}; static GC_START: AtomicU64 = AtomicU64::new(0); +extern "C" { + pub static jl_gc_disable_counter: AtomicU32; +} + pub struct VMCollection {} impl Collection for VMCollection { @@ -100,6 +104,17 @@ impl Collection for VMCollection { fn vm_live_bytes() -> usize { crate::api::JULIA_MALLOC_BYTES.load(Ordering::SeqCst) } + + fn is_collection_enabled() -> bool { + unsafe { + AtomicU32::load( + ::std::mem::transmute::<*const AtomicU32, &AtomicU32>(::std::ptr::addr_of!( + jl_gc_disable_counter + )), + Ordering::SeqCst, + ) == 0 + } + } } pub fn is_current_gc_nursery() -> bool { From 7334764f15392d74af5cd470c4854e4e2138f01f Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 1 Feb 2024 01:53:36 +0000 Subject: [PATCH 24/41] Forgot a few missing references --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- mmtk/api/mmtk.h | 2 -- mmtk/src/api.rs | 1 - mmtk/src/collection.rs | 2 +- 5 files changed, 4 insertions(+), 7 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index c8d073e8..49330c8d 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -449,7 +449,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.22.1" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=ef2bd6d043d8675badaa415db89be7b52439725f#ef2bd6d043d8675badaa415db89be7b52439725f" +source = "git+https://github.com/udesou/mmtk-core.git?rev=e9660c7ffca6a0d7fb5efb159482d89053f5d203#e9660c7ffca6a0d7fb5efb159482d89053f5d203" dependencies = [ "atomic 0.6.0", "atomic-traits", @@ -500,7 +500,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.22.1" -source = "git+https://github.com/mmtk/mmtk-core.git?rev=ef2bd6d043d8675badaa415db89be7b52439725f#ef2bd6d043d8675badaa415db89be7b52439725f" +source = "git+https://github.com/udesou/mmtk-core.git?rev=e9660c7ffca6a0d7fb5efb159482d89053f5d203#e9660c7ffca6a0d7fb5efb159482d89053f5d203" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 8c514be9..8608c1be 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. julia_repo = "https://github.com/udesou/julia.git" -julia_version = "4792b73132850aa153fe22023b8a45af29a3554f" +julia_version = "4e057c98921ee71c4b86553df039923857a72c8f" [lib] crate-type = ["cdylib"] diff --git a/mmtk/api/mmtk.h b/mmtk/api/mmtk.h index e3d10c4a..9ddd411b 100644 --- a/mmtk/api/mmtk.h +++ b/mmtk/api/mmtk.h @@ -95,8 +95,6 @@ extern bool mmtk_process(char* name, char* value); extern void mmtk_scan_region(void); extern void mmtk_handle_user_collection_request(void *tls, uint8_t collection); extern void mmtk_initialize_collection(void* tls); -extern void mmtk_enable_collection(void); -extern void mmtk_disable_collection(void); extern void mmtk_start_control_collector(void *tls); extern void mmtk_start_worker(void *tls, void* worker, void* mmtk); extern void mmtk_process_julia_obj(void* addr); diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 5bdfd7e6..a8eaa11a 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -3,7 +3,6 @@ use crate::JuliaVM; use crate::Julia_Upcalls; -use crate::BLOCK_FOR_GC; use crate::JULIA_HEADER_SIZE; use crate::SINGLETON; use crate::UPCALLS; diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index 92e157c8..c648fe90 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -5,7 +5,7 @@ use mmtk::util::alloc::AllocationError; use mmtk::util::opaque_pointer::*; use mmtk::vm::{Collection, GCThreadContext}; use mmtk::Mutator; -use std::sync::atomic::{AtomicBool, AtomicIsize, AtomicU64, Ordering}; +use std::sync::atomic::{AtomicBool, AtomicIsize, AtomicU32, AtomicU64, Ordering}; use crate::{BLOCK_FOR_GC, STW_COND, WORLD_HAS_STOPPED}; From de4c24c911f26d378972f51eb8c95dd4b40385b4 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 1 Feb 2024 01:58:20 +0000 Subject: [PATCH 25/41] Updating julia_version --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 8608c1be..be37f2e6 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. julia_repo = "https://github.com/udesou/julia.git" -julia_version = "4e057c98921ee71c4b86553df039923857a72c8f" +julia_version = "1348e5009adf133f3631c82875c4096667ca760c" [lib] crate-type = ["cdylib"] From 44cc4d6726de02a692eaceafe7da9469837e5c8a Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 1 Feb 2024 02:08:17 +0000 Subject: [PATCH 26/41] Updating julia_repo --- mmtk/Cargo.toml | 2 +- mmtk/src/collection.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index be37f2e6..b45bd47a 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. julia_repo = "https://github.com/udesou/julia.git" -julia_version = "1348e5009adf133f3631c82875c4096667ca760c" +julia_version = "125d05e1f11dd9e5add538d6c17fcd39474af711" [lib] crate-type = ["cdylib"] diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index c648fe90..241e2531 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -112,7 +112,7 @@ impl Collection for VMCollection { jl_gc_disable_counter )), Ordering::SeqCst, - ) == 0 + ) <= 0 } } } From 9c8a332425aeaef364dd71632eab9215d786e111 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Thu, 1 Feb 2024 02:53:28 +0000 Subject: [PATCH 27/41] Updating julia_version --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index b45bd47a..df3700e5 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. julia_repo = "https://github.com/udesou/julia.git" -julia_version = "125d05e1f11dd9e5add538d6c17fcd39474af711" +julia_version = "99aa5dd6289ac5445f9f019c4d8c4284fe5da0ba" [lib] crate-type = ["cdylib"] From 8305df05ef80ebe8f0cb5e1ac75c077e3a038438 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 7 Feb 2024 00:07:18 +0000 Subject: [PATCH 28/41] Simplifying is_collection_enabled --- mmtk/src/collection.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/mmtk/src/collection.rs b/mmtk/src/collection.rs index 241e2531..230f74cb 100644 --- a/mmtk/src/collection.rs +++ b/mmtk/src/collection.rs @@ -106,14 +106,7 @@ impl Collection for VMCollection { } fn is_collection_enabled() -> bool { - unsafe { - AtomicU32::load( - ::std::mem::transmute::<*const AtomicU32, &AtomicU32>(::std::ptr::addr_of!( - jl_gc_disable_counter - )), - Ordering::SeqCst, - ) <= 0 - } + unsafe { AtomicU32::load(&jl_gc_disable_counter, Ordering::SeqCst) <= 0 } } } From b652ee4445489d5c03a583d6df5ebe68042179ca Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 7 Feb 2024 01:08:40 +0000 Subject: [PATCH 29/41] Updating julia_version --- mmtk/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index df3700e5..486225ac 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -9,8 +9,8 @@ edition = "2018" # Metadata for the Julia repository [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. -julia_repo = "https://github.com/udesou/julia.git" -julia_version = "99aa5dd6289ac5445f9f019c4d8c4284fe5da0ba" +julia_repo = "https://github.com/mmtk/julia.git" +julia_version = "22524a81f9920a8ecc70f195d53b145761de2fa0" [lib] crate-type = ["cdylib"] From 20e3216c883b0680dfc6f0a2d3b6ed7eeffcd5b3 Mon Sep 17 00:00:00 2001 From: mmtkgc-bot Date: Wed, 7 Feb 2024 04:05:09 +0000 Subject: [PATCH 30/41] Update mmtk-core to 7cafe560139211c0e3a74815d2e288278506099d --- mmtk/Cargo.lock | 4 ++-- mmtk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 49330c8d..be0729cf 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -449,7 +449,7 @@ dependencies = [ [[package]] name = "mmtk" version = "0.22.1" -source = "git+https://github.com/udesou/mmtk-core.git?rev=e9660c7ffca6a0d7fb5efb159482d89053f5d203#e9660c7ffca6a0d7fb5efb159482d89053f5d203" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=7cafe560139211c0e3a74815d2e288278506099d#7cafe560139211c0e3a74815d2e288278506099d" dependencies = [ "atomic 0.6.0", "atomic-traits", @@ -500,7 +500,7 @@ dependencies = [ [[package]] name = "mmtk-macros" version = "0.22.1" -source = "git+https://github.com/udesou/mmtk-core.git?rev=e9660c7ffca6a0d7fb5efb159482d89053f5d203#e9660c7ffca6a0d7fb5efb159482d89053f5d203" +source = "git+https://github.com/mmtk/mmtk-core.git?rev=7cafe560139211c0e3a74815d2e288278506099d#7cafe560139211c0e3a74815d2e288278506099d" dependencies = [ "proc-macro-error", "proc-macro2", diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 486225ac..fe5fac16 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -31,7 +31,7 @@ lazy_static = "1.1" # - change branch # - change repo name # But other changes including adding/removing whitespaces in commented lines may break the CI -mmtk = { git = "https://github.com/udesou/mmtk-core.git", rev="e9660c7ffca6a0d7fb5efb159482d89053f5d203" } +mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev="7cafe560139211c0e3a74815d2e288278506099d" } # Uncomment the following to build locally # mmtk = { path = "../repos/mmtk-core" } log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] } From e5f8c1a61bebdf8739a0ce0e991a9a102d3c5516 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 7 Feb 2024 05:02:49 +0000 Subject: [PATCH 31/41] Updating julia_version --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 75316ca2..a0f23859 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. julia_repo = "https://github.com/udesou/julia.git" -julia_version = "cfb6d90e1fcba32a088f073ebf71ac6a98f2cf1d" +julia_version = "25c06e0e25261622c1d404b0c567d1ec35635da5" [lib] crate-type = ["cdylib"] From 33b8cf3b59bdabb00ddc463e05954b2a1c5b4017 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Wed, 7 Feb 2024 05:42:15 +0000 Subject: [PATCH 32/41] Only add non-null objects as roots --- mmtk/src/scanning.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mmtk/src/scanning.rs b/mmtk/src/scanning.rs index d62ecea9..e3a000a3 100644 --- a/mmtk/src/scanning.rs +++ b/mmtk/src/scanning.rs @@ -33,7 +33,9 @@ impl Scanning for VMScanning { JuliaVMEdge::Simple(se) => { let slot = se.as_address(); let object = unsafe { slot.load::() }; - self.buffer.push(object); + if !object.is_null() { + self.buffer.push(object); + } } JuliaVMEdge::Offset(_) => { unimplemented!() // transitively pinned roots in Julia only come from the stack From 48dad090047b7ab0d2277bf04065bfc313743c82 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Fri, 9 Feb 2024 01:42:39 +0000 Subject: [PATCH 33/41] Updating julia_version --- mmtk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index e750dd96..35492731 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. julia_repo = "https://github.com/udesou/julia.git" -julia_version = "25c06e0e25261622c1d404b0c567d1ec35635da5" +julia_version = "a0c895ee0ff25b751475c3015ed82cd84c058b0e" [lib] crate-type = ["cdylib"] From 8a732987dc6aa94262139bcda901ea9f7622ebdf Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Fri, 9 Feb 2024 05:34:24 +0000 Subject: [PATCH 34/41] Adding separate checks for non-moving and moving immix/sticky immix --- .github/scripts/ci-build.sh | 5 ++++- .github/workflows/binding-tests.yml | 6 +++--- .github/workflows/ci.yml | 1 + mmtk/Cargo.toml | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/scripts/ci-build.sh b/.github/scripts/ci-build.sh index de3b70cc..8e23f7c9 100755 --- a/.github/scripts/ci-build.sh +++ b/.github/scripts/ci-build.sh @@ -12,6 +12,8 @@ fi build_type=$1 # plan to use plan=$2 +# moving vs non-moving +is_moving=$3 # helloworld.jl HELLO_WORLD_JL=$BINDING_PATH/.github/scripts/hello_world.jl @@ -23,9 +25,10 @@ if [ "$build_type" == "release" ]; then fi plan_feature=${plan,,} +moving_feature=${is_moving,,} cd $MMTK_JULIA_DIR/mmtk -cargo build --features $plan_feature $build_args +cargo build --features $plan_feature,$moving_feature $build_args cd $JULIA_PATH diff --git a/.github/workflows/binding-tests.yml b/.github/workflows/binding-tests.yml index f5be174b..02ea98d5 100644 --- a/.github/workflows/binding-tests.yml +++ b/.github/workflows/binding-tests.yml @@ -37,7 +37,7 @@ jobs: ./.github/scripts/ci-test-patching.sh - name: Build Julia (Release) run: | - ./.github/scripts/ci-build.sh release ${{ inputs.gc_plan }} + ./.github/scripts/ci-build.sh release ${{ inputs.gc_plan }} ${{ inputs.moving }} - name: Test Julia run: | ./.github/scripts/ci-test-other.sh @@ -53,7 +53,7 @@ jobs: ./.github/scripts/ci-setup.sh - name: Build Julia (Release) run: | - ./.github/scripts/ci-build.sh release ${{ inputs.gc_plan }} + ./.github/scripts/ci-build.sh release ${{ inputs.gc_plan }} ${{ inputs.moving }} - name: Test Julia run: | ./.github/scripts/ci-test-stdlib.sh @@ -69,7 +69,7 @@ jobs: ./.github/scripts/ci-setup.sh - name: Build Julia (Release) run: | - ./.github/scripts/ci-build.sh release ${{ inputs.gc_plan }} + ./.github/scripts/ci-build.sh release ${{ inputs.gc_plan }} ${{ inputs.moving }} - name: Test Julia run: | ./.github/scripts/ci-test-LinearAlgebra.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30bf8e28..5ddfa496 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: fail-fast: false matrix: gc_plan: [Immix, StickyImmix] + moving: [Default, Non_Moving] uses: ./.github/workflows/binding-tests.yml with: gc_plan: ${{ matrix.gc_plan }} diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 35492731..85596365 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -53,6 +53,6 @@ stickyimmix = ["mmtk/sticky_immix_non_moving_nursery", "mmtk/immix_smaller_block marksweep = [] object_pinning = ["mmtk/object_pinning"] -# TODO remove this when we properly support moving -non_moving_immix = ["mmtk/immix_non_moving", "mmtk/immix_smaller_block"] +# This feature disables moving +non_moving = ["mmtk/immix_non_moving", "mmtk/immix_smaller_block"] julia_copy_stack = [] From f40c066f164a8577d006328611860d25bafc7440 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Fri, 9 Feb 2024 05:40:55 +0000 Subject: [PATCH 35/41] Missing input on workflow call --- .github/workflows/binding-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/binding-tests.yml b/.github/workflows/binding-tests.yml index 02ea98d5..db758cdc 100644 --- a/.github/workflows/binding-tests.yml +++ b/.github/workflows/binding-tests.yml @@ -6,6 +6,9 @@ on: gc_plan: required: true type: string + moving: + required: true + type: string jobs: build-debug: From 2a0e6cabd18d16b97cd9003207f6f8fcd16dd488 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Fri, 9 Feb 2024 05:41:54 +0000 Subject: [PATCH 36/41] Minor --- .github/workflows/binding-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/binding-tests.yml b/.github/workflows/binding-tests.yml index db758cdc..4507d96d 100644 --- a/.github/workflows/binding-tests.yml +++ b/.github/workflows/binding-tests.yml @@ -21,7 +21,7 @@ jobs: ./.github/scripts/ci-setup.sh - name: Build Julia (Debug) run: | - ./.github/scripts/ci-build.sh debug ${{ inputs.gc_plan }} + ./.github/scripts/ci-build.sh debug ${{ inputs.gc_plan }} ${{ inputs.moving }} - name: Style check run: | ./.github/scripts/ci-style.sh From 4229665b6f8e859ad4b914a0e1775f04aea666e4 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Fri, 9 Feb 2024 05:43:56 +0000 Subject: [PATCH 37/41] Passing moving argument in jobs --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ddfa496..8341d3e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,3 +22,4 @@ jobs: uses: ./.github/workflows/binding-tests.yml with: gc_plan: ${{ matrix.gc_plan }} + moving: ${{ matrix.moving }} From a66d15ef8e53f26605698fbb277f133320f4ff95 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Fri, 9 Feb 2024 06:00:52 +0000 Subject: [PATCH 38/41] When the non_moving feature is used, pinning shouldn't do anything --- mmtk/src/api.rs | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 755380bd..2a96d266 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -484,7 +484,7 @@ pub extern "C" fn mmtk_get_obj_size(obj: ObjectReference) -> usize { } } -#[cfg(feature = "object_pinning")] +#[cfg(all(feature = "object_pinning", not(feature = "non_moving")))] #[no_mangle] pub extern "C" fn mmtk_pin_object(object: ObjectReference) -> bool { debug_assert!( @@ -494,7 +494,7 @@ pub extern "C" fn mmtk_pin_object(object: ObjectReference) -> bool { memory_manager::pin_object::(object) } -#[cfg(feature = "object_pinning")] +#[cfg(all(feature = "object_pinning", not(feature = "non_moving")))] #[no_mangle] pub extern "C" fn mmtk_unpin_object(object: ObjectReference) -> bool { debug_assert!( @@ -504,8 +504,26 @@ pub extern "C" fn mmtk_unpin_object(object: ObjectReference) -> bool { memory_manager::unpin_object::(object) } -#[cfg(feature = "object_pinning")] +#[cfg(all(feature = "object_pinning", not(feature = "non_moving")))] #[no_mangle] pub extern "C" fn mmtk_is_pinned(object: ObjectReference) -> bool { memory_manager::is_pinned::(object) } + +#[cfg(all(feature = "object_pinning", feature = "non_moving"))] +#[no_mangle] +pub extern "C" fn mmtk_pin_object(_object: ObjectReference) -> bool { + false +} + +#[cfg(all(feature = "object_pinning", feature = "non_moving"))] +#[no_mangle] +pub extern "C" fn mmtk_unpin_object(_object: ObjectReference) -> bool { + false +} + +#[cfg(all(feature = "object_pinning", feature = "non_moving"))] +#[no_mangle] +pub extern "C" fn mmtk_is_pinned(_object: ObjectReference) -> bool { + true +} From 9f168a8d3ee888b6cab7347341c5f1c67c1f9026 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Mon, 12 Feb 2024 02:55:44 +0000 Subject: [PATCH 39/41] Refactoring pinning functions; Pinning when non moving feature is selected is no op --- mmtk/Cargo.lock | 123 ++++++++++++++++++------------------------------ mmtk/Cargo.toml | 2 +- mmtk/src/api.rs | 32 ++++++++----- 3 files changed, 68 insertions(+), 89 deletions(-) diff --git a/mmtk/Cargo.lock b/mmtk/Cargo.lock index 8dc98271..5798a954 100644 --- a/mmtk/Cargo.lock +++ b/mmtk/Cargo.lock @@ -86,9 +86,9 @@ checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" dependencies = [ "bytemuck_derive", ] @@ -122,9 +122,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.32" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41daef31d7a747c5c847246f36de49ced6f7403b4cdabc807a97b5cc184cda7a" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ "android-tzdata", "iana-time-zone", @@ -215,9 +215,9 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "enum-map" @@ -252,16 +252,6 @@ dependencies = [ "termcolor", ] -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys", -] - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -273,9 +263,9 @@ dependencies = [ [[package]] name = "git2" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" +checksum = "1b3ba52851e73b46a4c3df1d89343741112003f0f6f13beb0dfac9e457c3fdcd" dependencies = [ "bitflags", "libc", @@ -292,9 +282,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" [[package]] name = "humantime" @@ -304,9 +294,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -337,38 +327,38 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", - "rustix", + "libc", "windows-sys", ] [[package]] name = "itertools" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -381,15 +371,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libgit2-sys" -version = "0.16.1+1.7.1" +version = "0.16.2+1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" +checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" dependencies = [ "cc", "libc", @@ -399,9 +389,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.14" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "295c17e837573c8c821dbaeb3cceb3d745ad082f7572191409e69cbc1b3fd050" +checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" dependencies = [ "cc", "libc", @@ -409,12 +399,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - [[package]] name = "lock_api" version = "0.4.11" @@ -520,9 +504,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -551,9 +535,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.6" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" +checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" dependencies = [ "memchr", "thiserror", @@ -654,9 +638,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -678,19 +662,6 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.38.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - [[package]] name = "rustversion" version = "1.0.14" @@ -803,18 +774,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", @@ -898,9 +869,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -908,9 +879,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", @@ -923,9 +894,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -933,9 +904,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", @@ -946,9 +917,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "winapi" diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index 85596365..b0c42ba9 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. julia_repo = "https://github.com/udesou/julia.git" -julia_version = "a0c895ee0ff25b751475c3015ed82cd84c058b0e" +julia_version = "3b4ae537216b59ccaded4f7b946dc7faf2a27bb5" [lib] crate-type = ["cdylib"] diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 2a96d266..d74b3fa5 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -487,29 +487,37 @@ pub extern "C" fn mmtk_get_obj_size(obj: ObjectReference) -> usize { #[cfg(all(feature = "object_pinning", not(feature = "non_moving")))] #[no_mangle] pub extern "C" fn mmtk_pin_object(object: ObjectReference) -> bool { - debug_assert!( - mmtk_object_is_managed_by_mmtk(object.to_raw_address().as_usize()), - "Object is not managed by mmtk - pinning it via this function isn't supported." - ); - memory_manager::pin_object::(object) + if mmtk_object_is_managed_by_mmtk(object.to_raw_address().as_usize()) { + memory_manager::pin_object::(object) + } else { + warn!("Object is not managed by mmtk - (un)pinning it via this function isn't supported."); + false + } } #[cfg(all(feature = "object_pinning", not(feature = "non_moving")))] #[no_mangle] pub extern "C" fn mmtk_unpin_object(object: ObjectReference) -> bool { - debug_assert!( - mmtk_object_is_managed_by_mmtk(object.to_raw_address().as_usize()), - "Object is not managed by mmtk - pinning it via this function isn't supported." - ); - memory_manager::unpin_object::(object) + if mmtk_object_is_managed_by_mmtk(object.to_raw_address().as_usize()) { + memory_manager::unpin_object::(object) + } else { + warn!("Object is not managed by mmtk - (un)pinning it via this function isn't supported."); + false + } } #[cfg(all(feature = "object_pinning", not(feature = "non_moving")))] #[no_mangle] pub extern "C" fn mmtk_is_pinned(object: ObjectReference) -> bool { - memory_manager::is_pinned::(object) + if mmtk_object_is_managed_by_mmtk(object.to_raw_address().as_usize()) { + memory_manager::is_pinned::(object) + } else { + warn!("Object is not managed by mmtk - checking via this function isn't supported."); + false + } } +// If the `non-moving` feature is selected, pinning/unpinning is a noop and simply returns false #[cfg(all(feature = "object_pinning", feature = "non_moving"))] #[no_mangle] pub extern "C" fn mmtk_pin_object(_object: ObjectReference) -> bool { @@ -525,5 +533,5 @@ pub extern "C" fn mmtk_unpin_object(_object: ObjectReference) -> bool { #[cfg(all(feature = "object_pinning", feature = "non_moving"))] #[no_mangle] pub extern "C" fn mmtk_is_pinned(_object: ObjectReference) -> bool { - true + false } From dab702c9401dc0f3cef7ef32dfeb785007644156 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Mon, 12 Feb 2024 05:22:19 +0000 Subject: [PATCH 40/41] Updating julia_version and julia_repo --- mmtk/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmtk/Cargo.toml b/mmtk/Cargo.toml index b0c42ba9..ea0fb526 100644 --- a/mmtk/Cargo.toml +++ b/mmtk/Cargo.toml @@ -9,8 +9,8 @@ edition = "2018" # Metadata for the Julia repository [package.metadata.julia] # Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works. -julia_repo = "https://github.com/udesou/julia.git" -julia_version = "3b4ae537216b59ccaded4f7b946dc7faf2a27bb5" +julia_repo = "https://github.com/mmtk/julia.git" +julia_version = "861f151c7fbec1d8431a804795bd3d3598b77e3b" [lib] crate-type = ["cdylib"] From 626a23709e9938db06eeca6eb66b7861d7248f77 Mon Sep 17 00:00:00 2001 From: Eduardo Souza Date: Mon, 12 Feb 2024 10:09:51 +0000 Subject: [PATCH 41/41] Only do assertion on owner in moving GCs --- mmtk/src/julia_scanning.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mmtk/src/julia_scanning.rs b/mmtk/src/julia_scanning.rs index 96c2f7e7..28d31f61 100644 --- a/mmtk/src/julia_scanning.rs +++ b/mmtk/src/julia_scanning.rs @@ -108,8 +108,10 @@ pub unsafe fn scan_julia_object>(obj: Address, clos } else if flags.how_custom() == 3 { // has a pointer to the object that owns the data let owner_addr = mmtk_jl_array_data_owner_addr(array); + // to avoid having to update a->data, which requires introspecting the owner object - // we simply expect that both owner and buffers are pinned + // we simply expect that both owner and buffers are pinned when in a moving GC + #[cfg(not(feature = "non_moving"))] debug_assert!( (mmtk_object_is_managed_by_mmtk(owner_addr.load()) && mmtk_is_pinned(owner_addr.load()) @@ -118,6 +120,7 @@ pub unsafe fn scan_julia_object>(obj: Address, clos owner_addr.load::(), mmtk_is_pinned(owner_addr.load()) ); + process_edge(closure, owner_addr); return; }