Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cyclic mark states #391

Open
wenyuzhao opened this issue Jul 29, 2021 · 4 comments
Open

Cyclic mark states #391

wenyuzhao opened this issue Jul 29, 2021 · 4 comments
Labels
P-normal Priority: Normal.

Comments

@wenyuzhao
Copy link
Member

Looks like at the moment, we use VMLocalMarkBitSpec to define per-object mark metadata, and it only allows one bit of metadata for each object. This prevents from the implementation of cyclic mark bits.

Normally the cyclic mark state will take up more than one bits in the header or on the side, act as a N-bit integer IntN. At the start of each GC the mark state is increased by one, and all existing objects in the heap will automatically become "unmarked" states. So the GC does not need to zero all the mark bits at the start of each GC. When the mark state overflows the max value of IntN, it will cyclic back to the minimum valid value of IntN (usually 0 or 1).

@qinsoon
Copy link
Member

qinsoon commented Jul 29, 2021

1 bit is int1. If 1 means marked, after flipping, 1 means unmarked. Why does this not work?

@wks
Copy link
Collaborator

wks commented Nov 27, 2023

See: #994

@wks wks added the P-normal Priority: Normal. label Nov 27, 2023
@qinsoon
Copy link
Member

qinsoon commented Jan 15, 2024

We should look further into this. MMTk panics if we try use header mark bit for Immix.

[2024-01-15T04:42:30Z INFO  mmtk::memory_manager] Initialized MMTk with Immix (FixedHeapSize(20971520))
===== DaCapo antlr starting =====
Running antlr on grammar antlr/cpp/calc.g
ANTLR Parser Generator   Version 2.7.2   1989-2003 jGuru.com
Running antlr on grammar antlr/cpp/column.g
ANTLR Parser Generator   Version 2.7.2   1989-2003 jGuru.com
Running antlr on grammar antlr/cpp/data.g
ANTLR Parser Generator   Version 2.7.2   1989-2003 jGuru.com
Running antlr on grammar antlr/cpp/expr.g
ANTLR Parser Generator   Version 2.7.2   1989-2003 jGuru.com
Running antlr on grammar antlr/cpp/html.g
ANTLR Parser Generator   Version 2.7.2   1989-2003 jGuru.com
[2024-01-15T04:42:31Z INFO  mmtk::util::heap::gc_trigger] [POLL] immix: Triggering collection (5123/5120 pages)
thread '<unnamed>' panicked at 'not implemented: cyclic mark bits is not supported at the moment', /home/runner/.cargo/git/checkouts/mmtk-core-3306bdeb8eb4322b/79fb0bb/src/policy/immix/immixspace.rs:370:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5

@qinsoon
Copy link
Member

qinsoon commented Jan 17, 2024

In Java MMTk, immix space and mark sweep space use cyclic mark state. It uses the remaining GC bits (3 or 4 bits) for the mark state, and does not require metadata initialization in post alloc. Other policies uses 1 bit mark state. A write for the mark bit is needed to initialize the object metadata in post alloc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-normal Priority: Normal.
Projects
None yet
Development

No branches or pull requests

3 participants