-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8263002: Remove CDS MiscCode region #2861
Conversation
👋 Welcome back iklam! A progress list of the required criteria for merging this PR into |
/label remove serviceability |
@iklam |
Webrevs
|
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.
wow. Looks good to me.
*p += _buffer_to_requested_delta; | ||
assert(_builder->is_in_requested_static_archive(*p), "new pointer must point inside requested archive"); | ||
if (!_builder->is_in_buffer_space(*p)) { | ||
tty->print_cr("ohashii %p %p", p, *p); |
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.
What is ohashii ? Should this be an assert? Or log_error instead of tty->print
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 was debug code that I left behind by mistake. I've removed it.
@@ -215,7 +215,7 @@ CppVtableInfo** CppVtables::_index = NULL; | |||
char* CppVtables::dumptime_init() { | |||
assert(DumpSharedSpaces, "must"); | |||
size_t vtptrs_bytes = _num_cloned_vtable_kinds * sizeof(CppVtableInfo*); | |||
_index = (CppVtableInfo**)ArchiveBuilder::current()->mc_region()->allocate(vtptrs_bytes); | |||
_index = (CppVtableInfo**)ArchiveBuilder::current()->rw_region()->allocate(vtptrs_bytes); |
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 thought these would be read-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.
The vtables contain function pointers and need to be updated at runtime to match the latest location of libjvm.so, so they need to be R/W.
@@ -107,7 +103,7 @@ void DumpAllocStats::print_stats(int ro_all, int rw_all, int mc_all) { | |||
all_count, all_bytes, all_perc); | |||
|
|||
assert(all_ro_bytes == ro_all, "everything should have been counted"); | |||
assert(all_rw_bytes == rw_all, "everything should have been counted"); | |||
//assert(all_rw_bytes == rw_all, "everything should have been counted"); FIXME! |
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.
? Does this need to be fixed?
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 is fixed in the latest version. I added accounting for the vtables.
@iklam 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 |
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.
Hi Ioi,
This looks really good from a code simplification point of view!
I can't claim to fully understand all the code involved though.
Thanks,
David
Thanks @coleenp and @dholmes-ora for the review! |
@iklam Since your change was applied there has been 1 commit pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit d8a9c3c. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi @iklam, sorry to bother you, I found there are some comments that still refer to lingering mc regions. |
Thanks @kelthuzadx , I have filed JDK-8263998 (Remove mentions of mc region in comments) |
The CDS MiscCode region is used for:
(a) C++ vtables
(b) Method trampolines
(a) can be moved to the ReadWrite region
(b) were introduced in JDK-8145221 so we can delay writing into Methods. This was intended to improve copy-on-write sharing to reduce memory footprint. However, this hasn't been shown to have any significant effect (footprint of metadata usually is much smaller than the Java heap), and introduces a lot of complexity in the HotSpot code.
Removing (b) will make it easier to implement JDK-8026297 (Generating AdapterHandlerEntry during CDS dump), which will further improve start-up time.
============
Other benefits of removing the MiscCode region:
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/2861/head:pull/2861
$ git checkout pull/2861