-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support VO bit #158
Support VO bit #158
Conversation
Performance comparison of using the VO bit (inlined in the fastpath allocation):
|
…expose functions from mmtk-core
mmtk/src/api.rs
Outdated
@@ -226,6 +226,16 @@ pub extern "C" fn mmtk_post_alloc( | |||
bytes: usize, | |||
semantics: AllocationSemantics, | |||
) { | |||
#[cfg(all(feature = "object_pinning", not(feature = "non_moving")))] |
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.
Did you include this code when you ran benchmarks in #158 (comment)?
This should be fixed in mmtk-core by bulk clearing the pinning bits. We don't want to clear the bits here for every object.
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.
Yes, I did include it. Is it fixed in the mmtk-core version we're currently using?
I'll remove that code then and maybe try to re-run the benchmarks in the meantime.
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.
I don't think we have fixed it in mmtk-core. But we should fix it in mmtk-core.
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.
You also only clear the bits in this function, not in the JIT'd code. So for objects allocated in the JIT'd code, the pinning bits are not cleared properly.
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.
You also only clear the bits in this function, not in the JIT'd code. So for objects allocated in the JIT'd code, the pinning bits are not cleared properly.
I think I'm clearing them in the slowpath, not sure if they need to be cleared in the fastpath as well (since they will be bulk cleared for the memory chunk I get in the slowpath).
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.
There is no slowpath or fastpath for post_alloc
. We either inline them, or not inline them. Both versions should be the same.
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.
What I meant was that in the allocation slowpath, you could clear the pin bits by calling mmtk_post_alloc
, and it would be cleared for the chunk of memory you get between the new cursor and limit. But I checked the Julia PR and I wasn't calling mmtk_post_alloc
there either, since I'm now inlining the code to set the VO bit. So, in fact, that code to bulk zero the pinning bits was not being executed in the results above.
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.
I see you removed the code for the pin bits. Just make sure that we are on the same page. With this PR, the pin bits are not cleared, right? It sounds fine to me. But it is an issue that we will need to fix.
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.
That's right. It should be fixed inside mmtk-core. I'm currently looking into it and will open a PR there instead.
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
This PR ports #158 to `dev`, and updates Julia to mmtk/julia#76.
This PR introduces the
is_mmtk_object
feature supporting a valid object (VO) bit for conservative stack scanning. It also sets this feature as default.NB: merge with mmtk/julia#59.
NB2: it requires a change inmmtk-core
to expose an api function to bulk set the VO bit. (see mmtk/mmtk-core#1157)