-
Notifications
You must be signed in to change notification settings - Fork 79
Description
mmtk-core/src/policy/marksweepspace/native_ms/global.rs
Lines 435 to 437 in 401803c
| for chunk in self.space.chunk_map.all_chunks() { | |
| side.bzero_metadata(chunk.start(), Chunk::BYTES); | |
| } |
Each PrepareChunkMap work packet for native_ms is supposed to initialize the chunk-level metadata for a single chunk. But the code shown above clears the side mark bits for all blocks. This is totally unnecessary, and is taking up a considerable amount of time during a GC.
The problem becomes more serious when I changed the native MarkSweepSpace to use BlockPageResource instead of the raw FreeListPageResource. The reason may be that BlockPageResource caches blocks in the block queue, and releases chunks lazily, resulting in a higher number of allocated chunks during each GC.
(p.s. ReleaseMutator becomes faster because BlockPageResource::release_block is lock-free, while FreeListPageResource::release_pages needs a mutex to work, which is bad for parallel GC. See: #1145)
It should only clear the side metadata for the single chunk that the work packet is responsible for.

