-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8310743: assert(reserved_rgn != nullptr) failed: Add committed region, No reserved region found #14730
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
…, No reserved region found
|
👋 Welcome back aboldtch! A progress list of the required criteria for merging this PR into |
|
@xmas92 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 34 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 |
| for (; index < _num_reservations; ++index) { | ||
| const size_t reservation_size = _reservations[index]._size; | ||
| if (*offset_in_reservation < reservation_size) { | ||
| break; |
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 wonder if one can return index here. Then, after the for-loop, one can write fatal(...).
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.
It was purposely written like this avoiding a fatal/guarantee/ShouldNotReachHere, the intent is to have bugs only be caught in debug. If we return _num_reservations as an index all that happens is that we do not register some commit with nmt. Which seems more favourable than crashing if some bug were to slip through into production.
| offset_in_reservation = 0; | ||
| } | ||
|
|
||
| assert(left_to_process == 0, "everything was not commited"); |
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.
When will this be reachable? I'd expect the if-check inside the for-loop to handle exit-condition.
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 we run out of reservations. That is the virtual memory reservations range is less than the physical memory offset we are committing. Such a thing should not be reachable and is a bug. But if it does happen it should be caught here.
| if (MemTracker::enabled()) { | ||
| Tracker tracker(Tracker::uncommit); | ||
| tracker.record((address)sub_range_addr, sub_range_size); | ||
| } |
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.
Sth like record_virtual_memory_uncommit would make this more symmetric. (Better be done in a followup PR though.)
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 agree. Purposely kept this minimal as it needs to be backported to 21.
albertnetymk
left a comment
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 think it's better to fail-early when sth unexpected occurs, so both places warrant a should-not-reach-here; subjective though.
|
I generally agree with the fail early strategy. My personal ILW assessment of the two approaches made me favour this one. But maybe I'll reassess this in the future. Thanks for all reviews. /integrate |
|
Going to push as commit f393975.
Your commit was automatically rebased without conflicts. |
JDK-8309675 tried to solve the issue of NMT reporting to much committed memory by faking the virtual addresses registered when committing physical memory. This mapping was simply the
virtual address = physical offset in backing file + heap base. This works when ZGC gets a contiguous heap which starts at the heap base. However fails if it does not start at the heap base or is discontiguous.This proposal fixes this by keeping track of all the reserved virtual address ranges and by creating a mapping from the physical offsets to the actual reserved virtual address ranges. If the physical offsets committed maps to multiple reserved ranges, it is processed as multiple commits.
The develop flag
ZForceDiscontiguousHeapReservationsis introduced to test the discontiguous heap feature and interactions.Testing:
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14730/head:pull/14730$ git checkout pull/14730Update a local copy of the PR:
$ git checkout pull/14730$ git pull https://git.openjdk.org/jdk.git pull/14730/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14730View PR using the GUI difftool:
$ git pr show -t 14730Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14730.diff
Webrev
Link to Webrev Comment