-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8366241: NMT: Consolidate [Virtual/Committed/Reserved]Regions into one structure #27137
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
base: master
Are you sure you want to change the base?
8366241: NMT: Consolidate [Virtual/Committed/Reserved]Regions into one structure #27137
Conversation
|
👋 Welcome back azafari! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@afshin-zafari 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. |
|
Waiting for 8366363 to be integrated. Those changes to be merged here. |
|
@afshin-zafari this pull request can not be integrated into git checkout _8366241_nmt_consolidate_structures
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
|
|
||
| bool is_valid() const { return base() != nullptr && size() != 0;} | ||
|
|
||
| inline void set_reserved_call_stack(const NativeCallStack& stack) { _reserved_stack = stack; } |
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.
Is this used? Doesn't it make more sense for these values to be constant and the VMR to be an immutable object (in essence).
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.
No it is not used anymore. Removed.
We cannot make VMR immutable, since we need to return a VMR from tree->find_reseved_region(). We need it to be COPYABLE.
|
@afshin-zafari This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
|
/keepalive |
|
@afshin-zafari The pull request is being re-evaluated and the inactivity timeout has been reset. |
| private: | ||
| NativeCallStack _stack; | ||
| MemTag _mem_tag; | ||
| bool is_valid() const { return base() != nullptr && size() != 0;} |
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 old structures had the base address and size by default initialised to 1. I think the new "invalid" values of 0 and 0 are more ergonomic, but I'm wondering, what's the reason we used 1 originally?
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.
IIRC, they were used for debugging and tracing some cases that happened during VMATree implementation.
| } | ||
| } | ||
|
|
||
| VirtualMemoryRegion(address addr, size_t size, const NativeCallStack& stack, bool committed) : |
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.
Correct me if I'm wrong but is this committed only ever true? And then we use the presence of this constructor parameter to decide whether we are creating a committed or a reserved region?
If so, at the very least we should assert that committed is true. But I think it would be nicer to make the constructor private and make some static factory methods akin to VirtualMemoryRegion::committed and VirtualMemoryRegion::reserved.
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.
You are right. The committed is used here to distinguish signatures of the VMR constructor.
VMR(address, size_t, NativeCallStack) without this parameter would have been resolved to VMR(address, size_t, NCS, MemTag= mtNone). Actually it doesn't matter if the value of the parameter be true or false, the bool type does the work for us.
There is only one instance that uses this signature: regionsTree.inline.hpp:41.
Regarding your suggestion, we can provide a static method to build a Committed memory region and pass into it the required values. Something like:
VMR cmr;
VMR::create_cmr(addr, size, stack, cmr);// cmr is passed by ref and filled in
The structures
CommittedMemoryRegionandReservedMemoryRegionare merged into theVirtualMemoryRegion.Tests:
tiers1-5, main platforms, debug/product
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27137/head:pull/27137$ git checkout pull/27137Update a local copy of the PR:
$ git checkout pull/27137$ git pull https://git.openjdk.org/jdk.git pull/27137/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27137View PR using the GUI difftool:
$ git pr show -t 27137Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27137.diff
Using Webrev
Link to Webrev Comment