-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add MarkState. Use MarkState for ImmortalSpace. #796
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
The Fn
I mentioned in a comment can be changed to FnMut
to make it more generally applicable, but it is still correct for now to use Fn
.
There is an opportunity to replace cmpxchg with fetch_update
. We can do it in the future.
Could you run a performance evaluation of this change? |
Yeah. The change in the PR only affects immortal space, and immortal space is not used by OpenJDK. We could evaluate this with JikesRVM. Let me know if you think it is worthwhile to evaluate this on JikesRVM. @k-sareen Most of the changes in the PR is simply refactoring. The only thing that may bring any overhead is the loop in |
Alternatively, I will do further PRs that use |
Ah that makes sense. I was just concerned about the overhead involved with an indirection for marking (which is one of the hottest parts of our code). |
If you mean this line, if self.mark_state.test_and_mark::<VM>(object) { there is no actual indirection. |
This PR is not ready for merge. It seems the PR makes JikesRVM tests time out. |
Might be beneficial to test its performance on JikesRVM then. I don't know how much the Rust compiler will optimize away. |
I am debugging on this. This does not seem to be a performance issue though. It got stuck in the mutator phase for the semispace debug build, which is very early in the tests. |
mmtk-core/src/policy/vmspace.rs Line 18 in b0c71b5
|
I don't understand why JikesRVM is failing though. Should this not be a drop-in replacement for an |
Oh. I see. The main difference is that the |
|
Quick sanity check (if you haven't already) I guess is changing the EDIT: Though I don't know if exposing internal state (the initial |
|
space is used as a VM space, and there is no allocation in the space.
I reverted the change about duplicating |
That makes sense 👍. Thanks for debugging it! |
This PR introduces
MarkState
. It abstracts over the mark state and the mark bit, and can be used by various policies. This PR changesImmortalSpace
to useMarkState
. This PR also duplicates the currentImmortalSpace
as aVMSpace
policy to make sure it works fine with JikesRVM (I shall provide a new implementation ofVMSpace
soon).