-
Notifications
You must be signed in to change notification settings - Fork 39
Fix reference processing crash #309
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
Conversation
Fixed a bug that when enqueuing references, it swapped the reference pending list with the last node of the new linked list. It should swap with the *first* node instead. Worked around a fact that the list given by the method `ReferenceGlue::enqueue_references` may contain duplicated elements. This is because the reference processor in mmtk-core was designed to work with both of the two use patterns: (1) registering references when created, and (2) discovering references while tracing. Therefore, the reference processor kept the list of Reference instances discovered in the previous GC (in the from-space). But as the OpenJDK binding scans new Reference instances, it will add to-space addresses of the same Reference instances to the reference processor. After the references are processed, both pointers will be normalized to the two-space copy, but as two different entries. We work around this problem in the OpenJDK binding by simply skipping visited entries.
An interesting side effect of this PR is that Edit: This is not always true. If I increase the heap size, GenImmix will become slower with ref proc. But StickyImmix is still faster with ref proc. The
|
Reference processing tests now incclude all test cases in `ci-test-only-normal.sh`.
@qinsoon I marked this as ready. Since it is a correctness fix, and we plan to move to OpenJDK's own ref processing, I'll not do detailed performance analysis now. It should have no performance impact if reference processing is not enabled. This PR does not change the default value of the option |
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. Thanks for the fix.
Fixed a bug that when enqueuing references, it swapped the reference pending list with the last node of the new linked list. It should swap with the first node instead.
Worked around a fact that the list given by the method
ReferenceGlue::enqueue_references
may contain duplicated elements. This is because the reference processor in mmtk-core was designed to work with both of the two use patterns: (1) registering references when created, and (2) discovering references while tracing. Therefore, the reference processor kept the list of Reference instances discovered in the previous GC (in the from-space). But as the OpenJDK binding scans new Reference instances, it will add to-space addresses of the same Reference instances to the reference processor. After the references are processed, both pointers will be normalized to the two-space copy, but as two different entries. We work around this problem in the OpenJDK binding by simply skipping visited entries.