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
8254598: StringDedupTable should use OopStorage #3662
Conversation
👋 Welcome back kbarrett! A progress list of the required criteria for merging this PR into |
@kimbarrett |
@kimbarrett |
@kimbarrett Syntax:
|
@kimbarrett Syntax:
|
/contributor add @kimbarrett |
@kimbarrett |
@kimbarrett |
8a98add
to
bc96315
Compare
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 looked at the runtime code, which looks fine. I didn't read the GC code.
@kimbarrett this pull request can not be integrated into git checkout new_dedup2
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
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.
Just FYI:
Concurrent GC, such as Sheanndoah and ZGC (if it decides to implement string deduplication in the future), can not enqueue candidates during concurrent thread root scanning, because of potential lock rank inversion between OopStorage lock and stack watermark lock.
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 CDS changes look reasonable to me.
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.
First pass, just comment suggestions for now.
I've made some improvements to comments, responding to Thomas's suggestions. Ive also changed some of the naming around the injected java.lang.String flags, with modification now using test-and-set semantics (and named accordingly), i.e. returning true if already set rather than if changed. I've not yet dealt with the merge conflict in Shenandoah, but it looks like it should be fairly easy. Just waiting for more comments before dealing with merging updates. |
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.
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.
Just some minor comments.
src/hotspot/share/gc/shared/stringdedup/stringDedupProcessor.cpp
Outdated
Show resolved
Hide resolved
Following up on an off-line discussion with @albertnetymk , I've done a little refactoring of Requests::add. I also made a few other small cleanups, noticed while dealing with @albertnetymk comments. I still haven't dealt with the accumulated merge conflicts. I'll be doing that next. |
@kimbarrett 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 |
The "merge from master" commit (ccb9951) doesn't build with Shenandoah. I've asked Zhengyu to take a look. |
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 "merge from master" commit (ccb9951) doesn't build with Shenandoah. I've asked Zhengyu to take a look.
Just missing a parameter:
index ddaa66ccc14..93a067fa22d 100644
--- a/src/hotspot/share/gc/shenandoah/shenandoahSTWMark.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahSTWMark.cpp
@@ -57,7 +57,7 @@ ShenandoahInitMarkRootsClosure::ShenandoahInitMarkRootsClosure(ShenandoahObjToSc
template <class T>
void ShenandoahInitMarkRootsClosure::do_oop_work(T* p) {
- ShenandoahMark::mark_through_ref<T, NO_DEDUP>(p, _queue, _mark_context, false);
+ ShenandoahMark::mark_through_ref<T, NO_DEDUP>(p, _queue, _mark_context, NULL, false);
}```
size_t _number_of_buckets; | ||
size_t _bucket_index; | ||
size_t _shrink_index; | ||
bool _grow_only; |
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.
Indentation
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.
Not sure what this indentation comment is referring to.
Thanks @zhengyu123 for the shenandoah merge fix. Thanks @iklam , @coleenp , @tschatzl , @albertnetymk for reviews. /integrate |
@kimbarrett Pushed as commit be0a655. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Please review this change to the String Deduplication facility. It is being
changed to use OopStorage to hold weak references to relevant objects,
rather than bespoke data structures requiring dedicated processing phases by
supporting GCs.
(The Shenandoah update was contributed by Zhengyu Gu.)
This change significantly simplifies the interface between a given GC and
the String Deduplication facility, which should make it much easier for
other GCs to opt in. However, this change does not alter the set of GCs
providing support; currently only G1 and Shenandoah support string
deduplication. Adding support by other GCs will be in followup RFEs.
Reviewing via the diffs might not be all that useful for some parts, as
several files have been essentially completely replaced, and a number of
files have been added or eliminated. The full webrev might be a better
place to look.
The major changes are in gc/shared/stringdedup/* and in the supporting
collectors, but there are also some smaller changes in other places, most
notably classfile/{stringTable,javaClasses}.
This change is additionally labeled for review by core-libs, although there
are no source changes there. This change injects a byte field of bits into
java.lang.String, using one of the previously unused padding bytes in that
class. (There were two unused bytes, now only one.)
Testing:
mach5 tier1-2 with and without -XX:+UseStringDeduplication
Locally (linux-x64) ran all of the existing tests that use string
deduplication with both G1 and Shenandoah. Note that
TestStringDeduplicationInterned.java is disabled for shenandoah, as it
currently fails, for reasons I haven't figured out but suspect are test
related.
shenandoah-only:
Performance tested baseline, baseline + stringdedup, new with stringdedup,
finding no significant differences.
/label hotspot
/label core-libs
/contributor @kimbarrett
/contributor @zhengyu123
Progress
Issue
Reviewers
Contributors
<kbarrett@openjdk.org>
<zgu@openjdk.org>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3662/head:pull/3662
$ git checkout pull/3662
Update a local copy of the PR:
$ git checkout pull/3662
$ git pull https://git.openjdk.java.net/jdk pull/3662/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3662
View PR using the GUI difftool:
$ git pr show -t 3662
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3662.diff