On Thu, 13 Mar 2025 13:34:51 GMT, Dmitry Chuyko <dchu...@openjdk.org> wrote:

> 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)' 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

Hi Dmitry. Thank you for putting up the pull request.

-------------

Marked as reviewed by lujie1...@github.com (no known OpenJDK username).

PR Review: https://git.openjdk.org/jdk/pull/24034#pullrequestreview-2683424851

Reply via email to