RFR: 8336707: Contention of ForkJoinPool grows when stealing works [v24]

Viktor Klang vklang at openjdk.org
Tue Nov 12 14:18:29 UTC 2024


On Mon, 11 Nov 2024 16:39:47 GMT, Doug Lea <dl at openjdk.org> wrote:

>> This addresses tendencies in previous update to increase fencing, scanning, and signalling that can increase contention, and slow down performance especially on ARM platforms. It also uses more ARM-friendly constructions to reduce overhead (leading to several changes that all of the same form),
>
> Doug Lea has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Address review comments

src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1870:

> 1868:         else if ((phase = w.phase) != 0 && (phase & IDLE) != 0)
> 1869:             releaseWaiters();              // ensure released
> 1870:         if (w == null || w.source != DROPPED) {

@DougLea If this isn't intended to be an `else-if` I'd recommend adding a line of whitespace between it and the line above.

src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1877:

> 1875:                                        (LMASK & c)))));
> 1876:         }
> 1877:         if (phase != 0 && w != null && (runState & STOP) == 0L) {

@DougLea If this isn't intended to be an else-if I'd recommend adding a line of whitespace between it and the line above.

src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1888:

> 1886:             unlockRunState();
> 1887:         }
> 1888:         if ((tryTerminate(false, false) & STOP) == 0L &&

@DougLea If this isn't intended to be an else-if I'd recommend adding a line of whitespace between it and the line above.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21507#discussion_r1838177673
PR Review Comment: https://git.openjdk.org/jdk/pull/21507#discussion_r1838178044
PR Review Comment: https://git.openjdk.org/jdk/pull/21507#discussion_r1838179809


More information about the core-libs-dev mailing list