-
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
Conservative stack scanning #157
Conversation
c280432
to
4c6af3c
Compare
<hr>This is an automatic backport of pull request mmtk#160 done by [Mergify](https://mergify.com). --------- Co-authored-by: Yi Lin <qinsoon@gmail.com>
This PR passed tests with mmtk/julia#63. However, if we turn on stress copying in Immix, it segfaults in the building process. I am still looking into this. |
The problem is now solved. We further pin julia values in |
This PR may show slowdown from previous moving plans:
I plan to focus on correctness and allowing more objects to be moved first, and do optimization in future PRs. Now we still want to remove the TPin for the global roots table. However, if requested, I can work on the performance right now within this PR. |
mmtk/Cargo.toml
Outdated
is_mmtk_object = ["mmtk/is_mmtk_object"] | ||
conservative = ["is_mmtk_object"] | ||
moving = ["conservative", "object_pinning"] |
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.
Should moving
be in the default
? Or non_moving
?
Ideally, people can build withcargo build --features immix/stickyimmix
and then get immix/sticky working with or without moving, whatever the default is. But as it is, I think we get moving but without conservative stack scanning which tpins everything I assume? That being said, maybe we should have non-moving as default?
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.
We can put it to default. But the default features will be included in all the builds, unless we pass --no-default-features
. So when we build the non moving build, we will need to do cargo build --no-default-features --features non_moving,mmtk/vm_space,julia_copy_stack
.
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 can revert his change to what we had before if you think that is better.
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.
The reason that I changed this is that I found the following line confusing: object_pinning
is turned on even for a non moving build.
#[cfg(all(feature = "object_pinning", not(feature = "non_moving")))]
When the changes in this PR, we will need conservative
as a default feature to support moving. We will need to do the same thing for conservative
.
I will see if there is a better way.
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.
If it's too difficult, it's also fine to leave as it is. The other thing to have in mind is that we should probably update the README file to reflect the changes - reminding people to set MMTK_CONSERVATIVE=1
for example, and perhaps add that you should have moving
or non_moving
as a feature when building the binding.
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 mostly revert back to what we had before. But I removed some features from conditional compilation in the binding crate, like is_mmtk_object
, object_pinning
. So we always build with those features, as they are default features -- we have to build with default features.
On top of default features, people may build with non_moving
. With non_moving
, some methods will do early return and skip the actual work. Like pinning, or conservative scanning.
feature, we do early return for some methods.
This PR ports #157 and #184 to dev. It also adds an optimization that if a task is not started, the conservative stack scanning can be skipped for the task. Merge with mmtk/julia#80. --------- Co-authored-by: Yi Lin <qinsoon@gmail.com>
This uses conservative stack scanning to find object references from the execution stack, and pins those values. The changes in the PR include:
jl_save_context_for_conservative_scanning
for the first thread that is blocked for the GC.moving
or thenon_moving
feature.