Open wks opened 5 months ago
It raises another question: If Release
is supposed to have exclusive access to the Plan, and if it can spawn work packets (such as SweepChunk) that can start executing immediately, then it may not have exclusive access to the plan. because work packets such as SweepChunk
may access the space which, according to Rust's concept of ownership, is part of the plan.
In https://github.com/mmtk/mmtk-core/issues/1146, we observed that when using the native MarkSweep and the eager sweeping is enabled, no
ReleaseMutator
work packet is executed untilRelease
finishes. It can be seen from the eBPF timeline:That is because the
Release
work packet callsPlan::release
before spawning anyReleaseMutator
work packet. See:https://github.com/mmtk/mmtk-core/blob/401803ce44d851c19e4d04f152b494095f9b71e6/src/scheduler/gc_work.rs#L126-L154
This is not a bug, because
Release
is designed to have exclusive access to thePlan
when executed. This means we shouldn't do any high-intensity work inPlan::release
unless we don't need to release mutators.This affects all plans.
MarkSweep
does a non-trivial amount of work inPlan::release
when doing eager sweeping.Here is a zoomed-in timeline for Immix.
ImmixSpace.release
generatesSweepChunk
work packets, so they start executing beforeReleaseMutator
work packets start.This is SemiSpace:
It looks OK. But after I turn on the VO bits:
Clearly the
Release
work packet is spending a significant amount of time clearing the VO bit.We should revisit all plans and all spaces, and see if they do any significant amount of work in
Plan.release
andSpace.release
. If they do, they should be off-loaded to dedicated work packets so that they can be parallelized.