8386546: Fix race when reserving memory with NUMA interleaving on Windows#31507
8386546: Fix race when reserving memory with NUMA interleaving on Windows#31507roberttoyonaga wants to merge 1 commit into
Conversation
|
👋 Welcome back roberttoyonaga! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@roberttoyonaga 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. |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
Summary
Previously on Windows Hotspot used the following race-y pattern to reserve a virtual memory region and divide it up among NUMA nodes:
See allocate_pages_individually.
VirtualAlloc2 (available since Windows version 1803) removes the need for this race-y code by introducing "placeholders". Placeholders allow for reserving regions, and later splitting them up while still holding the reservation.
This is a scoped-down version of JDK-8376561 and #30270 limited to the changes required to eliminate the NUMA race. This is the 2nd change in a series of changes that take advantage of VirtualAlloc2 to replace races in Windows code. The preceding change was JDK-8385586.
Divergences from JDK-8376561 / #30270 :
os::Placeholder API has been moved intoos::win32::in order to constrain the scope of changes to Windows code only.Notes
reserve_placeholder_memory,split_memory, andconvert_to_reservedcould have been made internal helper functions in os_windows.cpp. However, I added them toos::win32::so that they could be unit tested better.Testing:
Tested locally on Windows.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31507/head:pull/31507$ git checkout pull/31507Update a local copy of the PR:
$ git checkout pull/31507$ git pull https://git.openjdk.org/jdk.git pull/31507/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 31507View PR using the GUI difftool:
$ git pr show -t 31507Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31507.diff