-
Notifications
You must be signed in to change notification settings - Fork 78
Closed
Labels
A-work-queueArea: Work queueArea: Work queueC-enhancementCategory: EnhancementCategory: EnhancementP-normalPriority: Normal.Priority: Normal.
Description
In the line in ProcessEdgesWork
,
mmtk-core/src/scheduler/gc_work.rs
Lines 449 to 452 in 0babba2
let new_object = self.trace_object(object); | |
if Self::OVERWRITE_REFERENCE { | |
unsafe { slot.store(new_object) }; | |
} |
we check a constant OVERWRITE_REFERENCE
and write back the reference returned by trace_object()
. OVERWRITE_REFERENCE
is defined per ProcessEdgesWork
, which is currently per plan. In a copying plan, OVERWRITE_REFERENCE
is true
, and we always update references.
However, this means there are a few cases where we update references but we do not have to:
- an object is in a non-copying space: e.g. objects in immortal or large object space in a copying plan
- an object is in a copying space but in a particular trace, the policy is not moving objects: e.g. objects in an immix space in a non-defrag GC (non-moving), or objects in the mature immix space in generational immix for a non-defrag GC (nursery is still copying, but objects in mature space is non-moving for that GC).
We may want to check if this introduces any measurable overhead.
There could be different solutions if this brings any overhead:
- Per policy per trace work packet. So
OVERWRITE_REFERENCE
is defined per policy per trace. - Check if
new_object
is the same asobject
before write. (conditional vs memory write).
Metadata
Metadata
Assignees
Labels
A-work-queueArea: Work queueArea: Work queueC-enhancementCategory: EnhancementCategory: EnhancementP-normalPriority: Normal.Priority: Normal.