Re: RFR: 8373118: Test java/lang/Thread/virtual/Starvation.java timed out [v31]

2026-02-05 Thread Viktor Klang
On Wed, 4 Feb 2026 14:38:03 GMT, Doug Lea  wrote:

>> Changes signal filtering to avoid possible starvation
>
> Doug Lea has updated the pull request with a new target base due to a merge 
> or a rebase. The incremental webrev excludes the unrelated changes brought in 
> by the merge/rebase. The pull request contains 43 additional commits since 
> the last revision:
> 
>  - Merge branch 'openjdk:master' into JDK-8373118
>  - reduce interference after stalls
>  - Avoid yield, for performance test
>  - Don't oversignal LIFO
>  - Try out different approach
>  - Simplify scan mode control by moving and reworking topLevelExec and 
> throwing on trim
>  - Another set of contend vs deactivate vs park tradeoffs
>  - Fix missing undo
>  - Merge branch 'openjdk:master' into JDK-8373118
>  - Use explicit store fences or atomics
>  - ... and 33 more: https://git.openjdk.org/jdk/compare/40f1886a...7ae93ed7

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

> 2809: if (q.base == b && t != null &&
> 2810: U.compareAndSetReference(a, k, t, null)) {
> 2811: q.base = b + 1;

Doesn't this mean that this write might end up not safely published? 🤔

-

PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2768904069


Re: RFR: 8373118: Test java/lang/Thread/virtual/Starvation.java timed out [v31]

2026-02-05 Thread Viktor Klang
On Wed, 4 Feb 2026 14:38:03 GMT, Doug Lea  wrote:

>> Changes signal filtering to avoid possible starvation
>
> Doug Lea has updated the pull request with a new target base due to a merge 
> or a rebase. The incremental webrev excludes the unrelated changes brought in 
> by the merge/rebase. The pull request contains 43 additional commits since 
> the last revision:
> 
>  - Merge branch 'openjdk:master' into JDK-8373118
>  - reduce interference after stalls
>  - Avoid yield, for performance test
>  - Don't oversignal LIFO
>  - Try out different approach
>  - Simplify scan mode control by moving and reworking topLevelExec and 
> throwing on trim
>  - Another set of contend vs deactivate vs park tradeoffs
>  - Fix missing undo
>  - Merge branch 'openjdk:master' into JDK-8373118
>  - Use explicit store fences or atomics
>  - ... and 33 more: https://git.openjdk.org/jdk/compare/04656767...7ae93ed7

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

> 2028: int phase = U.getInt(w, WorkQueue.PHASE);
> 2029: long sp = (phase + NEXTIDLE) & LMASK, pc = ctl;
> 2030: U.putInt(w, WorkQueue.PHASE, phase | IDLE);

So the idea here is to potentially delay the store?

-

PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2768887155


Re: RFR: 8373118: Test java/lang/Thread/virtual/Starvation.java timed out [v31]

2026-02-05 Thread Viktor Klang
On Wed, 4 Feb 2026 14:38:03 GMT, Doug Lea  wrote:

>> Changes signal filtering to avoid possible starvation
>
> Doug Lea has updated the pull request with a new target base due to a merge 
> or a rebase. The incremental webrev excludes the unrelated changes brought in 
> by the merge/rebase. The pull request contains 43 additional commits since 
> the last revision:
> 
>  - Merge branch 'openjdk:master' into JDK-8373118
>  - reduce interference after stalls
>  - Avoid yield, for performance test
>  - Don't oversignal LIFO
>  - Try out different approach
>  - Simplify scan mode control by moving and reworking topLevelExec and 
> throwing on trim
>  - Another set of contend vs deactivate vs park tradeoffs
>  - Fix missing undo
>  - Merge branch 'openjdk:master' into JDK-8373118
>  - Use explicit store fences or atomics
>  - ... and 33 more: https://git.openjdk.org/jdk/compare/460535d9...7ae93ed7

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

> 1986: ran = 1;
> 1987: ++taken;
> 1988: if (propagate && 
> U.getReferenceAcquire(a, np) != null)

At this point, it might even make sense to fold the propagate logic into the 
if-clause itself. Something like:


ran = 1;
++taken;
if ((rnt != null) &&
(ps < 0 ||
 ((qid & 1) == 0 &&
  (fifo != 0 || taken == 1))) && 
U.getReferenceAcquire(a, np) != null)

-

PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r2768875722


Re: RFR: 8373118: Test java/lang/Thread/virtual/Starvation.java timed out [v31]

2026-02-04 Thread Doug Lea
> Changes signal filtering to avoid possible starvation

Doug Lea has updated the pull request with a new target base due to a merge or 
a rebase. The incremental webrev excludes the unrelated changes brought in by 
the merge/rebase. The pull request contains 43 additional commits since the 
last revision:

 - Merge branch 'openjdk:master' into JDK-8373118
 - reduce interference after stalls
 - Avoid yield, for performance test
 - Don't oversignal LIFO
 - Try out different approach
 - Simplify scan mode control by moving and reworking topLevelExec and throwing 
on trim
 - Another set of contend vs deactivate vs park tradeoffs
 - Fix missing undo
 - Merge branch 'openjdk:master' into JDK-8373118
 - Use explicit store fences or atomics
 - ... and 33 more: https://git.openjdk.org/jdk/compare/40833d95...7ae93ed7

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/28797/files
  - new: https://git.openjdk.org/jdk/pull/28797/files/a7f1d63f..7ae93ed7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28797&range=30
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28797&range=29-30

  Stats: 99514 lines in 1723 files changed: 50037 ins; 26428 del; 23049 mod
  Patch: https://git.openjdk.org/jdk/pull/28797.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28797/head:pull/28797

PR: https://git.openjdk.org/jdk/pull/28797