-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8277990: NMT: Remove NMT shutdown capability #6640
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
👋 Welcome back zgu! A progress list of the required criteria for merging this PR into |
@zhengyu123 The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
Very nice simplification. Before diving in, could you explain a bit the locking changes in MallocSiteTable? To me, the association with shutdown is not immediately clear. Thanks! |
You are talking about As @dholmes-ora mentioned in PR #6267, the name is misleading: it is not a lock, but a countdown latch. It allows multi-reader to access
|
Hmmm... sounds like a ReadersWriter lock to me... Any number of Readers and a single |
Just to see I get it right, AccessLock is not needed anymore because we don't destroy the MallocSiteTable? We don't need it to guard the table when we add callstacks? |
Well, the difference is that, it does not have well defined critical section. It depends on other structures/operations for data integrity. |
Yes. Ironically, adding entry only requires shared access, it uses |
I see. That's nice. Thanks for the clarification. |
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.
Nice cleanup.
You missed a few:
- test/lib/jdk/test/whitebox/WhiteBox.java,
NMTChangeTrackingLevel
- test/lib/sun/hotspot/WhiteBox.java, same
Will the removal of WB functions cause incompatibilities with older versions of jtreg (can't imagine it does, just wondering)?
Cheers, Thomas
Out of curious, why have two versions?
No idea.
|
No clue :) |
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.
Looks good to me. Thank you for doing this!
..Thomas
@zhengyu123 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 107 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Mailing list message from David Holmes on hotspot-dev: On 3/12/2021 4:23 am, Zhengyu Gu wrote:
Historical. WB is primarily a hotspot test aid and resided in the
If you mean in terms of @require checking that involves WB I believe Cheers, |
Thanks for the review, @tstuefe |
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.
Very nice cleanup. Some minor suggestions below, feel free to ignore them.
@@ -281,7 +260,7 @@ void* MallocTracker::record_malloc(void* malloc_base, size_t size, MEMFLAGS flag | |||
assert(((size_t)memblock & (sizeof(size_t) * 2 - 1)) == 0, "Alignment check"); | |||
|
|||
#ifdef ASSERT | |||
if (level > NMT_minimal) { | |||
if (level >= NMT_summary) { |
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.
if (level >= NMT_summary) { | |
if (level > NMT_off) { |
This way, we don't care where NMT_summary
is in the enum. We enter this code on all paths when NMT is enabled?
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.
Actually, maybe even call to enabled()
here?
NMT_TrackingLevel level = tracking_level(); | ||
if (level >= NMT_summary) { | ||
report(level == NMT_summary, output, 1); | ||
if (enabled()) { |
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.
Looks to me, you can do enabled() && Atomic::cmpxchg(...)
, thus saving a tiny bit of CPU cycles when NMT is disabled?
// Transition the tracking level to specified level | ||
static bool transition_to(NMT_TrackingLevel level); | ||
static inline bool enabled() { | ||
return _tracking_level >= NMT_summary; |
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.
return _tracking_level >= NMT_summary; | |
return _tracking_level > NMT_off; |
Same reason as above.
Let's ship this, I'm really interested in getting this into JDK 18 before ramp-down on Thursday. |
Patch is still good after latest changes. |
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.
Good. Yes, let's try to make it into JDK 18.
/integrate |
Going to push as commit 5a036ac.
Your commit was automatically rebased without conflicts. |
@zhengyu123 Pushed as commit 5a036ac. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
NMT shutdown functionality is a remnant of its first implementation, which could consume excessive amount of memory, therefore, it needed capability to shut it self down to ensure health of JVM. This is no longer a case for current implementation.
After JDK-8277946, there is no longer a use, so it can be removed.
Test:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6640/head:pull/6640
$ git checkout pull/6640
Update a local copy of the PR:
$ git checkout pull/6640
$ git pull https://git.openjdk.java.net/jdk pull/6640/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6640
View PR using the GUI difftool:
$ git pr show -t 6640
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6640.diff