-
Notifications
You must be signed in to change notification settings - Fork 37
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
8315044: GenShen: Verifier detects clean card should be dirty #314
8315044: GenShen: Verifier detects clean card should be dirty #314
Conversation
I'm going to leave this in draft mode until I see and analyze results of integration testing. |
👋 Welcome back kdnilsen! A progress list of the required criteria for merging this PR into |
Webrevs
|
…es-remembered-set
…es-remembered-set
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.
changes look good; minor suggestion on some potential refactor/consolidation with existing card marking code.
T* addr = reinterpret_cast<T*>(java_lang_ref_Reference::discovered_addr_raw(reference)); | ||
if (heap->is_in_old(addr) && heap->is_in_young(discovered_head)) { | ||
heap->mark_card_as_dirty(addr); |
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.
Can you instead call the existing card_mark_barrier
method?
At that time, could also look at the existing uses of that method and refactor them to use the ShenandoahCardBarrier
test like you did above, and elide the generational check in the body of the method itself, replacing it with an assertion (if you want, that the heap is generational).
(PS: I was also thinking that in the fullness of time it might be worth doing an audit of the uses of cas
and set_oop
and making sure they would call the card-marking code instead of exposing the functionality at the call-sites like done here. Callers that want to avoid card-marking would need to call the respective _raw
versions then. We should makr sure to conform to naming conventions for those methods that are consistent with those used in other parts of jvm/gc code. This can be done separately and might affect legacy Shenandoah code as well. Just leaving this comment here so as not to lose the thought, but I doubt we want to do that locally here in this PR.)
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.
Made this change and am testing result.
I agree that audit/refactoring in the future would be a good idea.
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've made your suggested changes and am sending through the test pipeline again.
I agree that it would be good to eventually audit/refactor to have more consistent method names and conventions.
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.
One more change, I think? See comment in-line.
May be there is an issue with it though that I am not seeing which perhaps you might have tried already, but doesn't work?
Rest looks good.
if (UseCompressedOops) { | ||
*reinterpret_cast<narrowOop*>(_pending_list_tail) = CompressedOops::encode(Universe::swap_reference_pending_list(_pending_list)); | ||
*reinterpret_cast<narrowOop*>(_pending_list_tail) = CompressedOops::encode(former_head_of_global_list); | ||
} else { | ||
*reinterpret_cast<oop*>(_pending_list_tail) = Universe::swap_reference_pending_list(_pending_list); | ||
*reinterpret_cast<oop*>(_pending_list_tail) = former_head_of_global_list; | ||
} | ||
ShenandoahHeap* heap = ShenandoahHeap::heap(); | ||
if (ShenandoahCardBarrier) { | ||
if (heap->is_in_old(_pending_list_tail) && heap->is_in_young(former_head_of_global_list)) { | ||
heap->mark_card_as_dirty(_pending_list_tail); | ||
} |
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.
Can we just replace this section with set_oop_field(_pending_list_tail, former_head_of_global_list)
?
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.
Have made this improvement, and am retesting.
@kdnilsen This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit c4d0a24. |
When a Reference object is newly discovered, it is placed onto the worker's thread-local discovered list. This sometimes results in a reference from an old object to a young object, requiring that the remembered set card-table entry be marked as dirty. This patch causes the marking to be performed.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/shenandoah.git pull/314/head:pull/314
$ git checkout pull/314
Update a local copy of the PR:
$ git checkout pull/314
$ git pull https://git.openjdk.org/shenandoah.git pull/314/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 314
View PR using the GUI difftool:
$ git pr show -t 314
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/shenandoah/pull/314.diff
Webrev
Link to Webrev Comment