8378862: [lworld] flatArrayKlass::copy_array is missing a memory barrier when copying from flat array to non-flat array#2183
Conversation
|
👋 Welcome back fparain! A progress list of the required criteria for merging this PR into |
|
@fparain 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 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
|
/contributor add @xmas92 |
|
@fparain |
xmas92
left a comment
There was a problem hiding this comment.
lgtm. (Nice tests)
I think that eventually we would like to get these semantics into jcstress, it has been a good tool for finding some breakage in the JMM in the past.
|
Note that this requirement makes the |
It's a fair point. The safest approach would be to add the barrier in the buffering code itself, so no code getting a freshly buffered value, knowingly or not, would have to worry about this memory issue. This would mean adding the barrier in FlatValuePayload::read(TRAPS). I'll move the barrier and update the test accordingly. |
stefank
left a comment
There was a problem hiding this comment.
To me this looks like a safer approach. Thanks. I've not reviewed the test.
Small patch fixing a missing memory barrier in FlatArrayKlass::copy_array.
The unit test covers more scenario where a flat value has to be buffered before to be written to another heap variable. So far, these tests haven't shown any other issue (they were run repeatedly 50 times using Mach5).
However, the unit test is quite heavy, testing 5 different scenarios, and running each for 3 minutes, using all detected cores of the machine each time. This might qualify this unit test as a "resourcehog" test, it then should be moved to test/hotspot/jtreg/resourcehogs/
Fred
Progress
Issue
Reviewers
Contributors
<aboldtch@openjdk.org>Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/2183/head:pull/2183$ git checkout pull/2183Update a local copy of the PR:
$ git checkout pull/2183$ git pull https://git.openjdk.org/valhalla.git pull/2183/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 2183View PR using the GUI difftool:
$ git pr show -t 2183Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/2183.diff
Using Webrev
Link to Webrev Comment