From 6112020542396d2db1160bc1ee92a5e0f42cadc1 Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Fri, 20 Oct 2023 14:36:33 +0800 Subject: [PATCH] Some trace logs in immix space --- src/policy/immix/immixspace.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/policy/immix/immixspace.rs b/src/policy/immix/immixspace.rs index ae7f380442..66bc6a369f 100644 --- a/src/policy/immix/immixspace.rs +++ b/src/policy/immix/immixspace.rs @@ -583,6 +583,7 @@ impl ImmixSpace { match object_forwarding::ForwardingAttempt::::attempt(object) { object_forwarding::ForwardingAttempt::Lost(lost) => { + trace!("Lost. object: {}", object); // We lost the forwarding race as some other thread has set the forwarding word; wait // until the object has been forwarded by the winner. Note that the object may not // necessarily get forwarded since Immix opportunistically moves objects. @@ -610,17 +611,21 @@ impl ImmixSpace { new_object } object_forwarding::ForwardingAttempt::Won(won) => { + trace!("Won. object: {}", object); if self.is_marked(object) { + trace!("Is marked."); // We won the forwarding race but the object is already marked so we clear the // forwarding status and return the unmoved object won.revert(); object } else { + trace!("Not marked."); // We won the forwarding race; actually forward and copy the object if it is not pinned // and we have sufficient space in our copy allocator let new_object = if self.is_pinned(object) || (!nursery_collection && self.defrag.space_exhausted()) { + trace!("Is pinned or space exhausted."); self.attempt_mark(object, self.mark_state); won.revert(); Block::containing::(object).set_state(BlockState::Marked); @@ -630,6 +635,7 @@ impl ImmixSpace { object } else { + trace!("We should forward."); // We are forwarding objects. When the copy allocator allocates the block, it should // mark the block. So we do not need to explicitly mark it here. @@ -647,6 +653,7 @@ impl ImmixSpace { BlockState::Marked ); + trace!("Enqeuing {}", new_object); queue.enqueue(new_object); debug_assert!(new_object.is_live()); self.unlog_object_if_needed(new_object);