-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8351933: Inaccurate masking of TC subfield decrement in ForkJoinPool #24034
Conversation
👋 Welcome back dchuyko! A progress list of the required criteria for merging this PR into |
@dchuyko 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 206 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 |
Webrevs
|
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.
Hi Dmitry. Thank you for putting up the pull request.
While this has been included into upcoming FJP update for better delayed task handling DougLea@9b51b7a (JDK-8319447), a separate commit will make the fix much easier in update releases. |
It seems this is an overflow for the TC part of the flag. The RC part seems to be able to overflow too, but because it occupies the higher bits its overflow will never affect the TC. And this is the only site where TC is masked with |
Yes, from this point RC (in)accurate masking can be considered cosmetic, but this might be the source of this bug with TC.
'(v.stackPred & SP_MASK) | (UC_MASK & c)' patterns seem ok to me, but for all subfield arithmetic it would be more clear to see all subfields recombined. |
So I'd propose to consider RC masking separately, and maybe as a part of larger FJP update (such as JDK-8319447), without a need to backport. |
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 issue looks valid to me and the fix looks good. Would be nice if another reviewer can double check.
/reviewers 2 reviewer |
Note that some reviewers may be busy with the ongoing JavaOne. Please wait for another reviewer in area to double check. |
As noted, this is fixed by the FJP changes in JDK-8319447. If the change is going in separately then best to take the exact change to tryTrim to avoid merge issues. |
Agree, reformatted the code. That doesn't affect any backports (already prepared). |
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.
Yes, this is the right fix; thanks!
Thanks for reviews! |
/integrate |
Going to push as commit fed34e4.
Your commit was automatically rebased without conflicts. |
Please review a tiny fix in the ForkJoinPool. Since JDK 9 (JDK-8134852 [1]) in one case when TC subfield in ctl field is decremented, the applied masking (UMASK, upper bits) may not preserve neighbor RC subfield sometimes. In JDKs prior to 19 FJP may stop executing tasks, which requires a long running application restart [2]. Since 19 it is even harder to reproduce because of the separate parallelism field.
The fix is to replace 'UMASK & (c - TC_UNIT)' with '(c & RC_MASK) | ((c - TC_UNIT) & TC_MASK)' which preserves the RC part of the compareAndSetCtl() candidate argument. On 17u and 11u that repairs known tests and applications. This PR is for the mainline, and I intend to backport it to 21u, 17u and 11u.
[1] https://bugs.openjdk.org/browse/JDK-8134852
[2] https://bugs.openjdk.org/browse/JDK-8330017
Progress
Issue
Reviewers
Reviewers without OpenJDK IDs
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24034/head:pull/24034
$ git checkout pull/24034
Update a local copy of the PR:
$ git checkout pull/24034
$ git pull https://git.openjdk.org/jdk.git pull/24034/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24034
View PR using the GUI difftool:
$ git pr show -t 24034
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24034.diff
Using Webrev
Link to Webrev Comment