-
Notifications
You must be signed in to change notification settings - Fork 78
Add a stop-the-world, serial Compressor #1340
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
base: master
Are you sure you want to change the base?
Conversation
The current failure to compile |
Thanks for the PR @no-defun-allowed! The major thing I see is that currently the Compressor plan is not using the LOS. Was this intentional or accidental? |
Definitely accidental. Thanks for the review. |
You can cherry pick this commit to the PR: qinsoon@ac90d4b. It runs mock VM with side metadata. Compressor currently fails for tests that are not using contiguous space. |
Thanks!
Right. Should we skip such tests when running with the Compressor? |
Is there any intrinsic reason why the compressor cannot run with discontiguous spaces? I feel there is none. It would be better to allow running Compressor with discontiguous spaces. At the same time, there might be practical reasons that this might be not easy, or it requires too much efforts. It is also okay to skip those tests. |
I feel that way too. The judgement was more about how closely we want to follow the Compressor paper - one simple approach to support discontiguous spaces would be to compress [sic] each chunk of a space, which would also give a simple way to parallelise (which is not the way in the paper). The block offset vector is currently a Rust |
For what its worth, ART also uses a |
Now the block offset vector and the marks are in their own local metadata. I'm still undecided on if and how to support discontiguous spaces, since the forwarding algorithm in the Compressor paper seems very tied to having a contiguous space. |
The failures for 32 bits was caused by this: #1342. However, you reverted the side metadata commit for mock VM, so the bug won't appear in the PR any way. |
If that's the case, just skip the tests that use discontiguous space for Compressor. |
I added a |
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 found the Transducer
implementation is not easy to understand. A bit more comments would be helpful.
We probably also need a PR for OpenJDK that supports Compressor.
@@ -197,6 +197,9 @@ extreme_assertions = [] | |||
# Enable multiple spaces for NoGC, each allocator maps to an individual ImmortalSpace. | |||
nogc_multi_space = [] | |||
|
|||
# Disable multiple spaces for Compressor. |
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.
Is there any reason that we want to keep this feature? Would it be useful to anyone?
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.
This will be the most space-efficient an algorithm can be. I believe Steve mentioned it.
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.
@no-defun-allowed Just mention in the comment there that this is configuration will move all objects. Don't use if you can't tolerate that. This is primarily for understanding how space-efficient we can be.
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.
Right. Also the non-moving semantic can't be used with this feature.
It would be better if we can panic when the non-moving semantic is ever used. This probably would need a 'fake allocator' that panics when used, and the non-moving semantic is mapped to it. I am not sure if it is worth it.
/// each block by serialising the state using [`Transducer::encode`]; | ||
/// the state can then be deserialised using [`Transducer::decode`]. | ||
#[derive(Debug)] | ||
struct Transducer { |
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.
It is a bit hard to understand how this type works. More comments would help. For example, explain what each fields mean. Also you could comment step
to say that address
is always either the start of an object, or the end of an object, etc.
I also requested reviews from @wks |
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.
Thanks for the updates! I think it looks pretty good now
This PR adds a Compressor-esque garbage collector, which is based on MarkCompact but uses a mark bitmap for forwarding metadata like the Compressor.