From stefank at openjdk.org Wed Oct 1 07:36:49 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Wed, 1 Oct 2025 07:36:49 GMT Subject: RFR: 8368966: Remove spurious VMStructs friends In-Reply-To: <8OJWg3O52vyoX_mFGHHpTsBmWvHeBVJC3Pq8IYKY2rk=.205ce94a-a9c8-4d85-8321-9268b1a29b68@github.com> References: <8OJWg3O52vyoX_mFGHHpTsBmWvHeBVJC3Pq8IYKY2rk=.205ce94a-a9c8-4d85-8321-9268b1a29b68@github.com> Message-ID: On Tue, 30 Sep 2025 16:35:36 GMT, Francesco Andreuzzi wrote: > In this PR I propose a small clean up to remove several spurious friends of `VMStructs`. Either I could not find any reference to them in `vmStructs*`, or no private symbols is mentioned. > > Passes tier1 and tier2 (fastdebug). src/hotspot/share/utilities/growableArray.hpp line 715: > 713: template > 714: class GrowableArray : public GrowableArrayWithAllocator> { > 715: friend class VMStructs; I was a bit surprised to see that you added a friend declaration. Was this done because you removed the one in the parent class? I see that vmStructs.cpp has GrowableArray listed: nonstatic_field(GrowableArrayBase, _len, int) \ nonstatic_field(GrowableArrayBase, _capacity, int) \ nonstatic_field(GrowableArray, _data, int*) So, I guess it makes sense to move it here. OTOH, the exposed `_data` field is inside GrowableArrayView, so maybe it would work to put the friend declaration there instead? I guess either way is fine but there's a risk that there will be some churn about where to put the friend declaration if someone wants add one of the classes between (and including) GrowableArrayView and GrowableArray. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27583#discussion_r2393707385 From fandreuzzi at openjdk.org Wed Oct 1 09:08:09 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Wed, 1 Oct 2025 09:08:09 GMT Subject: RFR: 8368989: Use NMethodMarkingScope and ThreadsClaimTokenScope in shenandoahSTWMark Message-ID: Replace `StrongRootsScope` with `ThreadsClaimTokenScope` in `shenandoahSTWMark` to be more precise with what is needed and why. - `ShenandoahSTWMark` uses `MarkingNMethodClosure`, so we also need `NMethodMarkingScope`. - `nworkers` is guaranteed to be > 0 Passes `tier1` and `tier2` (fastdebug). ------------- Commit messages: - trigger - replace Changes: https://git.openjdk.org/jdk/pull/27589/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27589&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8368989 Stats: 9 lines in 1 file changed: 5 ins; 2 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27589.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27589/head:pull/27589 PR: https://git.openjdk.org/jdk/pull/27589 From shade at openjdk.org Wed Oct 1 09:15:31 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Wed, 1 Oct 2025 09:15:31 GMT Subject: RFR: 8368989: Use NMethodMarkingScope and ThreadsClaimTokenScope in shenandoahSTWMark In-Reply-To: References: Message-ID: On Wed, 1 Oct 2025 08:57:07 GMT, Francesco Andreuzzi wrote: > Replace `StrongRootsScope` with `ThreadsClaimTokenScope` in `shenandoahSTWMark` to be more precise with what is needed and why. > > - `ShenandoahSTWMark` uses `MarkingNMethodClosure`, so we also need `NMethodMarkingScope`. > - `nworkers` is guaranteed to be > 0 > > Passes `tier1` and `tier2` (fastdebug). Marked as reviewed by shade (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27589#pullrequestreview-3288228821 From ayang at openjdk.org Wed Oct 1 09:22:26 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Wed, 1 Oct 2025 09:22:26 GMT Subject: RFR: 8368989: Use NMethodMarkingScope and ThreadsClaimTokenScope in shenandoahSTWMark In-Reply-To: References: Message-ID: On Wed, 1 Oct 2025 08:57:07 GMT, Francesco Andreuzzi wrote: > Replace `StrongRootsScope` with `ThreadsClaimTokenScope` in `shenandoahSTWMark` to be more precise with what is needed and why. > > - `ShenandoahSTWMark` uses `MarkingNMethodClosure`, so we also need `NMethodMarkingScope`. > - `nworkers` is guaranteed to be > 0 > > Passes `tier1` and `tier2` (fastdebug). Marked as reviewed by ayang (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27589#pullrequestreview-3288254141 From fandreuzzi at openjdk.org Wed Oct 1 14:26:12 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Wed, 1 Oct 2025 14:26:12 GMT Subject: RFR: 8368966: Remove spurious VMStructs friends In-Reply-To: References: <8OJWg3O52vyoX_mFGHHpTsBmWvHeBVJC3Pq8IYKY2rk=.205ce94a-a9c8-4d85-8321-9268b1a29b68@github.com> Message-ID: On Wed, 1 Oct 2025 07:34:00 GMT, Stefan Karlsson wrote: > Was this done because you removed the one in the parent class? Yeah that's the reasoning. > the exposed _data field is inside GrowableArrayView, so maybe it would work to put the friend declaration there instead? Actually I'm a bit confused. What you suggest _should not_ work, but it compiles happily. Friendship is not inherited, so we should not be able to access `GrowableArray::_data` if we move `friend class VMStructs` to `GrowableArrayView`. I thought maybe that was a quirk of `offsetof`, but that does not seem to be the case: #include class X { protected: int field; }; class Y : public X {}; class Z { friend X; void doStuff() { Y y; // both these are illegal // int foo = y.field; // int foo = offsetof(Y, field); } }; ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27583#discussion_r2394806258 From fandreuzzi at openjdk.org Wed Oct 1 14:45:57 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Wed, 1 Oct 2025 14:45:57 GMT Subject: RFR: 8368966: Remove spurious VMStructs friends In-Reply-To: References: <8OJWg3O52vyoX_mFGHHpTsBmWvHeBVJC3Pq8IYKY2rk=.205ce94a-a9c8-4d85-8321-9268b1a29b68@github.com> Message-ID: <5KijkMyIVGa9y4yQ8WZD-A7sop9fmMbDNPHuq0kW_5Q=.08f0e165-1833-4c35-b261-4d0806c30869@github.com> On Wed, 1 Oct 2025 07:34:00 GMT, Stefan Karlsson wrote: > Was this done because you removed the one in the parent class? Yeah that's the reasoning. > I guess either way is fine but there's a risk that there will be some churn about where to put the friend declaration if someone wants add one of the classes between (and including) GrowableArrayView and GrowableArray. Given that `friend` _should not be_ inherited, I'd expect the `friend` declaration on the exact class which we use in `vmStructs*.cpp`. However, I'm curious about why what you suggest compiles. Moving `friend class VMStructs` from `GrowableArray` to `GrowableArrayView` should not allow us to access `_data` via `GrowableArray`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27583#discussion_r2394868333 From stefank at openjdk.org Thu Oct 2 07:59:46 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Thu, 2 Oct 2025 07:59:46 GMT Subject: RFR: 8368966: Remove spurious VMStructs friends In-Reply-To: <8OJWg3O52vyoX_mFGHHpTsBmWvHeBVJC3Pq8IYKY2rk=.205ce94a-a9c8-4d85-8321-9268b1a29b68@github.com> References: <8OJWg3O52vyoX_mFGHHpTsBmWvHeBVJC3Pq8IYKY2rk=.205ce94a-a9c8-4d85-8321-9268b1a29b68@github.com> Message-ID: On Tue, 30 Sep 2025 16:35:36 GMT, Francesco Andreuzzi wrote: > In this PR I propose a small clean up to remove several spurious friends of `VMStructs`. Either I could not find any reference to them in `vmStructs*`, or no private symbols is mentioned. > > Passes tier1 and tier2 (fastdebug). Marked as reviewed by stefank (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27583#pullrequestreview-3293095646 From stefank at openjdk.org Thu Oct 2 07:59:48 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Thu, 2 Oct 2025 07:59:48 GMT Subject: RFR: 8368966: Remove spurious VMStructs friends In-Reply-To: <5KijkMyIVGa9y4yQ8WZD-A7sop9fmMbDNPHuq0kW_5Q=.08f0e165-1833-4c35-b261-4d0806c30869@github.com> References: <8OJWg3O52vyoX_mFGHHpTsBmWvHeBVJC3Pq8IYKY2rk=.205ce94a-a9c8-4d85-8321-9268b1a29b68@github.com> <5KijkMyIVGa9y4yQ8WZD-A7sop9fmMbDNPHuq0kW_5Q=.08f0e165-1833-4c35-b261-4d0806c30869@github.com> Message-ID: <8hpnnfueQUsV2r1a1h1N99OMdd0p8EpYdRx83blcgOw=.6a3fbad7-3f79-48fe-be00-a6ee68c9de38@github.com> On Wed, 1 Oct 2025 14:42:13 GMT, Francesco Andreuzzi wrote: >> src/hotspot/share/utilities/growableArray.hpp line 715: >> >>> 713: template >>> 714: class GrowableArray : public GrowableArrayWithAllocator> { >>> 715: friend class VMStructs; >> >> I was a bit surprised to see that you added a friend declaration. Was this done because you removed the one in the parent class? >> >> I see that vmStructs.cpp has GrowableArray listed: >> >> nonstatic_field(GrowableArrayBase, _len, int) \ >> nonstatic_field(GrowableArrayBase, _capacity, int) \ >> nonstatic_field(GrowableArray, _data, int*) >> >> >> So, I guess it makes sense to move it here. OTOH, the exposed `_data` field is inside GrowableArrayView, so maybe it would work to put the friend declaration there instead? >> >> I guess either way is fine but there's a risk that there will be some churn about where to put the friend declaration if someone wants add one of the classes between (and including) GrowableArrayView and GrowableArray. > >> Was this done because you removed the one in the parent class? > > Yeah that was my reasoning. > >> I guess either way is fine but there's a risk that there will be some churn about where to put the friend declaration if someone wants add one of the classes between (and including) GrowableArrayView and GrowableArray. > > To me it looks less confusing to have the `friend` declaration for the type which is referenced in `vmStructs`. But both are legal, do you think moving the `friend` declaration to the type which declares the referenced field would be more appropriate? If yes, I'll track other similar patterns too. I don't think such churn is important for VMStructs. Let's keep your change. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27583#discussion_r2397576465 From fandreuzzi at openjdk.org Thu Oct 2 08:18:46 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Thu, 2 Oct 2025 08:18:46 GMT Subject: RFR: 8368966: Remove spurious VMStructs friends In-Reply-To: References: <8OJWg3O52vyoX_mFGHHpTsBmWvHeBVJC3Pq8IYKY2rk=.205ce94a-a9c8-4d85-8321-9268b1a29b68@github.com> Message-ID: On Thu, 2 Oct 2025 07:56:39 GMT, Stefan Karlsson wrote: >> In this PR I propose a small clean up to remove several spurious friends of `VMStructs`. Either I could not find any reference to them in `vmStructs*`, or no private symbols is mentioned. >> >> Passes tier1 and tier2 (fastdebug). > > Marked as reviewed by stefank (Reviewer). Thanks for the review @stefank. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27583#issuecomment-3359780526 From duke at openjdk.org Thu Oct 2 08:18:48 2025 From: duke at openjdk.org (duke) Date: Thu, 2 Oct 2025 08:18:48 GMT Subject: RFR: 8368966: Remove spurious VMStructs friends In-Reply-To: <8OJWg3O52vyoX_mFGHHpTsBmWvHeBVJC3Pq8IYKY2rk=.205ce94a-a9c8-4d85-8321-9268b1a29b68@github.com> References: <8OJWg3O52vyoX_mFGHHpTsBmWvHeBVJC3Pq8IYKY2rk=.205ce94a-a9c8-4d85-8321-9268b1a29b68@github.com> Message-ID: On Tue, 30 Sep 2025 16:35:36 GMT, Francesco Andreuzzi wrote: > In this PR I propose a small clean up to remove several spurious friends of `VMStructs`. Either I could not find any reference to them in `vmStructs*`, or no private symbols is mentioned. > > Passes tier1 and tier2 (fastdebug). @fandreuz Your change (at version 1f873d0d1e693d0d73772376041cc6171bf13be2) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27583#issuecomment-3359787966 From fandreuzzi at openjdk.org Thu Oct 2 08:38:31 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Thu, 2 Oct 2025 08:38:31 GMT Subject: RFR: 8368989: Use NMethodMarkingScope and ThreadsClaimTokenScope in shenandoahSTWMark In-Reply-To: References: Message-ID: On Wed, 1 Oct 2025 09:19:35 GMT, Albert Mingkun Yang wrote: >> Replace `StrongRootsScope` with `ThreadsClaimTokenScope` in `shenandoahSTWMark` to be more precise with what is needed and why. >> >> - `ShenandoahSTWMark` uses `MarkingNMethodClosure`, so we also need `NMethodMarkingScope`. >> - `nworkers` is guaranteed to be > 0 >> >> Passes `tier1` and `tier2` (fastdebug). > > Marked as reviewed by ayang (Reviewer). Thanks for the review @albertnetymk and @shipilev. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27589#issuecomment-3359876182 From duke at openjdk.org Thu Oct 2 08:38:33 2025 From: duke at openjdk.org (duke) Date: Thu, 2 Oct 2025 08:38:33 GMT Subject: RFR: 8368989: Use NMethodMarkingScope and ThreadsClaimTokenScope in shenandoahSTWMark In-Reply-To: References: Message-ID: On Wed, 1 Oct 2025 08:57:07 GMT, Francesco Andreuzzi wrote: > Replace `StrongRootsScope` with `ThreadsClaimTokenScope` in `shenandoahSTWMark` to be more precise with what is needed and why. > > - `ShenandoahSTWMark` uses `MarkingNMethodClosure`, so we also need `NMethodMarkingScope`. > - `nworkers` is guaranteed to be > 0 > > Passes `tier1` and `tier2` (fastdebug). @fandreuz Your change (at version 442bc5be6ca713c7fcabf8a0ad87f74f97d58181) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27589#issuecomment-3359879615 From ayang at openjdk.org Thu Oct 2 08:47:52 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Thu, 2 Oct 2025 08:47:52 GMT Subject: RFR: 8368966: Remove spurious VMStructs friends In-Reply-To: <8OJWg3O52vyoX_mFGHHpTsBmWvHeBVJC3Pq8IYKY2rk=.205ce94a-a9c8-4d85-8321-9268b1a29b68@github.com> References: <8OJWg3O52vyoX_mFGHHpTsBmWvHeBVJC3Pq8IYKY2rk=.205ce94a-a9c8-4d85-8321-9268b1a29b68@github.com> Message-ID: <8njjGUUpbw5NKV_Rh8MUw4lJ6dqiSUWeSuXC6Thqh1o=.d8b2297d-f3d9-450b-850a-23decdc11320@github.com> On Tue, 30 Sep 2025 16:35:36 GMT, Francesco Andreuzzi wrote: > In this PR I propose a small clean up to remove several spurious friends of `VMStructs`. Either I could not find any reference to them in `vmStructs*`, or no private symbols is mentioned. > > Passes tier1 and tier2 (fastdebug). Marked as reviewed by ayang (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27583#pullrequestreview-3293343742 From fandreuzzi at openjdk.org Thu Oct 2 09:02:00 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Thu, 2 Oct 2025 09:02:00 GMT Subject: Integrated: 8368966: Remove spurious VMStructs friends In-Reply-To: <8OJWg3O52vyoX_mFGHHpTsBmWvHeBVJC3Pq8IYKY2rk=.205ce94a-a9c8-4d85-8321-9268b1a29b68@github.com> References: <8OJWg3O52vyoX_mFGHHpTsBmWvHeBVJC3Pq8IYKY2rk=.205ce94a-a9c8-4d85-8321-9268b1a29b68@github.com> Message-ID: On Tue, 30 Sep 2025 16:35:36 GMT, Francesco Andreuzzi wrote: > In this PR I propose a small clean up to remove several spurious friends of `VMStructs`. Either I could not find any reference to them in `vmStructs*`, or no private symbols is mentioned. > > Passes tier1 and tier2 (fastdebug). This pull request has now been integrated. Changeset: dfd38322 Author: Francesco Andreuzzi Committer: Albert Mingkun Yang URL: https://git.openjdk.org/jdk/commit/dfd383224dbc2e41c9f44b1acd09ffb179cc38f3 Stats: 80 lines in 47 files changed: 1 ins; 78 del; 1 mod 8368966: Remove spurious VMStructs friends Reviewed-by: stefank, ayang ------------- PR: https://git.openjdk.org/jdk/pull/27583 From roland at openjdk.org Thu Oct 2 09:08:06 2025 From: roland at openjdk.org (Roland Westrelin) Date: Thu, 2 Oct 2025 09:08:06 GMT Subject: RFR: 8354282: C2: more crashes in compiled code because of dependency on removed range check CastIIs [v3] In-Reply-To: References: Message-ID: > This is a variant of 8332827. In 8332827, an array access becomes > dependent on a range check `CastII` for another array access. When, > after loop opts are over, that RC `CastII` was removed, the array > access could float and an out of bound access happened. With the fix > for 8332827, RC `CastII`s are no longer removed. > > With this one what happens is that some transformations applied after > loop opts are over widen the type of the RC `CastII`. As a result, the > type of the RC `CastII` is no longer narrower than that of its input, > the `CastII` is removed and the dependency is lost. > > There are 2 transformations that cause this to happen: > > - after loop opts are over, the type of the `CastII` nodes are widen > so nodes that have the same inputs but a slightly different type can > common. > > - When pushing a `CastII` through an `Add`, if of the type both inputs > of the `Add`s are non constant, then we end up widening the type > (the resulting `Add` has a type that's wider than that of the > initial `CastII`). > > There are already 3 types of `Cast` nodes depending on the > optimizations that are allowed. Either the `Cast` is floating > (`depends_only_test()` returns `true`) or pinned. Either the `Cast` > can be removed if it no longer narrows the type of its input or > not. We already have variants of the `CastII`: > > - if the Cast can float and be removed when it doesn't narrow the type > of its input. > > - if the Cast is pinned and be removed when it doesn't narrow the type > of its input. > > - if the Cast is pinned and can't be removed when it doesn't narrow > the type of its input. > > What we need here, I think, is the 4th combination: > > - if the Cast can float and can't be removed when it doesn't narrow > the type of its input. > > Anyway, things are becoming confusing with all these different > variants named in ways that don't always help figure out what > constraints one of them operate under. So I refactored this and that's > the biggest part of this change. The fix consists in marking `Cast` > nodes when their type is widen in a way that prevents them from being > optimized out. > > Tobias ran performance testing with a slightly different version of > this change and there was no regression. Roland Westrelin has updated the pull request incrementally with three additional commits since the last revision: - review - infinite loop in gvn fix - renaming ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24575/files - new: https://git.openjdk.org/jdk/pull/24575/files/c509ef56..aff5894b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24575&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24575&range=01-02 Stats: 61 lines in 10 files changed: 11 ins; 0 del; 50 mod Patch: https://git.openjdk.org/jdk/pull/24575.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24575/head:pull/24575 PR: https://git.openjdk.org/jdk/pull/24575 From roland at openjdk.org Thu Oct 2 09:08:08 2025 From: roland at openjdk.org (Roland Westrelin) Date: Thu, 2 Oct 2025 09:08:08 GMT Subject: RFR: 8354282: C2: more crashes in compiled code because of dependency on removed range check CastIIs [v3] In-Reply-To: <7Y1VflHDgnEChBAv9bwWH5ayU-K9ngRa3BfPjgzzHP0=.61111d18-a22e-4cb5-9492-e50f5524ac08@github.com> References: <7Y1VflHDgnEChBAv9bwWH5ayU-K9ngRa3BfPjgzzHP0=.61111d18-a22e-4cb5-9492-e50f5524ac08@github.com> Message-ID: On Wed, 23 Apr 2025 10:56:51 GMT, Emanuel Peter wrote: >> Roland Westrelin has updated the pull request incrementally with three additional commits since the last revision: >> >> - review >> - infinite loop in gvn fix >> - renaming > > @rwestrel thanks for looking into this one! > > I have not yet deeply studied the PR, but am feeling some confusion about the naming. > > I think the `DependencyType` is really a good step into the right direction, it helps clean things up. > > I'm wondering if we should pick either `depends_only_on_test` or `pinned`, and use it everywhere consistently. Having both around as near synonymes (antonymes?) is a bit confusing for me. > > I'll look into the code more later. I pushed an update with the renaming suggested by @eme64 and an extra comment with example use cases ------------- PR Comment: https://git.openjdk.org/jdk/pull/24575#issuecomment-3360011105 From fandreuzzi at openjdk.org Thu Oct 2 09:31:05 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Thu, 2 Oct 2025 09:31:05 GMT Subject: RFR: 8368989: Use NMethodMarkingScope and ThreadsClaimTokenScope in shenandoahSTWMark [v2] In-Reply-To: References: Message-ID: > Replace `StrongRootsScope` with `ThreadsClaimTokenScope` in `shenandoahSTWMark` to be more precise with what is needed and why. > > - `ShenandoahSTWMark` uses `MarkingNMethodClosure`, so we also need `NMethodMarkingScope`. > - `nworkers` is guaranteed to be > 0 > > Passes `tier1` and `tier2` (fastdebug). Francesco Andreuzzi has updated the pull request incrementally with one additional commit since the last revision: trigger ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27589/files - new: https://git.openjdk.org/jdk/pull/27589/files/442bc5be..0801a496 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27589&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27589&range=00-01 Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27589.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27589/head:pull/27589 PR: https://git.openjdk.org/jdk/pull/27589 From fandreuzzi at openjdk.org Thu Oct 2 09:31:06 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Thu, 2 Oct 2025 09:31:06 GMT Subject: RFR: 8368989: Use NMethodMarkingScope and ThreadsClaimTokenScope in shenandoahSTWMark In-Reply-To: References: Message-ID: On Wed, 1 Oct 2025 08:57:07 GMT, Francesco Andreuzzi wrote: > Replace `StrongRootsScope` with `ThreadsClaimTokenScope` in `shenandoahSTWMark` to be more precise with what is needed and why. > > - `ShenandoahSTWMark` uses `MarkingNMethodClosure`, so we also need `NMethodMarkingScope`. > - `nworkers` is guaranteed to be > 0 > > Passes `tier1` and `tier2` (fastdebug). I noticed one of the macOS job was canceled, I noticed the same issue in another repository yesterday. I assume the reason is a scheduling timeout. Restarted GHA run. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27589#issuecomment-3360118706 From duke at openjdk.org Thu Oct 2 12:31:46 2025 From: duke at openjdk.org (duke) Date: Thu, 2 Oct 2025 12:31:46 GMT Subject: RFR: 8368989: Use NMethodMarkingScope and ThreadsClaimTokenScope in shenandoahSTWMark [v2] In-Reply-To: References: Message-ID: On Thu, 2 Oct 2025 09:31:05 GMT, Francesco Andreuzzi wrote: >> Replace `StrongRootsScope` with `ThreadsClaimTokenScope` in `shenandoahSTWMark` to be more precise with what is needed and why. >> >> - `ShenandoahSTWMark` uses `MarkingNMethodClosure`, so we also need `NMethodMarkingScope`. >> - `nworkers` is guaranteed to be > 0 >> >> Passes `tier1` and `tier2` (fastdebug). > > Francesco Andreuzzi has updated the pull request incrementally with one additional commit since the last revision: > > trigger @fandreuz Your change (at version 0801a4965d20cf84b2e4be04c4ab4a98a5e7234c) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27589#issuecomment-3360986058 From wkemper at openjdk.org Thu Oct 2 14:27:24 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 2 Oct 2025 14:27:24 GMT Subject: RFR: Merge openjdk/jdk21u:master Message-ID: Merges tag jdk-21.0.9+9 ------------- Commit messages: - 8368308: ISO 4217 Amendment 180 Update - 8365389: Remove static color fields from SwingUtilities3 and WindowsMenuItemUI The merge commit only contains trivial merges, so no merge-specific webrevs have been generated. Changes: https://git.openjdk.org/shenandoah-jdk21u/pull/224/files Stats: 90 lines in 9 files changed: 14 ins; 50 del; 26 mod Patch: https://git.openjdk.org/shenandoah-jdk21u/pull/224.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk21u.git pull/224/head:pull/224 PR: https://git.openjdk.org/shenandoah-jdk21u/pull/224 From wkemper at openjdk.org Thu Oct 2 18:11:10 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 2 Oct 2025 18:11:10 GMT Subject: RFR: Merge openjdk/jdk21u:master [v2] In-Reply-To: References: Message-ID: > Merges tag jdk-21.0.9+9 William Kemper 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. ------------- Changes: - all: https://git.openjdk.org/shenandoah-jdk21u/pull/224/files - new: https://git.openjdk.org/shenandoah-jdk21u/pull/224/files/8c322f59..8c322f59 Webrevs: - full: https://webrevs.openjdk.org/?repo=shenandoah-jdk21u&pr=224&range=01 - incr: https://webrevs.openjdk.org/?repo=shenandoah-jdk21u&pr=224&range=00-01 Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/shenandoah-jdk21u/pull/224.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk21u.git pull/224/head:pull/224 PR: https://git.openjdk.org/shenandoah-jdk21u/pull/224 From wkemper at openjdk.org Thu Oct 2 18:13:56 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 2 Oct 2025 18:13:56 GMT Subject: Integrated: Merge openjdk/jdk21u:master In-Reply-To: References: Message-ID: On Thu, 2 Oct 2025 14:22:20 GMT, William Kemper wrote: > Merges tag jdk-21.0.9+9 This pull request has now been integrated. Changeset: 3d6a0cca Author: William Kemper URL: https://git.openjdk.org/shenandoah-jdk21u/commit/3d6a0cca11e803a95e9376eed9af55a032feb719 Stats: 90 lines in 9 files changed: 14 ins; 50 del; 26 mod Merge ------------- PR: https://git.openjdk.org/shenandoah-jdk21u/pull/224 From fandreuzzi at openjdk.org Thu Oct 2 18:52:30 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Thu, 2 Oct 2025 18:52:30 GMT Subject: Integrated: 8368989: Use NMethodMarkingScope and ThreadsClaimTokenScope in shenandoahSTWMark In-Reply-To: References: Message-ID: On Wed, 1 Oct 2025 08:57:07 GMT, Francesco Andreuzzi wrote: > Replace `StrongRootsScope` with `ThreadsClaimTokenScope` in `shenandoahSTWMark` to be more precise with what is needed and why. > > - `ShenandoahSTWMark` uses `MarkingNMethodClosure`, so we also need `NMethodMarkingScope`. > - `nworkers` is guaranteed to be > 0 > > Passes `tier1` and `tier2` (fastdebug). This pull request has now been integrated. Changeset: 1d55adee Author: Francesco Andreuzzi Committer: Paul Hohensee URL: https://git.openjdk.org/jdk/commit/1d55adee11fc2fdbf2e009e1308b763fd7217dad Stats: 9 lines in 1 file changed: 5 ins; 2 del; 2 mod 8368989: Use NMethodMarkingScope and ThreadsClaimTokenScope in shenandoahSTWMark Reviewed-by: shade, ayang ------------- PR: https://git.openjdk.org/jdk/pull/27589 From kdnilsen at openjdk.org Thu Oct 2 23:05:29 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Thu, 2 Oct 2025 23:05:29 GMT Subject: RFR: 8353115: GenShen: mixed evacuation candidate regions need accurate live_data [v10] In-Reply-To: References: Message-ID: <5T0PXD1oxDN6BXnflm0DFQdBFEfUC95ds21spzVzwMw=.3a538ff0-53da-4397-887d-73ffa98bb9ef@github.com> > The existing implementation of get_live_data_bytes() and git_live_data_words() does not always behave as might be expected. In particular, the value returned ignores any allocations that occur subsequent to the most recent mark effort that identified live data within the region. This is typically ok for young regions, where the amount of live data determines whether a region should be added to the collection set during the final-mark safepoint. > > However, old-gen regions that are placed into the set of candidates for mixed evacuation are more complicated. In particular, by the time the old-gen region is added to a mixed evacuation, its live data may be much larger than at the time concurrent old marking ended. > > This PR provides comments to clarify the shortcomings of the existing functions, and adds new functions that provide more accurate accountings of live data for mixed-evacuation candidate regions. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: reviewer feedback to reduce code duplication ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24319/files - new: https://git.openjdk.org/jdk/pull/24319/files/cc6f1153..f838b5e1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24319&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24319&range=08-09 Stats: 36 lines in 3 files changed: 9 ins; 18 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/24319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24319/head:pull/24319 PR: https://git.openjdk.org/jdk/pull/24319 From kdnilsen at openjdk.org Thu Oct 2 23:09:50 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Thu, 2 Oct 2025 23:09:50 GMT Subject: RFR: 8353115: GenShen: mixed evacuation candidate regions need accurate live_data [v9] In-Reply-To: References: <8GvpkoZ5-Pso8XG-AKeR0QnlBQr0op9E-lvQMS12lTI=.6c88343d-4c74-4f29-a528-f499f559a2bd@github.com> Message-ID: On Tue, 16 Sep 2025 23:15:11 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix compilation errors after merge > > src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp line 91: > >> 89: } >> 90: >> 91: // Between consecutive mixed-evacuation cycles, the live data within each candidate region may change due to > > I think we could reduce some duplication and call `recalibrate_old_collection_candidates_live_memory` here if the function didn't have the side effect of updating `_live_bytes_in_unprocessed_candidates`. Perhaps the function could return `total_live_data` and be `const`? Good suggestion. I've refactored a little. I think it can't be const because we sort the _region_data. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24319#discussion_r2400354971 From wkemper at openjdk.org Thu Oct 2 23:16:50 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 2 Oct 2025 23:16:50 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v12] In-Reply-To: References: Message-ID: On Tue, 30 Sep 2025 21:55:46 GMT, Kelvin Nilsen wrote: >> This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. >> Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. >> >> This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. >> >> The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. > > Kelvin Nilsen has updated the pull request incrementally with five additional commits since the last revision: > > - small refactoring > - OO refinements to used_regions_size() > - fix broken assert from previous commit > - OO refinements to free_unaffiliated_regions() > - OO refinements to max_capacity() A few comment from our review session. Will post more later. src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp line 953: > 951: } > 952: > 953: size_t ShenandoahGeneration::max_capacity() const { We never instantiate `ShenandoahGeneration` even non-generational mode gets `ShenandoahGlobalGeneration`. You could make these methods pure virtual. The implementation here should never be called. src/hotspot/share/gc/shenandoah/shenandoahGlobalGeneration.cpp line 40: > 38: > 39: size_t ShenandoahGlobalGeneration::max_capacity() const { > 40: #ifdef ASSERT Could we just have this assertion one time in the constructor? ------------- Changes requested by wkemper (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26867#pullrequestreview-3217907983 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2400363917 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2400358514 From wkemper at openjdk.org Thu Oct 2 23:16:55 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 2 Oct 2025 23:16:55 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v3] In-Reply-To: References: Message-ID: On Tue, 9 Sep 2025 22:07:11 GMT, Kelvin Nilsen wrote: >> This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. >> Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. >> >> This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. >> >> The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. > > Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: > > another tweak to make GHA gtest happy src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 55: > 53: class ShenandoahLeftRightIterator { > 54: private: > 55: index_type _idx; Changing this to a different type introduces a lot of noise in the review. It was compiling before this change, can we figure out if it is really necessary to change this type? src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp line 134: > 132: virtual size_t used_regions_size() const; > 133: virtual size_t free_unaffiliated_regions() const; > 134: size_t used() const override { This is already virtual (since it is marked as `override`) so it makes sense to put these different behaviors in the different generation subclasses. src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp line 154: > 152: size_t available() const override; > 153: size_t available_with_reserve() const; > 154: size_t used_including_humongous_waste() const { Can we get rid of this method? Just have callers call `used` now? src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp line 253: > 251: if (available_in_region < plab_min_size_in_bytes) { > 252: // The available memory in young had been retired. Retire it in old also. > 253: region_to_be_used_in_old += available_in_region; This looks like a dead store. src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.hpp line 104: > 102: > 103: // Use this only for unit testing. Do not use for production. > 104: inline void set_capacity(size_t bytes) { We should be able to inline this code in `test_shenandoahOldHeuristic.cpp` in the constructor of the test fixture that calls this method. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2344980222 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2344937348 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2344940289 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2345035769 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2345072351 From wkemper at openjdk.org Fri Oct 3 00:03:58 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 3 Oct 2025 00:03:58 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v12] In-Reply-To: References: Message-ID: On Tue, 30 Sep 2025 21:55:46 GMT, Kelvin Nilsen wrote: >> This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. >> Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. >> >> This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. >> >> The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. > > Kelvin Nilsen has updated the pull request incrementally with five additional commits since the last revision: > > - small refactoring > - OO refinements to used_regions_size() > - fix broken assert from previous commit > - OO refinements to free_unaffiliated_regions() > - OO refinements to max_capacity() Mostly nits and questions. src/hotspot/share/gc/shared/gc_globals.hpp line 472: > 470: product(size_t, SoftMaxHeapSize, 0, MANAGEABLE, \ > 471: "Soft limit for maximum heap size (in bytes)") \ > 472: constraint(SoftMaxHeapSizeConstraintFunc,AfterMemoryInit) \ Changing a common file might raise eyebrows. Why do we need this? src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp line 1153: > 1151: void ShenandoahConcurrentGC::op_final_update_refs() { > 1152: ShenandoahHeap* const heap = ShenandoahHeap::heap(); > 1153: bool is_generational = heap->mode()->is_generational(); Are the changes here necessary? This is a big PR, it would be helpful to minimize unnecessary changes. src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp line 1145: > 1143: _preserved_marks->reclaim(); > 1144: > 1145: // We defer generation resizing actions until after cset regions have been recycled. We do this even following an Stale comment? src/hotspot/share/gc/shenandoah/shenandoahGenerationSizer.hpp line 1: > 1: /* Is there any point in keeping this file now? Not sure what this class is doing now. src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 745: > 743: // 2. Region's free is less than minimum TLAB size and is retired > 744: // 3. The unused portion of memory in the last region of a humongous object > 745: void ShenandoahHeap::increase_used(const ShenandoahAllocRequest& req) { I don't see the point of this method now. Can we delete it? src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 2719: > 2717: assert(used() <= ShenandoahHeap::heap()->max_capacity(), "sanity"); > 2718: assert(committed() <= ShenandoahHeap::heap()->max_capacity(), "sanity"); > 2719: assert(max_capacity() <= ShenandoahHeap::heap()->max_capacity(), "sanity"); This last one is just comparing the results of the same method call. Are we worried about races here? src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp line 65: > 63: // to make sense under the race. See JDK-8207200. > 64: committed = MAX2(used, committed); > 65: assert(used <= committed, "used: %zu, committed: %zu", used, committed); Shouldn't it always be the case that `initial <= used <= committed <= max`? src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.cpp line 42: > 40: } > 41: > 42: size_t ShenandoahSimpleBitMap::count_leading_ones(index_type start_idx) const { Did we figure out why we want to rename this type? It adds a lot of noise to this PR and I'd hate to do something like this because of a C++ technicality. src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp line 498: > 496: > 497: class ShenandoahVerifyHeapRegionClosure : public ShenandoahHeapRegionClosure { > 498: private: Formatting the access modifiers like this looks idiosyncratic: % grep -ri -P '^ private:' src/hotspot | wc -l 115 % grep -ri -P '^private:' src/hotspot | wc -l 1444 ------------- Changes requested by wkemper (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26867#pullrequestreview-3296845640 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2400422999 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2400380773 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2400382789 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2400397766 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2400401051 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2400404948 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2400410359 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2400411950 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2400418474 From wkemper at openjdk.org Fri Oct 3 00:04:00 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 3 Oct 2025 00:04:00 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v3] In-Reply-To: References: Message-ID: On Fri, 12 Sep 2025 17:48:23 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: >> >> another tweak to make GHA gtest happy > > src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp line 253: > >> 251: if (available_in_region < plab_min_size_in_bytes) { >> 252: // The available memory in young had been retired. Retire it in old also. >> 253: region_to_be_used_in_old += available_in_region; > > This looks like a dead store. This chunk of code from 253-258 looks like it could be removed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2400392332 From kdnilsen at openjdk.org Fri Oct 3 00:21:11 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 3 Oct 2025 00:21:11 GMT Subject: RFR: 8358735: GenShen: bug in #undef'd code in block_start() [v2] In-Reply-To: References: Message-ID: <7zV-fLvjb-4gBVTppg4XTXPNxEheqLfxB0v_WONuinI=.22775b58-42cf-499e-9007-fad07118217d@github.com> > When scanning a range of dirty cards within the GenShen remembered set, we need to find the object that spans the beginning of the left-most dirty card. The existing code is not reliable following class unloading. > > The new code uses the marking context when it is available to determine the location of live objects that reside below TAMS within each region. Above TAMS, all objects are presumed live and parsable. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: fix idiosyncratic formatting ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27353/files - new: https://git.openjdk.org/jdk/pull/27353/files/76979421..668e8615 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27353&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27353&range=00-01 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27353.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27353/head:pull/27353 PR: https://git.openjdk.org/jdk/pull/27353 From kdnilsen at openjdk.org Fri Oct 3 00:25:45 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 3 Oct 2025 00:25:45 GMT Subject: RFR: 8368681: Shenandoah: Add documentation comments for ShenandoahAllocationRate [v2] In-Reply-To: References: Message-ID: <7OWJnIPeKppSXqKzNJvrqD0vKHOZZzKpLNe--W9CS5Q=.f367368e-e209-4c48-831d-65c080426d1c@github.com> On Thu, 25 Sep 2025 23:45:38 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix several typos > > src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.hpp line 52: > >> 50: // The sampled allocation rate is computed from (allocated - _last_sample_value) / (current_time - _last_sample_time). >> 51: // Return the newly computed rate if the sample is taken, zero if it is not an appropriate time to add a sample. >> 52: // In the case that a new sample is not take, overwrite unaccounted_bytes_allocated with bytes allocated since > > s/take/taken Fixed. Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27505#discussion_r2400443230 From xpeng at openjdk.org Fri Oct 3 00:33:46 2025 From: xpeng at openjdk.org (Xiaolong Peng) Date: Fri, 3 Oct 2025 00:33:46 GMT Subject: RFR: 8368681: Shenandoah: Add documentation comments for ShenandoahAllocationRate [v2] In-Reply-To: References: Message-ID: On Sat, 27 Sep 2025 23:13:34 GMT, Kelvin Nilsen wrote: >> Add documentation to ShenandoahAllocationRate > > Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: > > Fix several typos Looks good to me, thanks! ------------- Marked as reviewed by xpeng (Committer). PR Review: https://git.openjdk.org/jdk/pull/27505#pullrequestreview-3296939226 From wkemper at openjdk.org Fri Oct 3 00:37:55 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 3 Oct 2025 00:37:55 GMT Subject: RFR: 8353115: GenShen: mixed evacuation candidate regions need accurate live_data [v10] In-Reply-To: <5T0PXD1oxDN6BXnflm0DFQdBFEfUC95ds21spzVzwMw=.3a538ff0-53da-4397-887d-73ffa98bb9ef@github.com> References: <5T0PXD1oxDN6BXnflm0DFQdBFEfUC95ds21spzVzwMw=.3a538ff0-53da-4397-887d-73ffa98bb9ef@github.com> Message-ID: On Thu, 2 Oct 2025 23:05:29 GMT, Kelvin Nilsen wrote: >> The existing implementation of get_live_data_bytes() and git_live_data_words() does not always behave as might be expected. In particular, the value returned ignores any allocations that occur subsequent to the most recent mark effort that identified live data within the region. This is typically ok for young regions, where the amount of live data determines whether a region should be added to the collection set during the final-mark safepoint. >> >> However, old-gen regions that are placed into the set of candidates for mixed evacuation are more complicated. In particular, by the time the old-gen region is added to a mixed evacuation, its live data may be much larger than at the time concurrent old marking ended. >> >> This PR provides comments to clarify the shortcomings of the existing functions, and adds new functions that provide more accurate accountings of live data for mixed-evacuation candidate regions. > > Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: > > reviewer feedback to reduce code duplication I think we can delete the field `_mixed_candidate_garbage_words` now with the refactoring. Would also be good to run this through testing again. src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp line 262: > 260: volatile size_t _critical_pins; > 261: > 262: size_t _mixed_candidate_garbage_words; Can we delete this field now? ------------- Changes requested by wkemper (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24319#pullrequestreview-3296942280 PR Review Comment: https://git.openjdk.org/jdk/pull/24319#discussion_r2400454938 From kdnilsen at openjdk.org Fri Oct 3 18:41:52 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 3 Oct 2025 18:41:52 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v3] In-Reply-To: References: Message-ID: <17APPI-yLZ70C8-EIxK8Olf3iu8mtA5FLB-338EYtV8=.996629b7-0001-4195-8f7f-01dfe4130d91@github.com> On Fri, 12 Sep 2025 17:04:19 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: >> >> another tweak to make GHA gtest happy > > src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp line 134: > >> 132: virtual size_t used_regions_size() const; >> 133: virtual size_t free_unaffiliated_regions() const; >> 134: size_t used() const override { > > This is already virtual (since it is marked as `override`) so it makes sense to put these different behaviors in the different generation subclasses. Thanks. This is done now. > src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp line 154: > >> 152: size_t available() const override; >> 153: size_t available_with_reserve() const; >> 154: size_t used_including_humongous_waste() const { > > Can we get rid of this method? Just have callers call `used` now? Correct. It has been removed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2402976401 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2402978481 From sherman at openjdk.org Fri Oct 3 19:10:20 2025 From: sherman at openjdk.org (Xueming Shen) Date: Fri, 3 Oct 2025 19:10:20 GMT Subject: RFR: 8365675: Add String Unicode Case-Folding Support Message-ID: ### Summary Case folding is a key operation for case-insensitive matching (e.g., string equality, regex matching), where the goal is to eliminate case distinctions without applying locale or language specific conversions. Currently, the JDK does not expose a direct API for Unicode-compliant case folding. Developers now rely on methods such as: **String.equalsIgnoreCase(String)** - Unicode-aware, locale-independent. - Implementation uses Character.toLowerCase(Character.toUpperCase(int)) per code point. - Limited: does not support 1:M mapping defined in Unicode case folding. **Character.toLowerCase(int) / Character.toUpperCase(int)** - Locale-independent, single code point only. - No support for 1:M mappings. **String.toLowerCase(Locale.ROOT) / String.toUpperCase(Locale.ROOT)** - Based on Unicode SpecialCasing.txt, supports 1:M mappings. - Intended primarily for presentation/display, not structural case-insensitive matching. - Requires full string conversion before comparison, which is less efficient and not intended for structural matching. **1:M mapping example, U+00DF (?)** - String.toUpperCase(Locale.ROOT, "?") ? "SS" - Case folding produces "ss", matching Unicode caseless comparison rules. jshell> "\u00df".equalsIgnoreCase("ss") $22 ==> false jshell> "\u00df".toUpperCase(Locale.ROOT).toLowerCase(Locale.ROOT).equals("ss") $24 ==> true ### Motivation & Direction Add Unicode standard-compliant case-less comparison methods to the String class, enabling & improving reliable and efficient Unicode-aware/compliant case-insensitive matching. - Unicode-compliant **full** case folding. - Simpler, stable and more efficient case-less matching without workarounds. - Brings Java's string comparison handling in line with other programming languages/libraries. This PR proposes to introduce the following comparison methods in `String` class - boolean equalsFoldCase(String anotherString) - int compareToFoldCase(String anotherString) - Comparator UNICODE_CASEFOLD_ORDER These methods are intended to be the preferred choice when Unicode-compliant case-less matching is required. *Note: An early draft also proposed a String.toCaseFold() method returning a new case-folded string. However, during review this was considered error-prone, as the resulting string could easily be mistaken for a general transformation like toLowerCase() and then passed into APIs where case-folding semantics are not appropriate. ### The New API /** * Compares this {@code String} to another {@code String} for equality, * using Unicode case folding. Two strings are considered equal * by this method if their case-folded forms are identical. *

* Case folding is defined by the Unicode Standard in * CaseFolding.txt, * including 1:M mappings. For example, {@code "Ma?e".equalsFoldCase("MASSE")} * returns {@code true}, since the character {@code U+00DF} (sharp s) folds * to {@code "ss"}. *

* Case folding is locale-independent and language-neutral, unlike * locale-sensitive transformations such as {@link #toLowerCase()} or * {@link #toUpperCase()}. It is intended for caseless matching, * searching, and indexing. * * @apiNote * This method is the Unicode-compliant alternative to * {@link #equalsIgnoreCase(String)}. It implements full case folding as * defined by the Unicode Standard, which may differ from the simpler * per-character mapping performed by {@code equalsIgnoreCase}. * For example: *

{@snippet lang=java :
     * String a = "Ma?e";
     * String b = "MASSE";
     * boolean equalsFoldCase = a.equalsFoldCase(b);       // returns true
     * boolean equalsIgnoreCase = a.equalsIgnoreCase(b);   // returns false
     * }
* * @param anotherString * The {@code String} to compare this {@code String} against * * @return {@code true} if the given object is not {@code null} and represents * the same sequence of characters as this string under Unicode case * folding; {@code false} otherwise. * * @see #compareToFoldCase(String) * @see #equalsIgnoreCase(String) * @since 26 */ public boolean equalsFoldCase(String anotherString) /** * Compares two strings lexicographically using Unicode case folding. * This method returns an integer whose sign is that of calling {@code compareTo} * on the Unicode case folded version of the strings. Unicode Case folding * eliminates differences in case according to the Unicode Standard, using the * mappings defined in * CaseFolding.txt, * including 1:M mappings, such as {@code"?"} ? {@code }"ss"}. *

* Case folding is a locale-independent, language-neutral form of case mapping, * primarily intended for caseless matching. Unlike {@link #compareToIgnoreCase(String)}, * which applies a simpler locale-insensitive uppercase mapping. This method * follows the Unicode full case folding, providing stable and * consistent results across all environments. *

* Note that this method does not take locale into account, and may * produce results that differ from locale-sensitive ordering. Use * {@link java.text.Collator} for locale-sensitive comparison. * * @apiNote * This method is the Unicode-compliant alternative to * {@link #compareToIgnoreCase(String)}. It implements the full case folding * as defined by the Unicode Standard, which may differ from the simpler * per-character mapping performed by {@code compareToIgnoreCase}. * For example: *

{@snippet lang=java :
     * String a = "Ma?e";
     * String b = "MASSE";
     * int cmpFoldCase = a.compareToFoldCase(b);     // returns 0
     * int cmpIgnoreCase = a.compareToIgnoreCase(b); // returns > 0
     * }
* * @param str the {@code String} to be compared. * @return a negative integer, zero, or a positive integer as the specified * String is greater than, equal to, or less than this String, * ignoring case considerations by case folding. * @see #equalsFoldCase(String) * @see #compareToIgnoreCase(String) * @see java.text.Collator * @since 26 */ public int compareToFoldCase(String str) /** * A Comparator that orders {@code String} objects as by * {@link #compareToFoldCase(String) compareToFoldCase()}. * * @see #compareToFoldCase(String) * @since 26 */ public static final Comparator UNICODE_CASEFOLD_ORDER; ### Usage Examples Sharp s (U+00DF) case-folds to "ss" "stra?e".equalsIgnoreCase("strasse"); // false "stra?e".compareToIgnoreCase("strasse"); // != 0 "stra?e".equalsFoldCase("strasse"); // true ### Performance The JMH microbenchmark StringCompareToIgnoreCase has been updated to compare performance of compareToFoldCase with the existing compareToIgnoreCase(). Benchmark Mode Cnt Score Error Units StringCompareToIgnoreCase.asciiGreekLower avgt 15 20.195 ? 0.300 ns/op StringCompareToIgnoreCase.asciiGreekLowerCF avgt 15 11.051 ? 0.254 ns/op StringCompareToIgnoreCase.asciiGreekUpperLower avgt 15 6.035 ? 0.047 ns/op StringCompareToIgnoreCase.asciiGreekUpperLowerCF avgt 15 14.786 ? 0.382 ns/op StringCompareToIgnoreCase.asciiLower avgt 15 17.688 ? 1.396 ns/op StringCompareToIgnoreCase.asciiLowerCF avgt 15 44.552 ? 0.155 ns/op StringCompareToIgnoreCase.asciiUpperLower avgt 15 13.069 ? 0.487 ns/op StringCompareToIgnoreCase.asciiUpperLowerCF avgt 15 58.684 ? 0.274 ns/op StringCompareToIgnoreCase.greekLower avgt 15 20.642 ? 0.082 ns/op StringCompareToIgnoreCase.greekLowerCF avgt 15 7.255 ? 0.271 ns/op StringCompareToIgnoreCase.greekUpperLower avgt 15 5.737 ? 0.013 ns/op StringCompareToIgnoreCase.greekUpperLowerCF avgt 15 11.100 ? 1.147 ns/op StringCompareToIgnoreCase.lower avgt 15 20.192 ? 0.044 ns/op StringCompareToIgnoreCase.lowerrCF avgt 15 11.257 ? 0.259 ns/op StringCompareToIgnoreCase.supLower avgt 15 54.801 ? 0.415 ns/op StringCompareToIgnoreCase.supLowerCF avgt 15 15.207 ? 0.418 ns/op StringCompareToIgnoreCase.supUpperLower avgt 15 14.431 ? 0.188 ns/op StringCompareToIgnoreCase.supUpperLowerCF avgt 15 19.149 ? 0.985 ns/op StringCompareToIgnoreCase.upperLower avgt 15 5.650 ? 0.051 ns/op StringCompareToIgnoreCase.upperLowerCF avgt 15 14.338 ? 0.352 ns/op StringCompareToIgnoreCase.utf16SubLower avgt 15 14.774 ? 0.200 ns/op StringCompareToIgnoreCase.utf16SubLowerCF avgt 15 2.669 ? 0.041 ns/op StringCompareToIgnoreCase.utf16SupUpperLower avgt 15 16.250 ? 0.099 ns/op StringCompareToIgnoreCase.utf16SupUpperLowerCF avgt 15 11.524 ? 0.327 ns/op ### Refs [Unicode Standard 5.18.4 Caseless Matching](https://www.unicode.org/versions/latest/core-spec/chapter-5/#G21790) [Unicode? Standard Annex #44: 5.6 Case and Case Mapping](https://www.unicode.org/reports/tr44/#Casemapping) [Unicode Technical Standard #18: Unicode Regular Expressions RL1.5: Simple Loose Matches](https://www.unicode.org/reports/tr18/#Simple_Loose_Matches) [Unicode SpecialCasing.txt](https://www.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt) [Unicode CaseFolding.txt](https://www.unicode.org/Public/UCD/latest/ucd/CaseFolding.txt) ### Other Languages **Python string.casefold()** The str.casefold() method in Python returns a casefolded version of a string. Casefolding is a more aggressive form of lowercasing, designed to remove all case distinctions in a string, particularly for the purpose of caseless string comparisons. **Perl?s fc()** Returns the casefolded version of EXPR. This is the internal function implementing the \F escape in double-quoted strings. Casefolding is the process of mapping strings to a form where case differences are erased; comparing two strings in their casefolded form is effectively a way of asking if two strings are equal, regardless of case. Perl only implements the full form of casefolding, but you can access the simple folds using "casefold()" in Unicode::UCD] ad "prop_invmap()" in Unicode::UCD]. **ICU4J UCharacter.foldCase (Java)** Purpose: Provides extensions to the standard Java Character class, including support for more Unicode properties and handling of supplementary characters (code points beyond U+FFFF). Method Signature (String based): public static String foldCase(String str, int options) Method Signature (CharSequence & Appendable based): public static A foldCase(CharSequence src, A dest, int options, Edits edits) Key Features: Case Folding: Converts a string to its case-folded equivalent. Locale Independent: Case folding in UCharacter.foldCase is generally not dependent on locale settings. Context Insensitive: The mapping of a character is not affected by surrounding characters. Turkic Option: An option exists to include or exclude special mappings for Turkish/Azerbaijani text. Result Length: The resulting string can be longer or shorter than the original. Edits Recording: Allows for recording of edits for index mapping, styled text, and getting only changes. **u_strFoldCase (C/C++)** A lower-level C API function for case folding a string. Case Folding Options: Similar options as UCharacter.foldCase for controlling case folding behavior. Availability: Found in the ustring.h and unistr.h headers in the ICU4C library. ------------- Commit messages: - 8365675: Add String Unicode Case-Folding Support Changes: https://git.openjdk.org/jdk/pull/26892/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26892&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8365675 Stats: 1279 lines in 12 files changed: 1116 ins; 137 del; 26 mod Patch: https://git.openjdk.org/jdk/pull/26892.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26892/head:pull/26892 PR: https://git.openjdk.org/jdk/pull/26892 From kdnilsen at openjdk.org Fri Oct 3 19:49:41 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 3 Oct 2025 19:49:41 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v13] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: revert introduction of index_type ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/43e1358f..f4dadd43 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=12 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=11-12 Stats: 244 lines in 7 files changed: 10 ins; 2 del; 232 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From kdnilsen at openjdk.org Fri Oct 3 19:49:44 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 3 Oct 2025 19:49:44 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v3] In-Reply-To: References: Message-ID: On Fri, 12 Sep 2025 17:19:53 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: >> >> another tweak to make GHA gtest happy > > src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 55: > >> 53: class ShenandoahLeftRightIterator { >> 54: private: >> 55: index_type _idx; > > Changing this to a different type introduces a lot of noise in the review. It was compiling before this change, can we figure out if it is really necessary to change this type? Thanks for insisting on highest standards. I think I've figured out how to resolve the conflicts with multiple definitions of idx_t and committed a change. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2403182952 From kdnilsen at openjdk.org Fri Oct 3 20:09:30 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 3 Oct 2025 20:09:30 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v14] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: simplify implementation of promote_in_place ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/f4dadd43..f6a1182e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=13 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=12-13 Stats: 20 lines in 1 file changed: 3 ins; 14 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From kdnilsen at openjdk.org Fri Oct 3 20:31:12 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 3 Oct 2025 20:31:12 GMT Subject: RFR: 8353115: GenShen: mixed evacuation candidate regions need accurate live_data [v10] In-Reply-To: References: <5T0PXD1oxDN6BXnflm0DFQdBFEfUC95ds21spzVzwMw=.3a538ff0-53da-4397-887d-73ffa98bb9ef@github.com> Message-ID: On Fri, 3 Oct 2025 00:34:02 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: >> >> reviewer feedback to reduce code duplication > > src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp line 262: > >> 260: volatile size_t _critical_pins; >> 261: >> 262: size_t _mixed_candidate_garbage_words; > > Can we delete this field now? Good catch. Removed. Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24319#discussion_r2403271191 From kdnilsen at openjdk.org Fri Oct 3 20:31:10 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 3 Oct 2025 20:31:10 GMT Subject: RFR: 8353115: GenShen: mixed evacuation candidate regions need accurate live_data [v11] In-Reply-To: References: Message-ID: > The existing implementation of get_live_data_bytes() and git_live_data_words() does not always behave as might be expected. In particular, the value returned ignores any allocations that occur subsequent to the most recent mark effort that identified live data within the region. This is typically ok for young regions, where the amount of live data determines whether a region should be added to the collection set during the final-mark safepoint. > > However, old-gen regions that are placed into the set of candidates for mixed evacuation are more complicated. In particular, by the time the old-gen region is added to a mixed evacuation, its live data may be much larger than at the time concurrent old marking ended. > > This PR provides comments to clarify the shortcomings of the existing functions, and adds new functions that provide more accurate accountings of live data for mixed-evacuation candidate regions. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: remove _mixed_candidate_garbage_words from ShenandoahHeapRegion ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24319/files - new: https://git.openjdk.org/jdk/pull/24319/files/f838b5e1..4e920417 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24319&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24319&range=09-10 Stats: 3 lines in 2 files changed: 0 ins; 3 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/24319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24319/head:pull/24319 PR: https://git.openjdk.org/jdk/pull/24319 From kdnilsen at openjdk.org Fri Oct 3 20:53:48 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 3 Oct 2025 20:53:48 GMT Subject: RFR: 8353115: GenShen: mixed evacuation candidate regions need accurate live_data [v11] In-Reply-To: References: Message-ID: On Fri, 3 Oct 2025 20:31:10 GMT, Kelvin Nilsen wrote: >> The existing implementation of get_live_data_bytes() and git_live_data_words() does not always behave as might be expected. In particular, the value returned ignores any allocations that occur subsequent to the most recent mark effort that identified live data within the region. This is typically ok for young regions, where the amount of live data determines whether a region should be added to the collection set during the final-mark safepoint. >> >> However, old-gen regions that are placed into the set of candidates for mixed evacuation are more complicated. In particular, by the time the old-gen region is added to a mixed evacuation, its live data may be much larger than at the time concurrent old marking ended. >> >> This PR provides comments to clarify the shortcomings of the existing functions, and adds new functions that provide more accurate accountings of live data for mixed-evacuation candidate regions. > > Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: > > remove _mixed_candidate_garbage_words from ShenandoahHeapRegion Retesting through internal CI pipeline ------------- PR Comment: https://git.openjdk.org/jdk/pull/24319#issuecomment-3367185418 From kdnilsen at openjdk.org Fri Oct 3 20:53:50 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 3 Oct 2025 20:53:50 GMT Subject: RFR: 8353115: GenShen: mixed evacuation candidate regions need accurate live_data [v10] In-Reply-To: References: <5T0PXD1oxDN6BXnflm0DFQdBFEfUC95ds21spzVzwMw=.3a538ff0-53da-4397-887d-73ffa98bb9ef@github.com> Message-ID: <_Bh5NmZkINYluZJrPU4CmqttX3tl5oMy49WCjoJD_sw=.abe539ff-f71b-4360-b157-e14853d26b72@github.com> On Fri, 3 Oct 2025 20:27:26 GMT, Kelvin Nilsen wrote: >> src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp line 262: >> >>> 260: volatile size_t _critical_pins; >>> 261: >>> 262: size_t _mixed_candidate_garbage_words; >> >> Can we delete this field now? > > Good catch. Removed. Thanks. Done. Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24319#discussion_r2403313761 From kdnilsen at openjdk.org Fri Oct 3 22:07:53 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 3 Oct 2025 22:07:53 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v14] In-Reply-To: References: Message-ID: On Fri, 3 Oct 2025 20:09:30 GMT, Kelvin Nilsen wrote: >> This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. >> Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. >> >> This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. >> >> The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. > > Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: > > simplify implementation of promote_in_place src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp line 136: > 134: > 135: #ifndef PRODUCT > 136: void dump_bitmap_row(idx_t region_idx) const; maybe revert this. bitmap rows are not idx_t. src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp line 71: > 69: // Usage > 70: > 71: volatile size_t _used; Get rid of this. no longer needed. (search for volatile, most should go.) do we need _max_capacity? probably not. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2403455453 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2403449921 From kdnilsen at openjdk.org Fri Oct 3 22:07:55 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 3 Oct 2025 22:07:55 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v3] In-Reply-To: References: Message-ID: On Thu, 2 Oct 2025 23:31:35 GMT, William Kemper wrote: >> src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp line 253: >> >>> 251: if (available_in_region < plab_min_size_in_bytes) { >>> 252: // The available memory in young had been retired. Retire it in old also. >>> 253: region_to_be_used_in_old += available_in_region; >> >> This looks like a dead store. > > This chunk of code from 253-258 looks like it could be removed. You're right. We can simplify this. Done. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2403216907 From wkemper at openjdk.org Fri Oct 3 23:26:05 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 3 Oct 2025 23:26:05 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting Message-ID: Notable changes: * Improvements to logging * More accurate tracking of promotion failures * Use shared allocation for promotions only when the size is above the maximum plab size (not the minimum size) * Use census information gathered during mark to size promotion reserves and old generation With these changes, GenShen is expected to have fewer promotion failures and this is indeed the case. As a result of this, we expect less time to be spent in concurrent marking and update refs for young collections. We may also expect shorter concurrent evacuation phases because GenShen will have fewer densely packed regions stuck in the young generation. With more objects being promoted, we also expect to see longer remembered set scan times. This is generally the case across all benchmarks, but we do also see some counter-intuitive results. Here we are comparing 20 executions (10 on x86, 10 on aarch64) of the changes in the PR (experiment) against 20 executions of the same benchmarks results from tip. This is a summary of statistically significant changes of more than 5% across all benchmarks: Concurrent Evacuation: 7 improvements, 3 regressions ? Best improvements: extremem-large-45g (-29.6%), neo4j-analytics (-26.9%) ? Worst regression: xalan (+53.7%) Concurrent Marking: 15 improvements, 1 regression ? Best improvements: hyperalloc_a2048_o4096 (-30.1%), crypto.rsa (-27.3%) ? Only regression: serial (+8.9%) Concurrent Scan Remembered Set: 7 improvements, 2 regressions ? Best improvements: xalan (-49.4%), pmd (-49.0%), crypto.rsa (-41.8%) ? Worst regression: extremem-phased (+52.4%) Concurrent Update Refs: 5 improvements, 4 regressions ? Best improvements: crypto.rsa (-36.4%), mnemonics (-28.4%) ? Worst regression: xalan (+89.4%) ------------- Commit messages: - Little cleanup - Fix wrong asserts - Only use old generation in generational mode - More accurate method names for cset fields, consider promotion reserves when computing excess old regions - Merge fallout - Merge remote-tracking branch 'jdk/master' into promotion-budget-improvements - Merge remote-tracking branch 'jdk/master' into promotion-budget-improvements - Tweak comment - Merge remote-tracking branch 'jdk/master' into make-evac-tracking-runtime-option - Merge remote-tracking branch 'earthling-jdk/adaptive-tenuring-threshold' into make-evac-tracking-runtime-option - ... and 42 more: https://git.openjdk.org/jdk/compare/648582ab...fd9619dd Changes: https://git.openjdk.org/jdk/pull/27632/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27632&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8314599 Stats: 292 lines in 16 files changed: 145 ins; 72 del; 75 mod Patch: https://git.openjdk.org/jdk/pull/27632.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27632/head:pull/27632 PR: https://git.openjdk.org/jdk/pull/27632 From wkemper at openjdk.org Fri Oct 3 23:35:48 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 3 Oct 2025 23:35:48 GMT Subject: RFR: 8353115: GenShen: mixed evacuation candidate regions need accurate live_data [v11] In-Reply-To: References: Message-ID: On Fri, 3 Oct 2025 20:31:10 GMT, Kelvin Nilsen wrote: >> The existing implementation of get_live_data_bytes() and git_live_data_words() does not always behave as might be expected. In particular, the value returned ignores any allocations that occur subsequent to the most recent mark effort that identified live data within the region. This is typically ok for young regions, where the amount of live data determines whether a region should be added to the collection set during the final-mark safepoint. >> >> However, old-gen regions that are placed into the set of candidates for mixed evacuation are more complicated. In particular, by the time the old-gen region is added to a mixed evacuation, its live data may be much larger than at the time concurrent old marking ended. >> >> This PR provides comments to clarify the shortcomings of the existing functions, and adds new functions that provide more accurate accountings of live data for mixed-evacuation candidate regions. > > Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: > > remove _mixed_candidate_garbage_words from ShenandoahHeapRegion Code looks good to me. Let's double check performance results (especially for non-generational mode). ------------- Marked as reviewed by wkemper (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24319#pullrequestreview-3301312685 From wkemper at openjdk.org Mon Oct 6 14:51:55 2025 From: wkemper at openjdk.org (William Kemper) Date: Mon, 6 Oct 2025 14:51:55 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v2] In-Reply-To: References: Message-ID: > Notable changes: > * Improvements to logging > * More accurate tracking of promotion failures > * Use shared allocation for promotions only when the size is above the maximum plab size (not the minimum size) > * Use census information gathered during mark to size promotion reserves and old generation > > With these changes, GenShen is expected to have fewer promotion failures and this is indeed the case. As a result of this, we expect less time to be spent in concurrent marking and update refs for young collections. We may also expect shorter concurrent evacuation phases because GenShen will have fewer densely packed regions stuck in the young generation. With more objects being promoted, we also expect to see longer remembered set scan times. This is generally the case across all benchmarks, but we do also see some counter-intuitive results. > > Here we are comparing 20 executions (10 on x86, 10 on aarch64) of the changes in the PR (experiment) against 20 executions of the same benchmarks results from tip. This is a summary of statistically significant changes of more than 5% across all benchmarks: > > > Concurrent Evacuation: 7 improvements, 3 regressions > ? Best improvements: extremem-large-45g (-29.6%), neo4j-analytics (-26.9%) > ? Worst regression: xalan (+53.7%) > > Concurrent Marking: 15 improvements, 1 regression > ? Best improvements: hyperalloc_a2048_o4096 (-30.1%), crypto.rsa (-27.3%) > ? Only regression: serial (+8.9%) > > Concurrent Scan Remembered Set: 7 improvements, 2 regressions > ? Best improvements: xalan (-49.4%), pmd (-49.0%), crypto.rsa (-41.8%) > ? Worst regression: extremem-phased (+52.4%) > > Concurrent Update Refs: 5 improvements, 4 regressions > ? Best improvements: crypto.rsa (-36.4%), mnemonics (-28.4%) > ? Worst regression: xalan (+89.4%) William Kemper has updated the pull request incrementally with one additional commit since the last revision: Fix windows build ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27632/files - new: https://git.openjdk.org/jdk/pull/27632/files/fd9619dd..8fca0b68 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27632&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27632&range=00-01 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27632.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27632/head:pull/27632 PR: https://git.openjdk.org/jdk/pull/27632 From wkemper at openjdk.org Mon Oct 6 15:36:59 2025 From: wkemper at openjdk.org (William Kemper) Date: Mon, 6 Oct 2025 15:36:59 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v3] In-Reply-To: References: Message-ID: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> > Notable changes: > * Improvements to logging > * More accurate tracking of promotion failures > * Use shared allocation for promotions only when the size is above the maximum plab size (not the minimum size) > * Use census information gathered during mark to size promotion reserves and old generation > > With these changes, GenShen is expected to have fewer promotion failures and this is indeed the case. As a result of this, we expect less time to be spent in concurrent marking and update refs for young collections. We may also expect shorter concurrent evacuation phases because GenShen will have fewer densely packed regions stuck in the young generation. With more objects being promoted, we also expect to see longer remembered set scan times. This is generally the case across all benchmarks, but we do also see some counter-intuitive results. > > Here we are comparing 20 executions (10 on x86, 10 on aarch64) of the changes in the PR (experiment) against 20 executions of the same benchmarks results from tip. This is a summary of statistically significant changes of more than 5% across all benchmarks: > > > Concurrent Evacuation: 7 improvements, 3 regressions > ? Best improvements: extremem-large-45g (-29.6%), neo4j-analytics (-26.9%) > ? Worst regression: xalan (+53.7%) > > Concurrent Marking: 15 improvements, 1 regression > ? Best improvements: hyperalloc_a2048_o4096 (-30.1%), crypto.rsa (-27.3%) > ? Only regression: serial (+8.9%) > > Concurrent Scan Remembered Set: 7 improvements, 2 regressions > ? Best improvements: xalan (-49.4%), pmd (-49.0%), crypto.rsa (-41.8%) > ? Worst regression: extremem-phased (+52.4%) > > Concurrent Update Refs: 5 improvements, 4 regressions > ? Best improvements: crypto.rsa (-36.4%), mnemonics (-28.4%) > ? Worst regression: xalan (+89.4%) William Kemper has updated the pull request incrementally with one additional commit since the last revision: Fix windows build more ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27632/files - new: https://git.openjdk.org/jdk/pull/27632/files/8fca0b68..09926eb2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27632&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27632&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27632.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27632/head:pull/27632 PR: https://git.openjdk.org/jdk/pull/27632 From wkemper at openjdk.org Mon Oct 6 18:44:25 2025 From: wkemper at openjdk.org (William Kemper) Date: Mon, 6 Oct 2025 18:44:25 GMT Subject: RFR: 8368681: Shenandoah: Add documentation comments for ShenandoahAllocationRate [v2] In-Reply-To: References: Message-ID: On Sat, 27 Sep 2025 23:13:34 GMT, Kelvin Nilsen wrote: >> Add documentation to ShenandoahAllocationRate > > Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: > > Fix several typos Marked as reviewed by wkemper (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27505#pullrequestreview-3306576679 From wkemper at openjdk.org Mon Oct 6 22:07:24 2025 From: wkemper at openjdk.org (William Kemper) Date: Mon, 6 Oct 2025 22:07:24 GMT Subject: RFR: 8367646: [GenShen] Control thread may overwrite gc cancellation cause set by mutator Message-ID: I believe the following events could lead to this assertion failure: 1. Control thread reads the heap's gc cancellation cause as `shenandoah_concurrent_gc` 2. Mutator thread has an allocation failure and sets the heap's gc cancellation cause to `shenandoah_alloc_failure` 3. Control thread uses stale value from `1` and decides to unconditionally clear the cancellation cause 4. Mutator thread assert that gc is still cancelled The proposed fix here has the control thread use a CAS operation to only clear the gc if the existing value if `shenandoah_concurrent_gc`. This will stop the control thread from erroneously changing the value if a mutator has already set it to `shenandoah_alloc_failure`. A mutator thread may still have an allocation failure after the control thread has cleared the cancellation, but this is normal and expected. ------------- Commit messages: - Fix race between mutator and control thread over gc cancellation Changes: https://git.openjdk.org/jdk/pull/27662/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27662&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8367646 Stats: 11 lines in 3 files changed: 9 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27662.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27662/head:pull/27662 PR: https://git.openjdk.org/jdk/pull/27662 From kdnilsen at openjdk.org Mon Oct 6 22:20:45 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Mon, 6 Oct 2025 22:20:45 GMT Subject: RFR: 8367646: [GenShen] Control thread may overwrite gc cancellation cause set by mutator In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 22:00:01 GMT, William Kemper wrote: > I believe the following events could lead to this assertion failure: > 1. Control thread reads the heap's gc cancellation cause as `shenandoah_concurrent_gc` > 2. Mutator thread has an allocation failure and sets the heap's gc cancellation cause to `shenandoah_alloc_failure` > 3. Control thread uses stale value from `1` and decides to unconditionally clear the cancellation cause > 4. Mutator thread assert that gc is still cancelled > > The proposed fix here has the control thread use a CAS operation to only clear the gc if the existing value if `shenandoah_concurrent_gc`. This will stop the control thread from erroneously changing the value if a mutator has already set it to `shenandoah_alloc_failure`. A mutator thread may still have an allocation failure after the control thread has cleared the cancellation, but this is normal and expected. There's a typo in description of the issue: s/if/is/ Have we been able to confirm through testing that this resolves the previously observed assertion failure? ------------- Marked as reviewed by kdnilsen (Committer). PR Review: https://git.openjdk.org/jdk/pull/27662#pullrequestreview-3307686078 From wkemper at openjdk.org Mon Oct 6 22:31:50 2025 From: wkemper at openjdk.org (William Kemper) Date: Mon, 6 Oct 2025 22:31:50 GMT Subject: RFR: 8367646: [GenShen] Control thread may overwrite gc cancellation cause set by mutator In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 22:00:01 GMT, William Kemper wrote: > I believe the following events could lead to this assertion failure: > 1. Control thread reads the heap's gc cancellation cause as `shenandoah_concurrent_gc` > 2. Mutator thread has an allocation failure and sets the heap's gc cancellation cause to `shenandoah_alloc_failure` > 3. Control thread uses stale value from `1` and decides to unconditionally clear the cancellation cause > 4. Mutator thread assert that gc is still cancelled > > The proposed fix here has the control thread use a CAS operation to only clear the gc if the existing value is `shenandoah_concurrent_gc`. This will stop the control thread from erroneously changing the value if a mutator has already set it to `shenandoah_alloc_failure`. A mutator thread may still have an allocation failure after the control thread has cleared the cancellation, but this is normal and expected. I was never able to reproduce it. The crash was observed on somewhat exotic hardware. I'm fairly confident in the fix because in all other cases the cancellation cause is only cleared on a safepoint. That is to say, this code is the only place the collector clears the cancellation cause concurrently with mutators. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27662#issuecomment-3374480022 From kdnilsen at openjdk.org Mon Oct 6 23:19:50 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Mon, 6 Oct 2025 23:19:50 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v3] In-Reply-To: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> References: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> Message-ID: On Mon, 6 Oct 2025 15:36:59 GMT, William Kemper wrote: >> Notable changes: >> * Improvements to logging >> * More accurate tracking of promotion failures >> * Use shared allocation for promotions only when the size is above the maximum plab size (not the minimum size) >> * Use census information gathered during mark to size promotion reserves and old generation >> >> With these changes, GenShen is expected to have fewer promotion failures and this is indeed the case. As a result of this, we expect less time to be spent in concurrent marking and update refs for young collections. We may also expect shorter concurrent evacuation phases because GenShen will have fewer densely packed regions stuck in the young generation. With more objects being promoted, we also expect to see longer remembered set scan times. This is generally the case across all benchmarks, but we do also see some counter-intuitive results. >> >> Here we are comparing 20 executions (10 on x86, 10 on aarch64) of the changes in the PR (experiment) against 20 executions of the same benchmarks results from tip. This is a summary of statistically significant changes of more than 5% across all benchmarks: >> >> >> Concurrent Evacuation: 7 improvements, 3 regressions >> ? Best improvements: extremem-large-45g (-29.6%), neo4j-analytics (-26.9%) >> ? Worst regression: xalan (+53.7%) >> >> Concurrent Marking: 15 improvements, 1 regression >> ? Best improvements: hyperalloc_a2048_o4096 (-30.1%), crypto.rsa (-27.3%) >> ? Only regression: serial (+8.9%) >> >> Concurrent Scan Remembered Set: 7 improvements, 2 regressions >> ? Best improvements: xalan (-49.4%), pmd (-49.0%), crypto.rsa (-41.8%) >> ? Worst regression: extremem-phased (+52.4%) >> >> Concurrent Update Refs: 5 improvements, 4 regressions >> ? Best improvements: crypto.rsa (-36.4%), mnemonics (-28.4%) >> ? Worst regression: xalan (+89.4%) > > William Kemper has updated the pull request incrementally with one additional commit since the last revision: > > Fix windows build more I'm thinking that there should be a change to heap->rebuild_freeset() that adds get_promotion_potential() to the reserve for OldCollector. We did not previously make this reserve because we were only counting data that was to be promoted in place. This may have the effect of triggering a bit sooner than in existing master. We could subtract out the pip_promo_reserve() if we want to keep track of that separately, because that doesn't need to be reserved. Once the cset is constructed, we will shrink the reserves because at that point, we'll know better how much we really plan to evacuate into old. src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.inline.hpp line 62: > 60: > 61: size_t ShenandoahCollectionSet::get_live_bytes_in_young_regions() const { > 62: return _young_bytes_to_evacuate - _young_bytes_to_promote; I'm wondering if these new names properly reflect the intention. It seems get_live_byte_in_young_regions() really means get_live_bytes_that_we_intend_to_evacuate_to_young(). (This number does not include _live_bytes_in_young_regions() that we expect to evacuate to old.) src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp line 294: > 292: // We have to be careful in the event that SOEP is set to 100 by the user. > 293: assert(ShenandoahOldEvacRatioPercent <= 100, "Error"); > 294: const size_t ratio_of_old_in_collection_set = (maximum_young_evacuation_reserve * ShenandoahOldEvacRatioPercent) / (100 - ShenandoahOldEvacRatioPercent); It looks like we may get divide-by-zero in the above of ShenandoahOldEvacRatioPercent equals 100 src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp line 481: > 479: // promotions than fit in reserved memory, they will be deferred until a future GC pass. > 480: size_t total_promotion_reserve = young_advance_promoted_reserve_used + excess_old; > 481: old_generation->set_promoted_reserve(total_promotion_reserve); Can you clarify why we no longer need this set_promoted_reserve() call? (just in a PR comment probably, not necessarily a code comment.) src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp line 305: > 303: } > 304: // else, we leave copy equal to nullptr, signaling a promotion failure below if appropriate. > 305: // We choose not to promote objects smaller than PLAB::min_size() by way of shared allocations, as this is too I think this comment describes original behavior. With new behavior, comment should say PLAB::max_size() ------------- PR Review: https://git.openjdk.org/jdk/pull/27632#pullrequestreview-3307715360 PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2408855784 PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2408865186 PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2408949510 PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2408922323 From kdnilsen at openjdk.org Mon Oct 6 23:19:51 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Mon, 6 Oct 2025 23:19:51 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v3] In-Reply-To: References: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> Message-ID: On Mon, 6 Oct 2025 22:39:34 GMT, Kelvin Nilsen wrote: >> William Kemper has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix windows build more > > src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp line 294: > >> 292: // We have to be careful in the event that SOEP is set to 100 by the user. >> 293: assert(ShenandoahOldEvacRatioPercent <= 100, "Error"); >> 294: const size_t ratio_of_old_in_collection_set = (maximum_young_evacuation_reserve * ShenandoahOldEvacRatioPercent) / (100 - ShenandoahOldEvacRatioPercent); > > It looks like we may get divide-by-zero in the above of ShenandoahOldEvacRatioPercent equals 100 In the original code, we only compute ratio_of_old_in_collection_set if ShenandoahOldEvacRatioPercent != 100 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2408872507 From ayang at openjdk.org Tue Oct 7 10:29:58 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 7 Oct 2025 10:29:58 GMT Subject: RFR: 8369277: Remove unused CodeCacheUnloadingTask::_num_workers Message-ID: Trivial removing dead code. Test: tier1 ------------- Commit messages: - remove-field-trivial Changes: https://git.openjdk.org/jdk/pull/27671/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27671&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8369277 Stats: 6 lines in 4 files changed: 0 ins; 2 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/27671.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27671/head:pull/27671 PR: https://git.openjdk.org/jdk/pull/27671 From ayang at openjdk.org Tue Oct 7 11:08:20 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 7 Oct 2025 11:08:20 GMT Subject: RFR: 8369277: Remove unused CodeCacheUnloadingTask::_num_workers [v2] In-Reply-To: References: Message-ID: <5LV-BeT8q4lKJmbjUlAhqPtRFHGXZzrCVHkJkbh0RZU=.2e3a549e-7427-4b63-8d52-60ee33549fef@github.com> > Trivial removing dead code. > > Test: tier1 Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: more-remove ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27671/files - new: https://git.openjdk.org/jdk/pull/27671/files/41e4307b..dc5ab249 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27671&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27671&range=00-01 Stats: 6 lines in 3 files changed: 0 ins; 3 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27671.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27671/head:pull/27671 PR: https://git.openjdk.org/jdk/pull/27671 From shade at openjdk.org Tue Oct 7 12:29:43 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Tue, 7 Oct 2025 12:29:43 GMT Subject: RFR: 8369277: Remove unused CodeCacheUnloadingTask::_num_workers [v2] In-Reply-To: <5LV-BeT8q4lKJmbjUlAhqPtRFHGXZzrCVHkJkbh0RZU=.2e3a549e-7427-4b63-8d52-60ee33549fef@github.com> References: <5LV-BeT8q4lKJmbjUlAhqPtRFHGXZzrCVHkJkbh0RZU=.2e3a549e-7427-4b63-8d52-60ee33549fef@github.com> Message-ID: <2iqk66b2BhR4MXe9s3khC8keJFT5m8_nsCXeUDJmwcw=.68318cd9-1776-4645-8da6-ad2a271afec5@github.com> On Tue, 7 Oct 2025 11:08:20 GMT, Albert Mingkun Yang wrote: >> Trivial removing dead code. >> >> Test: tier1 > > Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: > > more-remove src/hotspot/share/gc/shenandoah/shenandoahParallelCleaning.cpp line 39: > 37: _phase(phase), > 38: _unloading_occurred(unloading_occurred), > 39: _code_cache_task(unloading_occurred), `ShenandoahClassUnloadingTask` constructor argument `num_workers` is also unused now? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27671#discussion_r2410456344 From ayang at openjdk.org Tue Oct 7 12:35:20 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 7 Oct 2025 12:35:20 GMT Subject: RFR: 8369277: Remove unused CodeCacheUnloadingTask::_num_workers [v3] In-Reply-To: References: Message-ID: > Trivial removing dead code. > > Test: tier1 Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: review ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27671/files - new: https://git.openjdk.org/jdk/pull/27671/files/dc5ab249..be17b8bf Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27671&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27671&range=01-02 Stats: 2 lines in 2 files changed: 0 ins; 2 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27671.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27671/head:pull/27671 PR: https://git.openjdk.org/jdk/pull/27671 From ayang at openjdk.org Tue Oct 7 13:17:12 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 7 Oct 2025 13:17:12 GMT Subject: RFR: 8369277: Remove unused CodeCacheUnloadingTask::_num_workers [v4] In-Reply-To: References: Message-ID: > Trivial removing dead code. > > Test: tier1 Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: review ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27671/files - new: https://git.openjdk.org/jdk/pull/27671/files/be17b8bf..aea09613 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27671&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27671&range=02-03 Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27671.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27671/head:pull/27671 PR: https://git.openjdk.org/jdk/pull/27671 From kdnilsen at openjdk.org Tue Oct 7 15:24:24 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 15:24:24 GMT Subject: RFR: 8369048: GenShen: Defer ShenFreeSet::available() during rebuild Message-ID: <_PEoOc0oWb8Vzq16-Or_hykkL4NkIrwEFgLCgCRac5U=.2c23c497-acbe-48f9-a1dc-4eb4e8f25a8d@github.com> This code introduces a new rebuild-freeset lock for purposes of coordinating the freeset rebuild activities and queries as to memory available for allocation in the mutator partition. This addresses a problem that results if available memory is probed while we are rebuilding the freeset. Rather than using the existing global heap lock to synchronize these activities, a new more narrowly scoped lock is introduced. This allows the available memory to be probed even when other activities hold the global heap lock for reasons other than rebuilding the freeset, such as when they are allocating memory. It is known that the global heap lock is heavily contended for certain workloads, and using this new lock avoids adding to contention for the global heap lock. ------------- Commit messages: - Revert "revert introduction of RebuildLock" - Revert "available() returns previous value if called during freeset rebuild" - Revert "remove obsolete assertion" - remove obsolete assertion - available() returns previous value if called during freeset rebuild - revert introduction of RebuildLock - reduce gratuitous diffs from tip - Treat traditional Shenandoah same as Generational Shenandoah - fix whitespace - Add support for freeset rebuild lock Changes: https://git.openjdk.org/jdk/pull/27612/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27612&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8369048 Stats: 37 lines in 5 files changed: 20 ins; 0 del; 17 mod Patch: https://git.openjdk.org/jdk/pull/27612.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27612/head:pull/27612 PR: https://git.openjdk.org/jdk/pull/27612 From kdnilsen at openjdk.org Tue Oct 7 15:24:24 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 15:24:24 GMT Subject: RFR: 8369048: GenShen: Defer ShenFreeSet::available() during rebuild In-Reply-To: <_PEoOc0oWb8Vzq16-Or_hykkL4NkIrwEFgLCgCRac5U=.2c23c497-acbe-48f9-a1dc-4eb4e8f25a8d@github.com> References: <_PEoOc0oWb8Vzq16-Or_hykkL4NkIrwEFgLCgCRac5U=.2c23c497-acbe-48f9-a1dc-4eb4e8f25a8d@github.com> Message-ID: On Thu, 2 Oct 2025 17:58:48 GMT, Kelvin Nilsen wrote: > This code introduces a new rebuild-freeset lock for purposes of coordinating the freeset rebuild activities and queries as to memory available for allocation in the mutator partition. > > This addresses a problem that results if available memory is probed while we are rebuilding the freeset. > > Rather than using the existing global heap lock to synchronize these activities, a new more narrowly scoped lock is introduced. This allows the available memory to be probed even when other activities hold the global heap lock for reasons other than rebuilding the freeset, such as when they are allocating memory. It is known that the global heap lock is heavily contended for certain workloads, and using this new lock avoids adding to contention for the global heap lock. Will identify this PR as draft until I complete performance and correctness tests. I have these results from running Extremem tests on commit 99d0175 image I am going to try an experiment with a different approach. I will remove the synchronization lock and instead will cause the implementation of freeset rebuild to not update available() until after it is done with its work. I think this may address the same problem with less run-time overhead. On the same workload, here are the results of the experiment (rather than locking to prevent fetch of available during rebuild, we continue to return the value of available at the start of rebuild until rebuild finishes): image General observations are that: 1. CPU utilization increased for both GenShen and Shen. 2. Number of completed GCs increased for GenShen but decreased for Shen 3. Shen degenerated GCs increased 4. GenShen P50 latency increased, but p95, p99, and p99.9 latencies decreased. Higher latencies all increased for GenShen. 5. Shen latencies are worse at all percentiles. Qualitatively, what would we expect? If we return an old value for available() during freeset rebuild, we are usually causing triggering heuristics to believe there is less memory available than is actually available. This may cause us to trigger GC more aggressively. This bears out for GenShen, but not for Shen. With GenShen, the critical conflict occurs when old marking has completed, and we rebuild the free set following old marking in order to recycle immediate old garbage and to set aside old-collector reserves which will be required for anticipated mixed evacuation GC cycles that will immediately follow. While this is happening, the Shenandoah regulator thread is trying to decide whether it should interrupt old GC in order to perform an "urgent" young GC cycle. And sometimes, the regulator thread's inquiry as to how much memory is available sees a bogus (not just stale, but out of thin air) value because the freeset is under construction at the time of its inquiry. Preventing this bogus value is the point of this PR. This situation does not generally happen with traditional Shenandoah. Traditional Shenandoah only queries the available() during times when GC is idle. (There are plans to change this, to allow the freeset to be rebuilt more asynchronously, so we are testing this coordination mechanism out for both GenShen and Shen.). A plausible explanation for the observed impact on Shen is that the absence of synchronization allows Shen to see more stale values of available(), even when we are not conflicting with concurrent freeset rebuilds. Specifically, if we gnawing away on available memory, probing available() every ms, the triggering heuristic may see the same value of available() for three consecutive probes. Not recognizing that memory has been consumed, it will delay triggering of the next GC cycle, resulting in fewer concurrent GCs with the "unsynchronized" solution. Besides resulting in fewer GC cycles, the late triggers also allow us to get closer to total depletion of the allocat able memory pool, which explains an increase in Shenandoah degenerated cycles. Presumably, GenShen is also vulnerable to this possibility. But the benefit of eliminating out-of-thin-air available values for GenShen seems to outweigh the risk of occasional stale values that cause late triggers. For further context, here are CI pipeline performance summaries for the initial synchronized solution: Control: openjdk-master-aarch64 Experiment: synchronize-available-with-rebuild-gh-aarch64 Genshen ------------------------------------------------------------------------------------------------------- +45.80% specjbb2015/trigger_failure p=0.00542 Control: 365.562 (+/-158.45 ) 109 Test: 533.000 (+/-200.37 ) 10 +28.53% scimark.lu.large/concurrent_update_refs_young p=0.00020 Control: 5.608ms (+/- 1.91ms) 34 Test: 7.208ms (+/-107.48us) 2 +24.44% specjbb2015/concurrent_update_refs_degen_young p=0.00563 Control: 804.287ms (+/-330.68ms) 41 Test: 1.001s (+/-101.83ms) 8 and for the "unsynchronized" solution: Control: openjdk-master-aarch64 Experiment: synchronize-available-with-rebuild-gh-aarch64 Genshen ------------------------------------------------------------------------------------------------------- +51.82% hyperalloc_a2048_o4096/finish_mark_degen_young p=0.00771 Control: 82.769ms (+/- 66.46ms) 66 Test: 125.658ms (+/- 78.91ms) 43 The p values for all of these measures are a bit high, based on limited samples of relevant data. The unsynchronized data result is combined with previous measurements taken from the synchronized experiments. One other somewhat subjective observation is that the synchronized solution experienced many more "timeout" failures on the CI pipeline than the unsynchronized solution. These timeout failures correlate with stress workloads that exercise the JVM in abnormal/extreme ways. Under these stresses, the unsynchronized mechanism seems to be a bit more robust. I'm inclined to prefer the synchronized solution so will revert my most recent three commits. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27612#issuecomment-3362378108 PR Comment: https://git.openjdk.org/jdk/pull/27612#issuecomment-3372885805 PR Comment: https://git.openjdk.org/jdk/pull/27612#issuecomment-3377284428 PR Comment: https://git.openjdk.org/jdk/pull/27612#issuecomment-3377318918 PR Comment: https://git.openjdk.org/jdk/pull/27612#issuecomment-3377335205 PR Comment: https://git.openjdk.org/jdk/pull/27612#issuecomment-3377355113 From kdnilsen at openjdk.org Tue Oct 7 16:27:56 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 16:27:56 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v15] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: remove set_capacity() scaffolding from shenandoahOldGeneration.hpp ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/f6a1182e..5277bc1c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=14 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=13-14 Stats: 7 lines in 2 files changed: 1 ins; 5 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From kdnilsen at openjdk.org Tue Oct 7 16:27:59 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 16:27:59 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v12] In-Reply-To: References: Message-ID: On Thu, 2 Oct 2025 23:09:34 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with five additional commits since the last revision: >> >> - small refactoring >> - OO refinements to used_regions_size() >> - fix broken assert from previous commit >> - OO refinements to free_unaffiliated_regions() >> - OO refinements to max_capacity() > > src/hotspot/share/gc/shenandoah/shenandoahGlobalGeneration.cpp line 40: > >> 38: >> 39: size_t ShenandoahGlobalGeneration::max_capacity() const { >> 40: #ifdef ASSERT > > Could we just have this assertion one time in the constructor? Yes. Making this change. Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2411198002 From kdnilsen at openjdk.org Tue Oct 7 16:28:01 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 16:28:01 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v3] In-Reply-To: References: Message-ID: On Fri, 12 Sep 2025 18:08:26 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: >> >> another tweak to make GHA gtest happy > > src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.hpp line 104: > >> 102: >> 103: // Use this only for unit testing. Do not use for production. >> 104: inline void set_capacity(size_t bytes) { > > We should be able to inline this code in `test_shenandoahOldHeuristic.cpp` in the constructor of the test fixture that calls this method. Very good suggestion. Thanks. Done. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2411186964 From kdnilsen at openjdk.org Tue Oct 7 16:42:14 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 16:42:14 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v12] In-Reply-To: References: Message-ID: On Thu, 2 Oct 2025 23:12:01 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with five additional commits since the last revision: >> >> - small refactoring >> - OO refinements to used_regions_size() >> - fix broken assert from previous commit >> - OO refinements to free_unaffiliated_regions() >> - OO refinements to max_capacity() > > src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp line 953: > >> 951: } >> 952: >> 953: size_t ShenandoahGeneration::max_capacity() const { > > We never instantiate `ShenandoahGeneration` even non-generational mode gets `ShenandoahGlobalGeneration`. You could make these methods pure virtual. The implementation here should never be called. Thanks. Making this change also. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2411236294 From wkemper at openjdk.org Tue Oct 7 16:43:19 2025 From: wkemper at openjdk.org (William Kemper) Date: Tue, 7 Oct 2025 16:43:19 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v3] In-Reply-To: References: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> Message-ID: <671VDUKCeU8fohCzUMiqfe5TIzbw9nu8EQopOKNjjrk=.aa24764e-7841-4eee-9af5-7c45317adc8a@github.com> On Mon, 6 Oct 2025 22:41:42 GMT, Kelvin Nilsen wrote: >> src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp line 294: >> >>> 292: // We have to be careful in the event that SOEP is set to 100 by the user. >>> 293: assert(ShenandoahOldEvacRatioPercent <= 100, "Error"); >>> 294: const size_t ratio_of_old_in_collection_set = (maximum_young_evacuation_reserve * ShenandoahOldEvacRatioPercent) / (100 - ShenandoahOldEvacRatioPercent); >> >> It looks like we may get divide-by-zero in the above of ShenandoahOldEvacRatioPercent equals 100 > > In the original code, we only compute ratio_of_old_in_collection_set if ShenandoahOldEvacRatioPercent != 100 Good catch, I'll fix this. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2411238898 From wkemper at openjdk.org Tue Oct 7 16:43:24 2025 From: wkemper at openjdk.org (William Kemper) Date: Tue, 7 Oct 2025 16:43:24 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v3] In-Reply-To: References: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> Message-ID: On Mon, 6 Oct 2025 22:55:22 GMT, Kelvin Nilsen wrote: >> William Kemper has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix windows build more > > src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp line 305: > >> 303: } >> 304: // else, we leave copy equal to nullptr, signaling a promotion failure below if appropriate. >> 305: // We choose not to promote objects smaller than PLAB::min_size() by way of shared allocations, as this is too > > I think this comment describes original behavior. With new behavior, comment should say PLAB::max_size() Indeed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2411239567 From kdnilsen at openjdk.org Tue Oct 7 16:49:42 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 16:49:42 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v16] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with two additional commits since the last revision: - Make ShenandoahGeneration methods pure virtual - simplify assertions ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/5277bc1c..510a4b8f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=15 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=14-15 Stats: 126 lines in 6 files changed: 10 ins; 107 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From kdnilsen at openjdk.org Tue Oct 7 17:02:46 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 17:02:46 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v17] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: revert gratuitous changes to shenandoahConcurrentGC.cpp ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/510a4b8f..bd8e7f76 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=16 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=15-16 Stats: 5 lines in 1 file changed: 0 ins; 3 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From shade at openjdk.org Tue Oct 7 17:11:23 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Tue, 7 Oct 2025 17:11:23 GMT Subject: RFR: 8369277: Remove unused CodeCacheUnloadingTask::_num_workers [v4] In-Reply-To: References: Message-ID: On Tue, 7 Oct 2025 13:17:12 GMT, Albert Mingkun Yang wrote: >> Trivial removing dead code. >> >> Test: tier1 > > Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: > > review Marked as reviewed by shade (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27671#pullrequestreview-3311065351 From kdnilsen at openjdk.org Tue Oct 7 17:17:02 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 17:17:02 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v12] In-Reply-To: References: Message-ID: <317DjK8tXvEQesqN-YOVzUU652Ju6j3oBWRVPYTP_JM=.c0b7858f-28bd-4bf7-83af-33a7b10208db@github.com> On Thu, 2 Oct 2025 23:20:50 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with five additional commits since the last revision: >> >> - small refactoring >> - OO refinements to used_regions_size() >> - fix broken assert from previous commit >> - OO refinements to free_unaffiliated_regions() >> - OO refinements to max_capacity() > > src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp line 1153: > >> 1151: void ShenandoahConcurrentGC::op_final_update_refs() { >> 1152: ShenandoahHeap* const heap = ShenandoahHeap::heap(); >> 1153: bool is_generational = heap->mode()->is_generational(); > > Are the changes here necessary? This is a big PR, it would be helpful to minimize unnecessary changes. I've reverted these changes. Thanks. > src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp line 1145: > >> 1143: _preserved_marks->reclaim(); >> 1144: >> 1145: // We defer generation resizing actions until after cset regions have been recycled. We do this even following an > > Stale comment? Yes. Removed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2411316966 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2411321130 From kdnilsen at openjdk.org Tue Oct 7 17:20:31 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 17:20:31 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v3] In-Reply-To: References: Message-ID: On Fri, 12 Sep 2025 17:47:48 GMT, Kelvin Nilsen wrote: >> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: >> >> another tweak to make GHA gtest happy > > src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp line 235: > >> 233: // is_collector_free range. >> 234: region->restore_top_before_promote(); >> 235: size_t region_to_be_used_in_old = region->used(); > > is region_to_be_used_in_old dead here? It's not dead, but is only relevant within assertion. Enclosing this code in #ifdef ASSERT ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2411330326 From kdnilsen at openjdk.org Tue Oct 7 17:52:06 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 17:52:06 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v18] In-Reply-To: References: Message-ID: <8ncMZBszoi0KvaMfQkkd_Bjv8G_UOWUwsg3BgIqlQqo=.f442633f-b304-45cb-8759-fb153744d57a@github.com> > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with three additional commits since the last revision: - finish excising shenandoahGenerationSizer - Remove ShenandoahGenerationSizer - remove stale comment ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/bd8e7f76..3ed66563 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=17 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=16-17 Stats: 247 lines in 7 files changed: 1 ins; 242 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From kdnilsen at openjdk.org Tue Oct 7 17:52:09 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 17:52:09 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v12] In-Reply-To: References: Message-ID: <_RIw2rbRBf1AE9YAj1gexdcOj3CGmE-YqRq-XuWRozM=.41a68123-241f-4c63-9409-c08c8fcb8f24@github.com> On Thu, 2 Oct 2025 23:35:55 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with five additional commits since the last revision: >> >> - small refactoring >> - OO refinements to used_regions_size() >> - fix broken assert from previous commit >> - OO refinements to free_unaffiliated_regions() >> - OO refinements to max_capacity() > > src/hotspot/share/gc/shenandoah/shenandoahGenerationSizer.hpp line 1: > >> 1: /* > > Is there any point in keeping this file now? Not sure what this class is doing now. Thanks. Removing ShenandoahGenerationSizer. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2411440425 From kdnilsen at openjdk.org Tue Oct 7 18:01:21 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 18:01:21 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v19] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: Remove unnecessary methods ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/3ed66563..26a516ca Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=18 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=17-18 Stats: 42 lines in 2 files changed: 0 ins; 42 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From kdnilsen at openjdk.org Tue Oct 7 20:40:42 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 20:40:42 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v12] In-Reply-To: References: Message-ID: On Thu, 2 Oct 2025 23:39:32 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with five additional commits since the last revision: >> >> - small refactoring >> - OO refinements to used_regions_size() >> - fix broken assert from previous commit >> - OO refinements to free_unaffiliated_regions() >> - OO refinements to max_capacity() > > src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 745: > >> 743: // 2. Region's free is less than minimum TLAB size and is retired >> 744: // 3. The unused portion of memory in the last region of a humongous object >> 745: void ShenandoahHeap::increase_used(const ShenandoahAllocRequest& req) { > > I don't see the point of this method now. Can we delete it? Removed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2411805067 From wkemper at openjdk.org Tue Oct 7 21:18:06 2025 From: wkemper at openjdk.org (William Kemper) Date: Tue, 7 Oct 2025 21:18:06 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v3] In-Reply-To: References: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> Message-ID: On Mon, 6 Oct 2025 22:35:22 GMT, Kelvin Nilsen wrote: >> William Kemper has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix windows build more > > src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.inline.hpp line 62: > >> 60: >> 61: size_t ShenandoahCollectionSet::get_live_bytes_in_young_regions() const { >> 62: return _young_bytes_to_evacuate - _young_bytes_to_promote; > > I'm wondering if these new names properly reflect the intention. It seems get_live_byte_in_young_regions() really means get_live_bytes_that_we_intend_to_evacuate_to_young(). (This number does not include _live_bytes_in_young_regions() that we expect to evacuate to old.) I called the complementary method `get_live_bytes_in_tenurable_regions`. How about `get_live_bytes_in_untenurable_regions`? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2411948730 From kdnilsen at openjdk.org Tue Oct 7 21:50:03 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 21:50:03 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v12] In-Reply-To: References: Message-ID: On Thu, 2 Oct 2025 23:43:00 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with five additional commits since the last revision: >> >> - small refactoring >> - OO refinements to used_regions_size() >> - fix broken assert from previous commit >> - OO refinements to free_unaffiliated_regions() >> - OO refinements to max_capacity() > > src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 2719: > >> 2717: assert(used() <= ShenandoahHeap::heap()->max_capacity(), "sanity"); >> 2718: assert(committed() <= ShenandoahHeap::heap()->max_capacity(), "sanity"); >> 2719: assert(max_capacity() <= ShenandoahHeap::heap()->max_capacity(), "sanity"); > > This last one is just comparing the results of the same method call. Are we worried about races here? Removing that one. Don't know what I was thinking... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2412004168 From kdnilsen at openjdk.org Tue Oct 7 21:54:39 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 21:54:39 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v12] In-Reply-To: References: Message-ID: <_ifVkS55O5eNYo5e3b-qu8F026vovEWlyOyRLbnF5Vs=.56aab75a-0a4f-4c07-8caf-8c1489e7ec94@github.com> On Thu, 2 Oct 2025 23:48:43 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with five additional commits since the last revision: >> >> - small refactoring >> - OO refinements to used_regions_size() >> - fix broken assert from previous commit >> - OO refinements to free_unaffiliated_regions() >> - OO refinements to max_capacity() > > src/hotspot/share/gc/shenandoah/shenandoahMemoryPool.cpp line 65: > >> 63: // to make sense under the race. See JDK-8207200. >> 64: committed = MAX2(used, committed); >> 65: assert(used <= committed, "used: %zu, committed: %zu", used, committed); > > Shouldn't it always be the case that `initial <= used <= committed <= max`? It should be that way. Yes. But we have been known to violate these conditions, especially when unsigned arithmetic underflows (i.e. small_unsigned_value - large_unsigned_value yields really big unsigned_value) > src/hotspot/share/gc/shenandoah/shenandoahSimpleBitMap.cpp line 42: > >> 40: } >> 41: >> 42: size_t ShenandoahSimpleBitMap::count_leading_ones(index_type start_idx) const { > > Did we figure out why we want to rename this type? It adds a lot of noise to this PR and I'd hate to do something like this because of a C++ technicality. I've reverted this change. In a different PR, we might decide to address this in a different way. We have multiple typedefs for idx_t even within the shenandoah development directory.. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2412009478 PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2412011761 From kdnilsen at openjdk.org Tue Oct 7 22:00:22 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 22:00:22 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v19] In-Reply-To: References: Message-ID: <5UAnGN3TiTYZSVcLUKLq-WIrpi3_h6rBAMhdcer6lxQ=.6b299e43-1166-4dc6-b258-3c3b30b5d292@github.com> On Fri, 3 Oct 2025 00:00:25 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove unnecessary methods > > src/hotspot/share/gc/shared/gc_globals.hpp line 472: > >> 470: product(size_t, SoftMaxHeapSize, 0, MANAGEABLE, \ >> 471: "Soft limit for maximum heap size (in bytes)") \ >> 472: constraint(SoftMaxHeapSizeConstraintFunc,AfterMemoryInit) \ > > Changing a common file might raise eyebrows. Why do we need this? ShenandoahHeap::initialize() makes use of SoftMaxHeapSize. If the SoftMaxHeapSizeConstraintFunc is handled "after memory init", the value of SoftMaxHeapSize is not yet available when we try to use it. I welcome an alternative approach if you have any ideas. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2412023407 From kdnilsen at openjdk.org Tue Oct 7 22:00:26 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 22:00:26 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v12] In-Reply-To: References: Message-ID: On Thu, 2 Oct 2025 23:55:42 GMT, William Kemper wrote: >> Kelvin Nilsen has updated the pull request incrementally with five additional commits since the last revision: >> >> - small refactoring >> - OO refinements to used_regions_size() >> - fix broken assert from previous commit >> - OO refinements to free_unaffiliated_regions() >> - OO refinements to max_capacity() > > src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp line 498: > >> 496: >> 497: class ShenandoahVerifyHeapRegionClosure : public ShenandoahHeapRegionClosure { >> 498: private: > > Formatting the access modifiers like this looks idiosyncratic: > > % grep -ri -P '^ private:' src/hotspot | wc -l > 115 > % grep -ri -P '^private:' src/hotspot | wc -l > 1444 I've fixed this here, and in neighboring declarations of same file. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2412018805 From kdnilsen at openjdk.org Tue Oct 7 22:07:09 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 22:07:09 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v14] In-Reply-To: References: Message-ID: <7gs_aeIVgmVkDT5AkqMAd5zn-1bfcIHkwYY5ZbvObFA=.ae5e7d12-1cc2-4521-b408-8a2e7b3829a5@github.com> On Fri, 3 Oct 2025 21:54:32 GMT, Kelvin Nilsen wrote: >> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: >> >> simplify implementation of promote_in_place > > src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp line 136: > >> 134: >> 135: #ifndef PRODUCT >> 136: void dump_bitmap_row(idx_t region_idx) const; > > maybe revert this. bitmap rows are not idx_t. After review, I think it is appropriate that the argument type be declared idx_t. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2412032037 From kdnilsen at openjdk.org Tue Oct 7 22:07:10 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 22:07:10 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v14] In-Reply-To: <7gs_aeIVgmVkDT5AkqMAd5zn-1bfcIHkwYY5ZbvObFA=.ae5e7d12-1cc2-4521-b408-8a2e7b3829a5@github.com> References: <7gs_aeIVgmVkDT5AkqMAd5zn-1bfcIHkwYY5ZbvObFA=.ae5e7d12-1cc2-4521-b408-8a2e7b3829a5@github.com> Message-ID: On Tue, 7 Oct 2025 22:03:34 GMT, Kelvin Nilsen wrote: >> src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp line 136: >> >>> 134: >>> 135: #ifndef PRODUCT >>> 136: void dump_bitmap_row(idx_t region_idx) const; >> >> maybe revert this. bitmap rows are not idx_t. > > After review, I think it is appropriate that the argument type be declared idx_t. After review of context, I believe it is appropriate that these arguments be declared idx_t. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2412033488 From wkemper at openjdk.org Tue Oct 7 22:24:18 2025 From: wkemper at openjdk.org (William Kemper) Date: Tue, 7 Oct 2025 22:24:18 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v3] In-Reply-To: References: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> Message-ID: On Mon, 6 Oct 2025 23:17:01 GMT, Kelvin Nilsen wrote: >> William Kemper has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix windows build more > > src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp line 481: > >> 479: // promotions than fit in reserved memory, they will be deferred until a future GC pass. >> 480: size_t total_promotion_reserve = young_advance_promoted_reserve_used + excess_old; >> 481: old_generation->set_promoted_reserve(total_promotion_reserve); > > Can you clarify why we no longer need this set_promoted_reserve() call? (just in a PR comment probably, not necessarily a code comment.) In `compute_evacuation_reserves` we are setting the promotion reserve to the maximum possible to handle everything tenurable this cycle (this is still capped by the maximum evacuation reserve for old). I was reluctant to scale the promotion reserve by `ShenandoahPromoEvacWaste` for fear it would over commit the collector's reserves and lead to OOM errors during evacuation. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2412065409 From wkemper at openjdk.org Tue Oct 7 22:32:56 2025 From: wkemper at openjdk.org (William Kemper) Date: Tue, 7 Oct 2025 22:32:56 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v4] In-Reply-To: References: Message-ID: > Notable changes: > * Improvements to logging > * More accurate tracking of promotion failures > * Use shared allocation for promotions only when the size is above the maximum plab size (not the minimum size) > * Use census information gathered during mark to size promotion reserves and old generation > > With these changes, GenShen is expected to have fewer promotion failures and this is indeed the case. As a result of this, we expect less time to be spent in concurrent marking and update refs for young collections. We may also expect shorter concurrent evacuation phases because GenShen will have fewer densely packed regions stuck in the young generation. With more objects being promoted, we also expect to see longer remembered set scan times. This is generally the case across all benchmarks, but we do also see some counter-intuitive results. > > Here we are comparing 20 executions (10 on x86, 10 on aarch64) of the changes in the PR (experiment) against 20 executions of the same benchmarks results from tip. This is a summary of statistically significant changes of more than 5% across all benchmarks: > > > Concurrent Evacuation: 7 improvements, 3 regressions > ? Best improvements: extremem-large-45g (-29.6%), neo4j-analytics (-26.9%) > ? Worst regression: xalan (+53.7%) > > Concurrent Marking: 15 improvements, 1 regression > ? Best improvements: hyperalloc_a2048_o4096 (-30.1%), crypto.rsa (-27.3%) > ? Only regression: serial (+8.9%) > > Concurrent Scan Remembered Set: 7 improvements, 2 regressions > ? Best improvements: xalan (-49.4%), pmd (-49.0%), crypto.rsa (-41.8%) > ? Worst regression: extremem-phased (+52.4%) > > Concurrent Update Refs: 5 improvements, 4 regressions > ? Best improvements: crypto.rsa (-36.4%), mnemonics (-28.4%) > ? Worst regression: xalan (+89.4%) William Kemper has updated the pull request incrementally with one additional commit since the last revision: Review feedback, bug fixes ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27632/files - new: https://git.openjdk.org/jdk/pull/27632/files/09926eb2..b4d1cf90 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27632&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27632&range=02-03 Stats: 58 lines in 6 files changed: 26 ins; 18 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/27632.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27632/head:pull/27632 PR: https://git.openjdk.org/jdk/pull/27632 From kdnilsen at openjdk.org Tue Oct 7 22:56:27 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 22:56:27 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v20] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with four additional commits since the last revision: - add override to method declaration - remove unneeded variables from ShenandoahGeneration - fix indentation - remove meaningless assert ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/26a516ca..4db0cbe4 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=19 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=18-19 Stats: 42 lines in 11 files changed: 0 ins; 20 del; 22 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From kdnilsen at openjdk.org Tue Oct 7 23:44:32 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 23:44:32 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v4] In-Reply-To: References: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> Message-ID: <7xGe1GZZMDQlU380bkZlAGkgMsI-Q_jRD6qSVJrM664=.640873a9-2c9d-4297-b64b-ec74c7819442@github.com> On Tue, 7 Oct 2025 22:21:53 GMT, William Kemper wrote: >> src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp line 481: >> >>> 479: // promotions than fit in reserved memory, they will be deferred until a future GC pass. >>> 480: size_t total_promotion_reserve = young_advance_promoted_reserve_used + excess_old; >>> 481: old_generation->set_promoted_reserve(total_promotion_reserve); >> >> Can you clarify why we no longer need this set_promoted_reserve() call? (just in a PR comment probably, not necessarily a code comment.) > > In `compute_evacuation_reserves` we are setting the promotion reserve to the maximum possible to handle everything tenurable this cycle (this is still capped by the maximum evacuation reserve for old). I was reluctant to scale the promotion reserve by `ShenandoahPromoEvacWaste` for fear it would over commit the collector's reserves and lead to OOM errors during evacuation. So in the new design, we have full awareness of all promotable objects, and we've already done our best to budget for those. So there's no such thing as "unanticipated promotions". Separate question is whether we scale promotion reserve by ShenandoahPromoEvacWaste. So if old is larger than necessary to handle the anticipated mixed evacuations and promotions, the new code is essentially saying "use this extra space for mixed evacuations rather than for promotions". Since we're not expanding the promoted_reserve, promotions will not be allowed to touch it. Am I understanding the intent correctly? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2412176142 From kdnilsen at openjdk.org Tue Oct 7 23:48:52 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 7 Oct 2025 23:48:52 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v3] In-Reply-To: References: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> Message-ID: On Tue, 7 Oct 2025 21:15:40 GMT, William Kemper wrote: >> src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.inline.hpp line 62: >> >>> 60: >>> 61: size_t ShenandoahCollectionSet::get_live_bytes_in_young_regions() const { >>> 62: return _young_bytes_to_evacuate - _young_bytes_to_promote; >> >> I'm wondering if these new names properly reflect the intention. It seems get_live_byte_in_young_regions() really means get_live_bytes_that_we_intend_to_evacuate_to_young(). (This number does not include _live_bytes_in_young_regions() that we expect to evacuate to old.) > > I called the complementary method `get_live_bytes_in_tenurable_regions`. How about `get_live_bytes_in_untenurable_regions`? I'm still maybe a bit confused. Is it get_untenurable_live_bytes_in_young_regions()? Are we distinguishing? So we have a total of N live bytes within young regions that have been placed into the collection set. We expect that P bytes (P < N) will be promoted, and the remaining S bytes (S + P == N) will be evacuated to "survivor space" within young. Does get_live_bytes_in_untenurable_regions() equal P + S? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2412180653 From kbarrett at openjdk.org Wed Oct 8 04:01:28 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Wed, 8 Oct 2025 04:01:28 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library Message-ID: Please review this change to the HotSpot Style Guide to suggest that C++ Standard Library components may be used, after appropriate vetting and discussion, rather than just a blanket "no, don't use it" with a few very narrow exceptions. It provides some guidance on that vetting process and the criteria to use, along with usage patterns. In particular, it proposes that Standard Library headers should not be included directly, but instead through HotSpot-provided wrapper headers. This gives us a place to document usage, provide workarounds for platform issues in a single place, and so on. Such wrapper headers are provided by this PR for , , and , along with updates to use them. I have a separate change for that I plan to propose later, under JDK-8369187. There will be additional followups for other C compatibility headers besides . This PR also cleans up some nomenclature issues around forbid vs exclude and the like. Testing: mach5 tier1-5, GHA sanity tests ------------- Commit messages: - add wrapper for - add wrapper for - add wrapper for - style guide permits some standard library facilities Changes: https://git.openjdk.org/jdk/pull/27601/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27601&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8369186 Stats: 623 lines in 68 files changed: 383 ins; 134 del; 106 mod Patch: https://git.openjdk.org/jdk/pull/27601.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27601/head:pull/27601 PR: https://git.openjdk.org/jdk/pull/27601 From stefank at openjdk.org Wed Oct 8 07:10:05 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Wed, 8 Oct 2025 07:10:05 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library In-Reply-To: References: Message-ID: <8yuoztJS9xFrnxl2LHCptA8HtSU8dpXiifFrRTaHIOE=.010c05ff-3bbf-41f5-8a85-63f2dc1e0fa3@github.com> On Thu, 2 Oct 2025 07:11:51 GMT, Kim Barrett wrote: > Please review this change to the HotSpot Style Guide to suggest that C++ > Standard Library components may be used, after appropriate vetting and > discussion, rather than just a blanket "no, don't use it" with a few very > narrow exceptions. It provides some guidance on that vetting process and > the criteria to use, along with usage patterns. > > In particular, it proposes that Standard Library headers should not be > included directly, but instead through HotSpot-provided wrapper headers. This > gives us a place to document usage, provide workarounds for platform issues in > a single place, and so on. > > Such wrapper headers are provided by this PR for ``, ``, and > ``, along with updates to use them. I have a separate change for > `` that I plan to propose later, under JDK-8369187. There will be > additional followups for other C compatibility headers besides ``. > > This PR also cleans up some nomenclature issues around forbid vs exclude and > the like. > > Testing: mach5 tier1-5, GHA sanity tests doc/hotspot-style.md line 1658: > 1656: to anonymous heterogeneous sequences. In particular, a standard-layout > 1657: class is preferred to a tuple. > 1658: I gave this feedback offline, but I'll record it here as well. I think that the tuple section should go to the undecided section. I understand the wish to go with named classes, and I often prefer that as well, but I also see that people often refrain from doing using them various reasons and instead use out-parameters or mix return values into one primitive. I don't want to fully close the door on this feature, and would like us to put this in the undecided (yes, still implicitly forbidden) section. To me that signals that we can at least experiment with it to see if it makes sense to sometimes use it (and if it does we can bring that back for discussion). Whereas outright forbidding it puts a stake in the ground and tells the story that we really shouldn't be looking at tuples. I think that's a too strong of a statement. src/hotspot/share/utilities/tuple.hpp line 2: > 1: /* > 2: * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. So we have our own tuple ... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2412807041 PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2412811951 From tschatzl at openjdk.org Wed Oct 8 07:53:11 2025 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Wed, 8 Oct 2025 07:53:11 GMT Subject: RFR: 8369277: Remove unused CodeCacheUnloadingTask::_num_workers [v4] In-Reply-To: References: Message-ID: <8ylD16cDLJJCp50DLei-HwFiIyTOdmUbb66jAo_Rw0w=.d678136b-82c7-478d-997e-d2ea8b6317c1@github.com> On Tue, 7 Oct 2025 13:17:12 GMT, Albert Mingkun Yang wrote: >> Trivial removing dead code. >> >> Test: tier1 > > Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: > > review Marked as reviewed by tschatzl (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27671#pullrequestreview-3313449612 From ayang at openjdk.org Wed Oct 8 09:32:29 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Wed, 8 Oct 2025 09:32:29 GMT Subject: RFR: 8369277: Remove unused CodeCacheUnloadingTask::_num_workers [v4] In-Reply-To: References: Message-ID: On Tue, 7 Oct 2025 13:17:12 GMT, Albert Mingkun Yang wrote: >> Trivial removing dead code. >> >> Test: tier1 > > Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: > > review Thanks for review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27671#issuecomment-3380642268 From ayang at openjdk.org Wed Oct 8 09:32:31 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Wed, 8 Oct 2025 09:32:31 GMT Subject: Integrated: 8369277: Remove unused CodeCacheUnloadingTask::_num_workers In-Reply-To: References: Message-ID: On Tue, 7 Oct 2025 10:22:34 GMT, Albert Mingkun Yang wrote: > Trivial removing dead code. > > Test: tier1 This pull request has now been integrated. Changeset: c6695064 Author: Albert Mingkun Yang URL: https://git.openjdk.org/jdk/commit/c66950643e4f43b5997b223289eefdde589589fa Stats: 16 lines in 8 files changed: 0 ins; 8 del; 8 mod 8369277: Remove unused CodeCacheUnloadingTask::_num_workers Reviewed-by: shade, tschatzl ------------- PR: https://git.openjdk.org/jdk/pull/27671 From shade at openjdk.org Wed Oct 8 11:30:04 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Wed, 8 Oct 2025 11:30:04 GMT Subject: RFR: 8264851: Shenandoah: Rework control loop mechanics to use timed waits In-Reply-To: References: Message-ID: On Thu, 25 Sep 2025 20:35:59 GMT, William Kemper wrote: > We use a similar mechanism in `shGenerationalControlThread` already. Using a timed wait allows the control thread to be woken up before the wait expires. Marked as reviewed by shade (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27502#pullrequestreview-3314374701 From jwaters at openjdk.org Wed Oct 8 12:00:13 2025 From: jwaters at openjdk.org (Julian Waters) Date: Wed, 8 Oct 2025 12:00:13 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library In-Reply-To: References: Message-ID: On Thu, 2 Oct 2025 07:11:51 GMT, Kim Barrett wrote: > Such wrapper headers are provided by this PR for ``, ``, and > ``, along with updates to use them. Did you mean type_traits? ------------- PR Comment: https://git.openjdk.org/jdk/pull/27601#issuecomment-3381173911 From kbarrett at openjdk.org Wed Oct 8 13:12:26 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Wed, 8 Oct 2025 13:12:26 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library In-Reply-To: References: Message-ID: On Wed, 8 Oct 2025 11:56:55 GMT, Julian Waters wrote: > > Such wrapper headers are provided by this PR for ``, ``, and > > ``, along with updates to use them. > > Did you mean type_traits? Oops! Yes. Fixing description... ------------- PR Comment: https://git.openjdk.org/jdk/pull/27601#issuecomment-3381469837 From kbarrett at openjdk.org Wed Oct 8 13:25:58 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Wed, 8 Oct 2025 13:25:58 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library In-Reply-To: <8yuoztJS9xFrnxl2LHCptA8HtSU8dpXiifFrRTaHIOE=.010c05ff-3bbf-41f5-8a85-63f2dc1e0fa3@github.com> References: <8yuoztJS9xFrnxl2LHCptA8HtSU8dpXiifFrRTaHIOE=.010c05ff-3bbf-41f5-8a85-63f2dc1e0fa3@github.com> Message-ID: On Wed, 8 Oct 2025 07:07:21 GMT, Stefan Karlsson wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > src/hotspot/share/utilities/tuple.hpp line 2: > >> 1: /* >> 2: * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. > > So we have our own tuple ... We have our own baby partial tuple. What's there is more like a heterogeneous array with compile-time indexing. It's used for one thing, and provides just enough functionality for that use. I'm not entirely convinced it's the right tool for the job, though I haven't taken the time to work out alternatives. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2413850653 From kbarrett at openjdk.org Wed Oct 8 13:51:03 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Wed, 8 Oct 2025 13:51:03 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library In-Reply-To: <8yuoztJS9xFrnxl2LHCptA8HtSU8dpXiifFrRTaHIOE=.010c05ff-3bbf-41f5-8a85-63f2dc1e0fa3@github.com> References: <8yuoztJS9xFrnxl2LHCptA8HtSU8dpXiifFrRTaHIOE=.010c05ff-3bbf-41f5-8a85-63f2dc1e0fa3@github.com> Message-ID: On Wed, 8 Oct 2025 07:04:59 GMT, Stefan Karlsson wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > doc/hotspot-style.md line 1658: > >> 1656: to anonymous heterogeneous sequences. In particular, a standard-layout >> 1657: class is preferred to a tuple. >> 1658: > > I gave this feedback offline, but I'll record it here as well. I think that the tuple section should go to the undecided section. > > I understand the wish to go with named classes, and I often prefer that as well, but I also see that people often refrain from doing using them various reasons and instead use out-parameters or mix return values into one primitive. I don't want to fully close the door on this feature, and would like us to put this in the undecided (yes, still implicitly forbidden) section. To me that signals that we can at least experiment with it to see if it makes sense to sometimes use it (and if it does we can bring that back for discussion). Whereas outright forbidding it puts a stake in the ground and tells the story that we really shouldn't be looking at tuples. I think that's a too strong of a statement. I have a different take on the distinction between forbidden and undecided. I think of forbidden features as being those where there are good arguments against. Whereas I think of undecided as perhaps having wishy washy arguments in either direction, or even not seriously thought about. But good arguments against can be overcome by better arguments in favor. But I can see how someone else might take that distinction differently. I also admit to being somewhat biased against tuple in particular. I've seen a few pretty terrible uses... one was even my fault! So okay, I'll recategorize tuple. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2413928370 From xpeng at openjdk.org Wed Oct 8 16:16:50 2025 From: xpeng at openjdk.org (Xiaolong Peng) Date: Wed, 8 Oct 2025 16:16:50 GMT Subject: RFR: 8361099: Shenandoah: Improve heap lock contention by using CAS for memory allocation [v4] In-Reply-To: References: Message-ID: > Shenandoah always allocates memory with heap lock, we have observed heavy heap lock contention on memory allocation path in performance analysis of some service in which we tried to adopt Shenandoah. This change is to propose an optimization for the code path of mutator memory allocation to improve heap lock contention, at vey high level, here is how it works: > * ShenandoahFreeSet holds a N (default to 13) number of ShenandoahHeapRegion* which are used by mutator threads for regular object allocations, they are called shared regions/directly allocatable regions, which are stored in PaddedEnd data structure(padded array). > * Each mutator thread will be assigned one of the directly allocatable regions, the thread will try to allocate in the directly allocatable region with CAS atomic operation, if fails will try 2 more consecutive directly allocatable regions in the array storing directly allocatable region. > * If mutator thread fails after trying 3 directly allocatable regions, it will: > * Take heap lock > * Try to retire the directly allocatable regions which are ready to retire. > * Iterator mutator partition and allocate directly allocatable regions and store to the padded array if any need to be retired. > * Satisfy mutator allocation request if possible. > > > I'm not expecting significant performance impact for most of the cases since in most case the contention on heap lock it not high enough to cause performance issue, I have done many tests, here are some of them: > > 1. Dacapo lusearch test on EC2 host with 96 CPU cores: > Openjdk TIP: > > [ec2-user at ip-172-31-42-91 jdk]$ ./master-jdk/bin/java -XX:-TieredCompilation -XX:+AlwaysPreTouch -Xms4G -Xmx4G -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-ShenandoahUncommit -XX:ShenandoahGCMode=generational -XX:+UseTLAB -jar ~/tools/dacapo/dacapo-23.11-MR2-chopin.jar -n 10 lusearch | grep "metered full smoothing" > ===== DaCapo tail latency, metered full smoothing: 50% 131684 usec, 90% 200192 usec, 99% 211369 usec, 99.9% 212517 usec, 99.99% 213043 usec, max 235289 usec, measured over 524288 events ===== > ===== DaCapo tail latency, metered full smoothing: 50% 1568 usec, 90% 36101 usec, 99% 42172 usec, 99.9% 42928 usec, 99.99% 43100 usec, max 43305 usec, measured over 524288 events ===== > ===== DaCapo tail latency, metered full smoothing: 50% 52644 usec, 90% 124393 usec, 99% 137711 usec, 99.9% 139355 usec, 99.99% 139749 usec, max 146722 usec, measured over 524288 events ====... Xiaolong Peng has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 134 commits: - Merge branch 'openjdk:master' into cas-alloc-1 - format - Merge branch 'openjdk:master' into cas-alloc-1 - Merge branch 'openjdk:master' into cas-alloc-1 - Merge branch 'master' into cas-alloc-1 - Move ShenandoahHeapRegionIterationClosure to shenandoahFreeSet.hpp - Merge branch 'openjdk:master' into cas-alloc-1 - Fix errors caused by renaming ofAtomic to AtomicAccess - Merge branch 'openjdk:master' into cas-alloc-1 - Remove unused flag - ... and 124 more: https://git.openjdk.org/jdk/compare/79bcc7b8...14943e56 ------------- Changes: https://git.openjdk.org/jdk/pull/26171/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26171&range=03 Stats: 735 lines in 16 files changed: 674 ins; 7 del; 54 mod Patch: https://git.openjdk.org/jdk/pull/26171.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26171/head:pull/26171 PR: https://git.openjdk.org/jdk/pull/26171 From kdnilsen at openjdk.org Wed Oct 8 16:57:13 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Wed, 8 Oct 2025 16:57:13 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v21] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: fix test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/4db0cbe4..6c48bf10 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=20 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=19-20 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From kdnilsen at openjdk.org Wed Oct 8 16:57:17 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Wed, 8 Oct 2025 16:57:17 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v14] In-Reply-To: References: Message-ID: On Fri, 3 Oct 2025 21:49:52 GMT, Kelvin Nilsen wrote: >> Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: >> >> simplify implementation of promote_in_place > > src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp line 71: > >> 69: // Usage >> 70: >> 71: volatile size_t _used; > > Get rid of this. no longer needed. (search for volatile, most should go.) > > do we need _max_capacity? probably not. Done. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2414473715 From wkemper at openjdk.org Wed Oct 8 17:43:04 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 8 Oct 2025 17:43:04 GMT Subject: RFR: 8264851: Shenandoah: Rework control loop mechanics to use timed waits [v2] In-Reply-To: References: Message-ID: > We use a similar mechanism in `shGenerationalControlThread` already. Using a timed wait allows the control thread to be woken up before the wait expires. William Kemper 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 three additional commits since the last revision: - Merge remote-tracking branch 'jdk/master' into use-timed-wait-for-control-thread - Add documentation and make new method private - Use timed wait/notify for more timely control thread reactions ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27502/files - new: https://git.openjdk.org/jdk/pull/27502/files/73c1849a..fd47d57f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27502&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27502&range=00-01 Stats: 22555 lines in 759 files changed: 13114 ins; 5271 del; 4170 mod Patch: https://git.openjdk.org/jdk/pull/27502.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27502/head:pull/27502 PR: https://git.openjdk.org/jdk/pull/27502 From wkemper at openjdk.org Wed Oct 8 17:51:36 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 8 Oct 2025 17:51:36 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v21] In-Reply-To: References: Message-ID: On Wed, 8 Oct 2025 16:57:13 GMT, Kelvin Nilsen wrote: >> This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. >> Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. >> >> This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. >> >> The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. > > Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: > > fix test This is a tremendous simplification. ------------- Marked as reviewed by wkemper (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/26867#pullrequestreview-3315903968 From kdnilsen at openjdk.org Wed Oct 8 18:04:35 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Wed, 8 Oct 2025 18:04:35 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v22] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: fix override declaration ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/6c48bf10..6ec50218 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=21 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=20-21 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From kdnilsen at openjdk.org Wed Oct 8 18:04:38 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Wed, 8 Oct 2025 18:04:38 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v14] In-Reply-To: References: Message-ID: On Wed, 8 Oct 2025 16:50:52 GMT, Kelvin Nilsen wrote: >> src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp line 71: >> >>> 69: // Usage >>> 70: >>> 71: volatile size_t _used; >> >> Get rid of this. no longer needed. (search for volatile, most should go.) >> >> do we need _max_capacity? probably not. > > Done. removed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2414627504 From wkemper at openjdk.org Wed Oct 8 18:05:08 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 8 Oct 2025 18:05:08 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v3] In-Reply-To: References: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> Message-ID: On Tue, 7 Oct 2025 23:46:15 GMT, Kelvin Nilsen wrote: >> I called the complementary method `get_live_bytes_in_tenurable_regions`. How about `get_live_bytes_in_untenurable_regions`? > > I'm still maybe a bit confused. Is it get_untenurable_live_bytes_in_young_regions()? Are we distinguishing? > > So we have a total of N live bytes within young regions that have been placed into the collection set. We expect that P bytes (P < N) will be promoted, and the remaining S bytes (S + P == N) will be evacuated to "survivor space" within young. > > Does get_live_bytes_in_untenurable_regions() equal P + S? The _tenure_ here refers to the regions the objects reside in, not the objects themselves. `get_live_bytes_in_tenurable_regions` is the sum of live bytes in all regions with an age above the tenuring threshold (we expect to promote _all_ of these, though some promotions may fail). It's complement `get_live_bytes_in_untenurable_regions` is the sum of live bytes in all regions with an age less than the tenuring threshold (we expect to promote _some_ of these, but we don't really know how many). This was part of the reason I wanted to rename these methods. They represent the provenance of the objects in the collection set, not necessarily the regions they will be evacuated to. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2414631193 From wkemper at openjdk.org Wed Oct 8 18:16:28 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 8 Oct 2025 18:16:28 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v4] In-Reply-To: <7xGe1GZZMDQlU380bkZlAGkgMsI-Q_jRD6qSVJrM664=.640873a9-2c9d-4297-b64b-ec74c7819442@github.com> References: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> <7xGe1GZZMDQlU380bkZlAGkgMsI-Q_jRD6qSVJrM664=.640873a9-2c9d-4297-b64b-ec74c7819442@github.com> Message-ID: On Tue, 7 Oct 2025 23:41:53 GMT, Kelvin Nilsen wrote: >> In `compute_evacuation_reserves` we are setting the promotion reserve to the maximum possible to handle everything tenurable this cycle (this is still capped by the maximum evacuation reserve for old). I was reluctant to scale the promotion reserve by `ShenandoahPromoEvacWaste` for fear it would over commit the collector's reserves and lead to OOM errors during evacuation. > > So in the new design, we have full awareness of all promotable objects, and we've already done our best to budget for those. So there's no such thing as "unanticipated promotions". > > Separate question is whether we scale promotion reserve by ShenandoahPromoEvacWaste. So if old is larger than necessary to handle the anticipated mixed evacuations and promotions, the new code is essentially saying "use this extra space for mixed evacuations rather than for promotions". Since we're not expanding the promoted_reserve, promotions will not be allowed to touch it. > > Am I understanding the intent correctly? In `compute_evacuation_budgets`, if there are mixed collection candidates we set the initial promotion reserve to zero and the old evacuation reserve to the maximum. However, we then restrict old evacuation reserve to only empty regions. The difference between `old available` and `old unaffiliated` is given to the promotion reserve. Here again, I didn't want to scale the promotion reserve because it's basically the scraps of the old generation and I worry about over committing the old reserve. When there are no mixed collections, we use the entirety of old for promotions. Any old regions not needed for old evacuations or promotions are transferred to the young generation as they were before this change. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2414656521 From wkemper at openjdk.org Wed Oct 8 18:17:32 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 8 Oct 2025 18:17:32 GMT Subject: Integrated: 8264851: Shenandoah: Rework control loop mechanics to use timed waits In-Reply-To: References: Message-ID: <2UuiyrNOm1teK24_RgKvp0t4811KGAkJ4k5e3g_P0yE=.1b04d645-5f2d-43e3-b6a3-a91fd12ab714@github.com> On Thu, 25 Sep 2025 20:35:59 GMT, William Kemper wrote: > We use a similar mechanism in `shGenerationalControlThread` already. Using a timed wait allows the control thread to be woken up before the wait expires. This pull request has now been integrated. Changeset: 92f2ab2e Author: William Kemper URL: https://git.openjdk.org/jdk/commit/92f2ab2e1b5a7c02ea6d3a3a07c7fbbfc725cdea Stats: 28 lines in 2 files changed: 18 ins; 6 del; 4 mod 8264851: Shenandoah: Rework control loop mechanics to use timed waits Reviewed-by: kdnilsen, shade ------------- PR: https://git.openjdk.org/jdk/pull/27502 From kdnilsen at openjdk.org Wed Oct 8 18:33:15 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Wed, 8 Oct 2025 18:33:15 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v23] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: fix anothr override declaration ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/6ec50218..4c3c38bc Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=22 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=21-22 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From wkemper at openjdk.org Wed Oct 8 18:53:22 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 8 Oct 2025 18:53:22 GMT Subject: RFR: 8369447: GenShen: Regulator thread may observe inconsistent states Message-ID: <5Qa66lljxDIXH8mOo9oyCZTDjZ2OyhgHsurqkfKKhGY=.a784a918-bb7b-4a86-bad6-195ee1800650@github.com> Shenandoah's generational mode runs a separate thread to monitor the heap during old collections. This thread is responsible for deciding to start collections. When the thread which actually runs collections (the control thread) changes the state of various gc components _on a safepoint_, it has the expectation that these changes will become visible to mutator threads atomically, and consistently. However, the regulator thread does not participate in safepoints and may observe gc components in inconsistent states and so make incorrect choices about trying to start GC cycles. For example: # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp:625), pid=3796044, tid=3796163 # assert(_old_generation->state() == ShenandoahOldGeneration::MARKING) failed: Unexpected old gen state: Waiting for Bootstrap # The solution here is to make the regulator thread participate in safepoints. There is no need for it to run during a safepoint. ------------- Commit messages: - Merge remote-tracking branch 'jdk/master' into suspend-regulator-thread - Suspend regulator thread during safepoints Changes: https://git.openjdk.org/jdk/pull/27702/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27702&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8369447 Stats: 3 lines in 1 file changed: 3 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27702.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27702/head:pull/27702 PR: https://git.openjdk.org/jdk/pull/27702 From jrose at openjdk.org Wed Oct 8 19:02:44 2025 From: jrose at openjdk.org (John R Rose) Date: Wed, 8 Oct 2025 19:02:44 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library In-Reply-To: References: Message-ID: On Thu, 2 Oct 2025 07:11:51 GMT, Kim Barrett wrote: > Please review this change to the HotSpot Style Guide to suggest that C++ > Standard Library components may be used, after appropriate vetting and > discussion, rather than just a blanket "no, don't use it" with a few very > narrow exceptions. It provides some guidance on that vetting process and > the criteria to use, along with usage patterns. > > In particular, it proposes that Standard Library headers should not be > included directly, but instead through HotSpot-provided wrapper headers. This > gives us a place to document usage, provide workarounds for platform issues in > a single place, and so on. > > Such wrapper headers are provided by this PR for ``, ``, and > ``, along with updates to use them. I have a separate change for > `` that I plan to propose later, under JDK-8369187. There will be > additional followups for other C compatibility headers besides ``. > > This PR also cleans up some nomenclature issues around forbid vs exclude and > the like. > > Testing: mach5 tier1-5, GHA sanity tests I like where this is going. Thanks for putting in the hard work to make it happen. doc/hotspot-style.md line 629: > 627: occur. The C++98/03 `std::allocator` class is too limited to support our > 628: usage. But changes to the allocator concept in more recent Standards removed > 629: some of the limitations, supporting statefull allocators. HotSpot may, in the s/statefull/stateful/ doc/hotspot-style.md line 647: > 645: using those names easier, since the qualifiers don't need to be included. But > 646: there are reasons not to do that. > 647: s/reasons/several reasons/ (to better tee up the following bullet list) doc/hotspot-style.md line 651: > 649: headers may be included, adding to the list of names being used. Also, > 650: future versions of the Standard Library may add currently unknown names to > 651: the headers already being included. Maybe mention the `assert` macro at the end of the bullet, if there is no other example of a previous name collision: > ?already being included. (We already have a conflict from the HotSpot `assert` macro, although in that case the `std::` prefix is not applicable.) doc/hotspot-style.md line 1971: > 1969: > 1970: * `` > 1971: To continue the roll of rationale, for `chrono` etc., here are some suggestions which I am just pulling out of my back pocket: "HotSpot has its own timing support APIs." "Initializer lists are an advanced C++ API feature which have surprising interactions with other initialization syntaxes in use in HotSpot." "HotSpot uses floating point numbers, which are more portable and have more predictable performance characteristics than rational arithmetic." "HotSpot has its own mechanisms for managing errors." src/hotspot/share/code/relocInfo.cpp line 29: > 27: #include "code/nmethod.hpp" > 28: #include "code/relocInfo.hpp" > 29: #include "cppstdlib/type_traits.hpp" (I really, really like this scheme of wrapper headers for std stuff. Thanks Kim!) src/hotspot/share/cppstdlib/cstddef.hpp line 34: > 32: // * std::max_align_t, std::nullptr_t > 33: // * size_t (preferred) and std::size_t > 34: // * ptrdiff_t (preferred) and std::ptrdiff_t Are we 100% sure that `size_t` and `ptrdiff_t` will always be the `std` versions, on all platforms? If not, uses of `std::size_t` and `std::ptrdiff_t` might turn out to be portability problems. ?Should I worry that `std::size_t` and `size_t` might be different types on some weirdo platform?? Maybe we should do a static-assert that those two names refer to the same type. Then we can prove that the `std::` prefix will never cause the meaning of `size_t` to shift, on any platform. I'm being a little paranoid here about possible failure modes specifically for `size_t`, specifically because `size_t` is so pervasive and sensitive to type bugs. ------------- Changes requested by jrose (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27601#pullrequestreview-3315881937 PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2414655528 PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2414658231 PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2414716232 PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2414719117 PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2414738762 PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2414746409 From jrose at openjdk.org Wed Oct 8 19:02:45 2025 From: jrose at openjdk.org (John R Rose) Date: Wed, 8 Oct 2025 19:02:45 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library In-Reply-To: References: <8yuoztJS9xFrnxl2LHCptA8HtSU8dpXiifFrRTaHIOE=.010c05ff-3bbf-41f5-8a85-63f2dc1e0fa3@github.com> Message-ID: On Wed, 8 Oct 2025 13:48:09 GMT, Kim Barrett wrote: >> doc/hotspot-style.md line 1658: >> >>> 1656: to anonymous heterogeneous sequences. In particular, a standard-layout >>> 1657: class is preferred to a tuple. >>> 1658: >> >> I gave this feedback offline, but I'll record it here as well. I think that the tuple section should go to the undecided section. >> >> I understand the wish to go with named classes, and I often prefer that as well, but I also see that people often refrain from doing using them various reasons and instead use out-parameters or mix return values into one primitive. I don't want to fully close the door on this feature, and would like us to put this in the undecided (yes, still implicitly forbidden) section. To me that signals that we can at least experiment with it to see if it makes sense to sometimes use it (and if it does we can bring that back for discussion). Whereas outright forbidding it puts a stake in the ground and tells the story that we really shouldn't be looking at tuples. I think that's a too strong of a statement. > > I have a different take on the distinction between forbidden and undecided. I > think of forbidden features as being those where there are good arguments > against. Whereas I think of undecided as perhaps having wishy washy arguments > in either direction, or even not seriously thought about. But good arguments > against can be overcome by better arguments in favor. > > But I can see how someone else might take that distinction differently. > > I also admit to being somewhat biased against tuple in particular. I've seen > a few pretty terrible uses... one was even my fault! > > So okay, I'll recategorize tuple. I'm OK with cracking the door open on tuple, but I have to say I do like API-specific names very much. (And `fst`/`snd` or whatever are not API specific; they are tuple-specific!) So the guidance that steers folks towards name-based techniques, instead of positional techniques, is still sound. I even like out-args, personally, in cases where the out-arg is for a return value that is clearly secondary to the main return value. Example: Main value is boolean, and out-arg is some hint about why the main value is what it is, like a position. The out-arg can also be optional if a null pointer is tolerated (explicitly documented as such, of course), which is useful when the out-arg costs extra to compute. (A separate boolean arg is OK for such uses also, but null pointers are so darn useful as optionality sentinels!) Note that our TRAPS/THREAD macro system can be viewed as a giant set of out-args. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2414737272 From wkemper at openjdk.org Wed Oct 8 19:33:10 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 8 Oct 2025 19:33:10 GMT Subject: RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure Message-ID: There are certain code paths in Shenandoah's generational mode that need to _know_ which generation is being collected, but it is not possible to pass this information on the stack (barriers, for example). To address this, we introduced an `_active_generation` member in `ShenandoahHeap`. Over time, the usage of this field grew beyond its intended purpose and we began to have issues where not all threads would see a consistent value for this field. To address _this_ issue, we added another field `_gc_generation` which was only meant to be used by GC threads. At this point, we have three different ways to determine which generation is being collected: the _active_ generation, the _gc_ generation, and the usual function parameters and member fields of the gc components. This PR removes `_gc_generation` and reduces the use of `_active_generation` to only those places where it is not possible to get this information from other means (barriers, mostly). All GC components that can have this information passed through function calls, now do so. ------------- Commit messages: - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage - Remove _gc_generation from ShenandoahHeap - Little cleanup, remove one active generation usage - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage - Finish removing usages of gc_generation, start on reducing usages of active_generation - Fix build - Use existing _generation field instead of Heap::_gc_generation where possible - Only shenandoah vm operations participate in active/gc generation scheme Changes: https://git.openjdk.org/jdk/pull/27703/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27703&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8369068 Stats: 495 lines in 32 files changed: 119 ins; 149 del; 227 mod Patch: https://git.openjdk.org/jdk/pull/27703.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27703/head:pull/27703 PR: https://git.openjdk.org/jdk/pull/27703 From kbarrett at openjdk.org Thu Oct 9 00:55:10 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Thu, 9 Oct 2025 00:55:10 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library In-Reply-To: References: Message-ID: <0_An3HGn6Xd-zcB-53QaFn5tfq7u4CFIQAr1srQAjOY=.bf4127ac-a6c4-4c42-a9e4-ae24df62bfe3@github.com> On Wed, 8 Oct 2025 18:12:44 GMT, John R Rose wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > doc/hotspot-style.md line 629: > >> 627: occur. The C++98/03 `std::allocator` class is too limited to support our >> 628: usage. But changes to the allocator concept in more recent Standards removed >> 629: some of the limitations, supporting statefull allocators. HotSpot may, in the > > s/statefull/stateful/ Fixed locally for next push. > doc/hotspot-style.md line 647: > >> 645: using those names easier, since the qualifiers don't need to be included. But >> 646: there are reasons not to do that. >> 647: > > s/reasons/several reasons/ (to better tee up the following bullet list) Fixed locally for next push. > doc/hotspot-style.md line 651: > >> 649: headers may be included, adding to the list of names being used. Also, >> 650: future versions of the Standard Library may add currently unknown names to >> 651: the headers already being included. > > Maybe mention the `assert` macro at the end of the bullet, if there is no other example of a previous name collision: > >> ?already being included. (We already have a conflict from the HotSpot `assert` macro, although in that case the `std::` prefix is not applicable.) There aren't any previous examples because we don't have any examples of doing this thing that we're warning against (`using` a namespace). `assert` is a different problem, unrelated to namespaces. (Remember that one of the usual knocks against macros is that they don't respect namespaces.) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2415313253 PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2415313425 PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2415313670 From ysr at openjdk.org Thu Oct 9 02:13:09 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Thu, 9 Oct 2025 02:13:09 GMT Subject: RFR: 8367646: [GenShen] Control thread may overwrite gc cancellation cause set by mutator In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 22:00:01 GMT, William Kemper wrote: > I believe the following events could lead to this assertion failure: > 1. Control thread reads the heap's gc cancellation cause as `shenandoah_concurrent_gc` > 2. Mutator thread has an allocation failure and sets the heap's gc cancellation cause to `shenandoah_alloc_failure` > 3. Control thread uses stale value from `1` and decides to unconditionally clear the cancellation cause > 4. Mutator thread assert that gc is still cancelled > > The proposed fix here has the control thread use a CAS operation to only clear the gc if the existing value is `shenandoah_concurrent_gc`. This will stop the control thread from erroneously changing the value if a mutator has already set it to `shenandoah_alloc_failure`. A mutator thread may still have an allocation failure after the control thread has cleared the cancellation, but this is normal and expected. Left some comments that may simplify `clear_cancelled_gc()` slightly (improving comprehension complexity a bit). I see that there is a longish comment about the evac oom handler. It might be worthwhile where the counters are cleared to explain when we are safe to clear the counnters. (May be it's explained somewhere in the block comment in `shenandoahEvacOOMHandler.hpp` class definition but it wasn't obvious when the clearing is safe.) src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp line 116: > 114: if (request.cause == GCCause::_shenandoah_concurrent_gc) { > 115: request.generation = _heap->young_generation(); > 116: _heap->clear_cancelled_gc(false); It appears as if this was the _only_ case where `clear_cancelled_gc()` was called while not clearing the oom_handler. Should `clear_cancelled_gc()` be modified by removing the option/argument for clearing or not the oom_handler? src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp line 459: > 457: inline GCCause::Cause cancelled_cause() const; > 458: > 459: // Clears the cancellation cause and optionally resets the oom handler (cancelling an See comment above re "optional reset of oom handler" etc. related simplication. ------------- Marked as reviewed by ysr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27662#pullrequestreview-3316976435 PR Review Comment: https://git.openjdk.org/jdk/pull/27662#discussion_r2415375564 PR Review Comment: https://git.openjdk.org/jdk/pull/27662#discussion_r2415376309 From ysr at openjdk.org Thu Oct 9 02:25:00 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Thu, 9 Oct 2025 02:25:00 GMT Subject: RFR: 8368501: Shenandoah: GC progress evaluation does not use generation In-Reply-To: References: Message-ID: On Mon, 29 Sep 2025 21:24:58 GMT, William Kemper wrote: > Remove unused `generation` parameter from stop-the-world GC progress evaluation. Also, have `shMetrics` use the freeset for `usage` details. This is a follow up to a comment from an unrelated PR: https://github.com/openjdk/jdk/pull/27456#issuecomment-3325724362. Nice cleanup, thanks! ------------- Marked as reviewed by ysr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27561#pullrequestreview-3317009418 From ysr at openjdk.org Thu Oct 9 02:31:12 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Thu, 9 Oct 2025 02:31:12 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v23] In-Reply-To: References: Message-ID: On Wed, 8 Oct 2025 18:33:15 GMT, Kelvin Nilsen wrote: >> This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. >> Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. >> >> This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. >> >> The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. > > Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: > > fix anothr override declaration Will pick this up in a bit but thought I should flush the comments (which I already made in verbal form earlier today at one of our meetings). Sorry for the delay on this, but on it now and will get it done later tonight. ------------- PR Review: https://git.openjdk.org/jdk/pull/26867#pullrequestreview-3316341505 From ysr at openjdk.org Thu Oct 9 02:31:15 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Thu, 9 Oct 2025 02:31:15 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v23] In-Reply-To: <5UAnGN3TiTYZSVcLUKLq-WIrpi3_h6rBAMhdcer6lxQ=.6b299e43-1166-4dc6-b258-3c3b30b5d292@github.com> References: <5UAnGN3TiTYZSVcLUKLq-WIrpi3_h6rBAMhdcer6lxQ=.6b299e43-1166-4dc6-b258-3c3b30b5d292@github.com> Message-ID: <56BKWUn6QrR08Yus8f-M-SF3fUT-gjzNDEfUkmOAsok=.b0345ab1-cb3f-4b9a-b741-0bf437f9885d@github.com> On Tue, 7 Oct 2025 21:58:02 GMT, Kelvin Nilsen wrote: >> src/hotspot/share/gc/shared/gc_globals.hpp line 472: >> >>> 470: product(size_t, SoftMaxHeapSize, 0, MANAGEABLE, \ >>> 471: "Soft limit for maximum heap size (in bytes)") \ >>> 472: constraint(SoftMaxHeapSizeConstraintFunc,AfterMemoryInit) \ >> >> Changing a common file might raise eyebrows. Why do we need this? > > ShenandoahHeap::initialize() makes use of SoftMaxHeapSize. If the SoftMaxHeapSizeConstraintFunc is handled "after memory init", the value of SoftMaxHeapSize is not yet available when we try to use it. > > I welcome an alternative approach if you have any ideas. Did all tests pass, in particular `TestSoftMaxHeapSize`? The test now happens earlier. I am not sure why the value itself isn't available before, like you say. I am guessing you want to check the value after whatever adjustments have been made in `initialize()`? The value of the flag should be available already, irrespective of when the constraints check is done. enum class JVMFlagConstraintPhase : char { // Will be validated during argument processing (Arguments::parse_argument). AtParse = 0, // Will be validated inside Threads::create_vm(), right after Arguments::apply_ergo(). AfterErgo = 1, // Will be validated inside universe_init(), right after Metaspace::global_initialize(). AfterMemoryInit = 2 }; ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2414911580 From ysr at openjdk.org Thu Oct 9 02:31:16 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Thu, 9 Oct 2025 02:31:16 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v23] In-Reply-To: <56BKWUn6QrR08Yus8f-M-SF3fUT-gjzNDEfUkmOAsok=.b0345ab1-cb3f-4b9a-b741-0bf437f9885d@github.com> References: <5UAnGN3TiTYZSVcLUKLq-WIrpi3_h6rBAMhdcer6lxQ=.6b299e43-1166-4dc6-b258-3c3b30b5d292@github.com> <56BKWUn6QrR08Yus8f-M-SF3fUT-gjzNDEfUkmOAsok=.b0345ab1-cb3f-4b9a-b741-0bf437f9885d@github.com> Message-ID: On Wed, 8 Oct 2025 20:08:25 GMT, Y. Srinivas Ramakrishna wrote: >> ShenandoahHeap::initialize() makes use of SoftMaxHeapSize. If the SoftMaxHeapSizeConstraintFunc is handled "after memory init", the value of SoftMaxHeapSize is not yet available when we try to use it. >> >> I welcome an alternative approach if you have any ideas. > > Did all tests pass, in particular `TestSoftMaxHeapSize`? The test now happens earlier. I am not sure why the value itself isn't available before, like you say. I am guessing you want to check the value after whatever adjustments have been made in `initialize()`? The value of the flag should be available already, irrespective of when the constraints check is done. > > > enum class JVMFlagConstraintPhase : char { > // Will be validated during argument processing (Arguments::parse_argument). > AtParse = 0, > // Will be validated inside Threads::create_vm(), right after Arguments::apply_ergo(). > AfterErgo = 1, > // Will be validated inside universe_init(), right after Metaspace::global_initialize(). > AfterMemoryInit = 2 > }; In particular, in its current form, the test asks for the value to be <= MaxHeapSize, and ergo merely arranges to set it to MaxHeapSize, rendering any subsequent adjustments in `initialize()` to be not tested. (That in itself is perhaps OK, but we should probably check that other GCs are ok with moving the constraints check earlier. In particular, zGC adjusts the value in its initialize() and might _want_ the check later after its adjustments are done.) GCArguments::initialize_heap_flags_and_sizes(): ... if (FLAG_IS_DEFAULT(SoftMaxHeapSize)) { FLAG_SET_ERGO(SoftMaxHeapSize, MaxHeapSize); } ... ZArguments::initialize_heap_flags_and_sizes(): ... if (!FLAG_IS_CMDLINE(MaxHeapSize) && !FLAG_IS_CMDLINE(MaxRAMPercentage) && !FLAG_IS_CMDLINE(SoftMaxHeapSize)) { // We are really just guessing how much memory the program needs. // When that is the case, we don't want the soft and hard limits to be the same // as it can cause flakiness in the number of GC threads used, in order to keep // to a random number we just pulled out of thin air. FLAG_SET_ERGO(SoftMaxHeapSize, MaxHeapSize * 90 / 100); } ... I'm not convinced the change above to move the constraints check sooner is needed in order to _use_ the value of SoftMaxHeapSize in `ShenandoahHeap::initialize()`. What's the error you see without this change? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2414936050 From kdnilsen at openjdk.org Thu Oct 9 02:41:48 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Thu, 9 Oct 2025 02:41:48 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v24] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: revert change to SoftMaxHeapSizeConstraintFunc ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/4c3c38bc..9c2dc8bd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=23 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=22-23 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From kbarrett at openjdk.org Thu Oct 9 03:04:06 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Thu, 9 Oct 2025 03:04:06 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library In-Reply-To: References: Message-ID: On Wed, 8 Oct 2025 18:40:01 GMT, John R Rose wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > doc/hotspot-style.md line 1971: > >> 1969: >> 1970: * `` >> 1971: > > To continue the roll of rationale, for `chrono` etc., here are some suggestions which I am just pulling out of my back pocket: > > "HotSpot has its own timing support APIs." > "Initializer lists are an advanced C++ API feature which have surprising interactions with other initialization syntaxes in use in HotSpot." > "HotSpot uses floating point numbers, which are more portable and have more predictable performance characteristics than rational arithmetic." > "HotSpot has its own mechanisms for managing errors." I'll add some stuff to the PR change. > "HotSpot has its own timing support APIs." The argument for chrono is that our existing APIs aren't serving us well. chrono provides strong type safety. We've had multiple cases of mistakes like a double seconds being treated as double millis or vice versa, and other similar errors. But it would be a large effort to adopt chrono. And we'd need to decide whether to use the predefined clocks or hook up chrono to our clocks. It may be that using the predefined clocks is fine, but it's a question that needs careful study. > "Initializer lists are an advanced C++ API feature which have surprising > interactions with other initialization syntaxes in use in HotSpot." I think the trailing "in use in HotSpot" can be dropped from that. Mostly I think they are fine, but the potential ambiguity between some forms of direct initialization and initializer list initialization, and the resolution of that ambiguity, is unfortunate. > "HotSpot uses floating point numbers ..." Note that `` is a *compile-time* rational arithmetic package. It's also fixed (though parameterized) precision. It's not a general purpose rational arithmetic facility. My understanding is that it started life as a detail of chrono, and was extracted and promoted to a public facility in the belief that it has broader utility. > "HotSpot has its own mechanisms for managing errors." Well, no, we don't really. Or rather, we've got a plethora of bespoke ad hoc mechanisms. There's a bunch of discussion happening around that topic lately. I don't think we've coalesced around any particular approach yet. And even once we decided on something it's likely to take quite a while for rollout to really make use of whatever we settle on. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2415447980 From kbarrett at openjdk.org Thu Oct 9 03:37:05 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Thu, 9 Oct 2025 03:37:05 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library In-Reply-To: References: Message-ID: <7WSKAc7KY9uAmaHcNeZoYVFqQ-0Ekq16_W4-BonyR1I=.5b14e9f6-cce5-4993-8d03-a382044b5806@github.com> On Wed, 8 Oct 2025 18:52:20 GMT, John R Rose wrote: > Are we 100% sure ... Yes. > Should I worry ... No. https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2340r0.html Clarifying the status of the "C headers" On the basis of that paper, C++23 undeprecated the C headers (they'd been deprecated since C++98) and gave them their own section in the main body of the standard, rather than being relegated to an appendix. The guidance is that a C++ source file should only include C headers if the file also needs to be valid C source. I'm planning to nudge us in that direction, except by using our own wrapper headers, like cppstdlib/cstddef.hpp. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2415481626 From kbarrett at openjdk.org Thu Oct 9 04:07:02 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Thu, 9 Oct 2025 04:07:02 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v2] In-Reply-To: References: Message-ID: > Please review this change to the HotSpot Style Guide to suggest that C++ > Standard Library components may be used, after appropriate vetting and > discussion, rather than just a blanket "no, don't use it" with a few very > narrow exceptions. It provides some guidance on that vetting process and > the criteria to use, along with usage patterns. > > In particular, it proposes that Standard Library headers should not be > included directly, but instead through HotSpot-provided wrapper headers. This > gives us a place to document usage, provide workarounds for platform issues in > a single place, and so on. > > Such wrapper headers are provided by this PR for ``, ``, and > ``, along with updates to use them. I have a separate change for > `` that I plan to propose later, under JDK-8369187. There will be > additional followups for other C compatibility headers besides ``. > > This PR also cleans up some nomenclature issues around forbid vs exclude and > the like. > > Testing: mach5 tier1-5, GHA sanity tests Kim Barrett has updated the pull request incrementally with two additional commits since the last revision: - jrose comments - move tuple to undecided category ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27601/files - new: https://git.openjdk.org/jdk/pull/27601/files/98e7ccbb..c886ec36 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27601&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27601&range=00-01 Stats: 78 lines in 2 files changed: 55 ins; 8 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/27601.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27601/head:pull/27601 PR: https://git.openjdk.org/jdk/pull/27601 From kbarrett at openjdk.org Thu Oct 9 08:40:32 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Thu, 9 Oct 2025 08:40:32 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v2] In-Reply-To: References: <8yuoztJS9xFrnxl2LHCptA8HtSU8dpXiifFrRTaHIOE=.010c05ff-3bbf-41f5-8a85-63f2dc1e0fa3@github.com> Message-ID: On Wed, 8 Oct 2025 13:23:09 GMT, Kim Barrett wrote: >> src/hotspot/share/utilities/tuple.hpp line 2: >> >>> 1: /* >>> 2: * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved. >> >> So we have our own tuple ... > > We have our own baby partial tuple. What's there is more like a heterogeneous > array with compile-time indexing. It's used for one thing, and provides just > enough functionality for that use. I'm not entirely convinced it's the right > tool for the job, though I haven't taken the time to work out alternatives. I looked at the use of Tuple<...>. I think using named structs with named members would be an improvement. Eliminates questions like is src element 0 and dst element 1, or is it the other way around. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2416001474 From stefank at openjdk.org Thu Oct 9 09:15:33 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Thu, 9 Oct 2025 09:15:33 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v2] In-Reply-To: References: Message-ID: <4uDJA25Pz-Sxiy9kAtbOnUDSqe9h7b47d5AFYDv_ipQ=.e7d5060f-5261-4d77-8a9c-bfb75cdbbea8@github.com> On Thu, 9 Oct 2025 04:07:02 GMT, Kim Barrett wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > Kim Barrett has updated the pull request incrementally with two additional commits since the last revision: > > - jrose comments > - move tuple to undecided category Marked as reviewed by stefank (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27601#pullrequestreview-3317964481 From fweimer at openjdk.org Thu Oct 9 11:30:19 2025 From: fweimer at openjdk.org (Florian Weimer) Date: Thu, 9 Oct 2025 11:30:19 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v2] In-Reply-To: References: Message-ID: On Thu, 9 Oct 2025 04:07:02 GMT, Kim Barrett wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > Kim Barrett has updated the pull request incrementally with two additional commits since the last revision: > > - jrose comments > - move tuple to undecided category doc/hotspot-style.md line 567: > 565: > 566: Functions that may throw exceptions must not be used. This is in accordance > 567: with the HotSpot policy of [not using exceptions](#error-handling). In the GCC implementation, destructor registration may throw `__gnu_cxx::recursive_init_error` (via the `__cxa_guard_acquire` Itanium ABI function). Are global or static objects with non-trivial destructors permitted? I think there are a couple of such uses today. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2416467456 From kbarrett at openjdk.org Thu Oct 9 12:18:38 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Thu, 9 Oct 2025 12:18:38 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v2] In-Reply-To: References: Message-ID: <6u0Ia6A2xQnv51Ti0Jchg6rnncfRRvtK5oGS963CeIA=.bc9c1481-60ad-443d-923b-dc86277dbb14@github.com> On Thu, 9 Oct 2025 11:27:26 GMT, Florian Weimer wrote: >> Kim Barrett has updated the pull request incrementally with two additional commits since the last revision: >> >> - jrose comments >> - move tuple to undecided category > > doc/hotspot-style.md line 567: > >> 565: >> 566: Functions that may throw exceptions must not be used. This is in accordance >> 567: with the HotSpot policy of [not using exceptions](#error-handling). > > In the GCC implementation, destructor registration may throw `__gnu_cxx::recursive_init_error` (via the `__cxa_guard_acquire` Itanium ABI function). Are global or static objects with non-trivial destructors permitted? I think there are a couple of such uses today. We (you and me, @fweimer-rh) discussed this a couple of years ago: https://mail.openjdk.org/pipermail/hotspot-dev/2023-December/082324.html Quoting from here: https://mail.openjdk.org/pipermail/hotspot-dev/2023-December/083142.html " Empirically, a recursive initialization attempt doesn't make any attempt to throw. Rather, it blocks forever waiting for a futex signal from a thread that succeeds in the initialization. Which of course will never come. And that makes sense, now that I've looked at the code. In __cxa_guard_acquire, with _GLIBCXX_USE_FUTEX, if the guard indicates initialization hasn't yet been completed, then it goes into a while loop. This while loop tries to claim initialization. Failing that, it checks whether initialization is complete. Failing that, it does a SYS_futex syscall, waiting for some other thread to perform the initialization. There's nothing there to check for recursion. throw_recursive_init_exception is only called if single-threaded (either by configuration or at runtime). " It doesn't look like there have been any relevant changes in that area since then. So I think there is still not a problem here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2416593903 From kdnilsen at openjdk.org Thu Oct 9 15:38:31 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Thu, 9 Oct 2025 15:38:31 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v25] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: clamp SoftMaxHeapSize during initialization ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/9c2dc8bd..9b36ee38 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=24 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=23-24 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From wkemper at openjdk.org Thu Oct 9 18:23:17 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 9 Oct 2025 18:23:17 GMT Subject: RFR: 8367646: [GenShen] Control thread may overwrite gc cancellation cause set by mutator [v2] In-Reply-To: References: Message-ID: > I believe the following events could lead to this assertion failure: > 1. Control thread reads the heap's gc cancellation cause as `shenandoah_concurrent_gc` > 2. Mutator thread has an allocation failure and sets the heap's gc cancellation cause to `shenandoah_alloc_failure` > 3. Control thread uses stale value from `1` and decides to unconditionally clear the cancellation cause > 4. Mutator thread assert that gc is still cancelled > > The proposed fix here has the control thread use a CAS operation to only clear the gc if the existing value is `shenandoah_concurrent_gc`. This will stop the control thread from erroneously changing the value if a mutator has already set it to `shenandoah_alloc_failure`. A mutator thread may still have an allocation failure after the control thread has cleared the cancellation, but this is normal and expected. William Kemper has updated the pull request incrementally with one additional commit since the last revision: Fix cancellation time management, simplify normal cancellation API ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27662/files - new: https://git.openjdk.org/jdk/pull/27662/files/d9697d83..b3a96523 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27662&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27662&range=00-01 Stats: 23 lines in 5 files changed: 8 ins; 2 del; 13 mod Patch: https://git.openjdk.org/jdk/pull/27662.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27662/head:pull/27662 PR: https://git.openjdk.org/jdk/pull/27662 From wkemper at openjdk.org Thu Oct 9 18:23:18 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 9 Oct 2025 18:23:18 GMT Subject: RFR: 8367646: [GenShen] Control thread may overwrite gc cancellation cause set by mutator [v2] In-Reply-To: References: Message-ID: <7BoGRpmSZdCjG9_UU0rXLPsE-kuqVItzKJf-cg6zABA=.f64b879b-2f00-464b-98f7-f358a8c5920e@github.com> On Thu, 9 Oct 2025 01:55:52 GMT, Y. Srinivas Ramakrishna wrote: >> William Kemper has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix cancellation time management, simplify normal cancellation API > > src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp line 116: > >> 114: if (request.cause == GCCause::_shenandoah_concurrent_gc) { >> 115: request.generation = _heap->young_generation(); >> 116: _heap->clear_cancelled_gc(false); > > It appears as if this was the _only_ case where `clear_cancelled_gc()` was called while not clearing the oom_handler. > > Should `clear_cancelled_gc()` be modified by removing the option/argument for clearing or not the oom_handler? Good catch. When fixing this, I also realized that the new `clear_cancellation` wasn't handling the `_cancel_requested_time` as it should. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27662#discussion_r2417607745 From wkemper at openjdk.org Thu Oct 9 18:28:21 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 9 Oct 2025 18:28:21 GMT Subject: Integrated: 8368501: Shenandoah: GC progress evaluation does not use generation In-Reply-To: References: Message-ID: On Mon, 29 Sep 2025 21:24:58 GMT, William Kemper wrote: > Remove unused `generation` parameter from stop-the-world GC progress evaluation. Also, have `shMetrics` use the freeset for `usage` details. This is a follow up to a comment from an unrelated PR: https://github.com/openjdk/jdk/pull/27456#issuecomment-3325724362. This pull request has now been integrated. Changeset: 501fa204 Author: William Kemper URL: https://git.openjdk.org/jdk/commit/501fa2041a77139a9ac42fef69f28b1fd50fee65 Stats: 79 lines in 4 files changed: 6 ins; 37 del; 36 mod 8368501: Shenandoah: GC progress evaluation does not use generation Reviewed-by: ysr ------------- PR: https://git.openjdk.org/jdk/pull/27561 From ysr at openjdk.org Thu Oct 9 23:38:04 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Thu, 9 Oct 2025 23:38:04 GMT Subject: RFR: 8367646: [GenShen] Control thread may overwrite gc cancellation cause set by mutator [v2] In-Reply-To: References: Message-ID: On Thu, 9 Oct 2025 18:23:17 GMT, William Kemper wrote: >> I believe the following events could lead to this assertion failure: >> 1. Control thread reads the heap's gc cancellation cause as `shenandoah_concurrent_gc` >> 2. Mutator thread has an allocation failure and sets the heap's gc cancellation cause to `shenandoah_alloc_failure` >> 3. Control thread uses stale value from `1` and decides to unconditionally clear the cancellation cause >> 4. Mutator thread assert that gc is still cancelled >> >> The proposed fix here has the control thread use a CAS operation to only clear the gc if the existing value is `shenandoah_concurrent_gc`. This will stop the control thread from erroneously changing the value if a mutator has already set it to `shenandoah_alloc_failure`. A mutator thread may still have an allocation failure after the control thread has cleared the cancellation, but this is normal and expected. > > William Kemper has updated the pull request incrementally with one additional commit since the last revision: > > Fix cancellation time management, simplify normal cancellation API LGTM! ------------- Marked as reviewed by ysr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27662#pullrequestreview-3320938162 From ysr at openjdk.org Thu Oct 9 23:47:05 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Thu, 9 Oct 2025 23:47:05 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v4] In-Reply-To: References: Message-ID: On Tue, 7 Oct 2025 22:32:56 GMT, William Kemper wrote: >> Notable changes: >> * Improvements to logging >> * More accurate tracking of promotion failures >> * Use shared allocation for promotions only when the size is above the maximum plab size (not the minimum size) >> * Use census information gathered during mark to size promotion reserves and old generation >> >> With these changes, GenShen is expected to have fewer promotion failures and this is indeed the case. As a result of this, we expect less time to be spent in concurrent marking and update refs for young collections. We may also expect shorter concurrent evacuation phases because GenShen will have fewer densely packed regions stuck in the young generation. With more objects being promoted, we also expect to see longer remembered set scan times. This is generally the case across all benchmarks, but we do also see some counter-intuitive results. >> >> Here we are comparing 20 executions (10 on x86, 10 on aarch64) of the changes in the PR (experiment) against 20 executions of the same benchmarks results from tip. This is a summary of statistically significant changes of more than 5% across all benchmarks: >> >> >> Concurrent Evacuation: 7 improvements, 3 regressions >> ? Best improvements: extremem-large-45g (-29.6%), neo4j-analytics (-26.9%) >> ? Worst regression: xalan (+53.7%) >> >> Concurrent Marking: 15 improvements, 1 regression >> ? Best improvements: hyperalloc_a2048_o4096 (-30.1%), crypto.rsa (-27.3%) >> ? Only regression: serial (+8.9%) >> >> Concurrent Scan Remembered Set: 7 improvements, 2 regressions >> ? Best improvements: xalan (-49.4%), pmd (-49.0%), crypto.rsa (-41.8%) >> ? Worst regression: extremem-phased (+52.4%) >> >> Concurrent Update Refs: 5 improvements, 4 regressions >> ? Best improvements: crypto.rsa (-36.4%), mnemonics (-28.4%) >> ? Worst regression: xalan (+89.4%) > > William Kemper has updated the pull request incrementally with one additional commit since the last revision: > > Review feedback, bug fixes > Here we are comparing 20 executions (10 on x86, 10 on aarch64) of the changes in the PR (experiment) against 20 executions of the same benchmarks results from tip. @earthling-amzn : Can the comparisons be done in each of the two classes, i.e. x86 and aarch64, separately? Not sure if it'll give more statistically significant differences between test and control. Was there any significant difference (on x86 or aarch64 separately) on SPECjbb? ------------- PR Comment: https://git.openjdk.org/jdk/pull/27632#issuecomment-3387799702 From wkemper at openjdk.org Fri Oct 10 00:19:13 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 10 Oct 2025 00:19:13 GMT Subject: Integrated: 8367646: [GenShen] Control thread may overwrite gc cancellation cause set by mutator In-Reply-To: References: Message-ID: On Mon, 6 Oct 2025 22:00:01 GMT, William Kemper wrote: > I believe the following events could lead to this assertion failure: > 1. Control thread reads the heap's gc cancellation cause as `shenandoah_concurrent_gc` > 2. Mutator thread has an allocation failure and sets the heap's gc cancellation cause to `shenandoah_alloc_failure` > 3. Control thread uses stale value from `1` and decides to unconditionally clear the cancellation cause > 4. Mutator thread assert that gc is still cancelled > > The proposed fix here has the control thread use a CAS operation to only clear the gc if the existing value is `shenandoah_concurrent_gc`. This will stop the control thread from erroneously changing the value if a mutator has already set it to `shenandoah_alloc_failure`. A mutator thread may still have an allocation failure after the control thread has cleared the cancellation, but this is normal and expected. This pull request has now been integrated. Changeset: d6e2d4eb Author: William Kemper URL: https://git.openjdk.org/jdk/commit/d6e2d4eb1f87016ab158b62c61c33c4bf92a0ed4 Stats: 32 lines in 6 files changed: 19 ins; 5 del; 8 mod 8367646: [GenShen] Control thread may overwrite gc cancellation cause set by mutator Reviewed-by: ysr, kdnilsen ------------- PR: https://git.openjdk.org/jdk/pull/27662 From dholmes at openjdk.org Fri Oct 10 05:46:05 2025 From: dholmes at openjdk.org (David Holmes) Date: Fri, 10 Oct 2025 05:46:05 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v2] In-Reply-To: References: Message-ID: On Thu, 9 Oct 2025 04:07:02 GMT, Kim Barrett wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > Kim Barrett has updated the pull request incrementally with two additional commits since the last revision: > > - jrose comments > - move tuple to undecided category > Are global or static objects with non-trivial destructors permitted? I think there are a couple of such uses today. It is discouraged but yes they exist and cause problems. I am currently fixing a bunch of issues due to static Semaphore instances. https://bugs.openjdk.org/browse/JDK-8361462 ------------- PR Comment: https://git.openjdk.org/jdk/pull/27601#issuecomment-3388368328 From jrose at openjdk.org Fri Oct 10 17:17:03 2025 From: jrose at openjdk.org (John R Rose) Date: Fri, 10 Oct 2025 17:17:03 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v2] In-Reply-To: References: Message-ID: On Thu, 9 Oct 2025 03:01:03 GMT, Kim Barrett wrote: >> doc/hotspot-style.md line 1971: >> >>> 1969: >>> 1970: * `` >>> 1971: >> >> To continue the roll of rationale, for `chrono` etc., here are some suggestions which I am just pulling out of my back pocket: >> >> "HotSpot has its own timing support APIs." >> "Initializer lists are an advanced C++ API feature which have surprising interactions with other initialization syntaxes in use in HotSpot." >> "HotSpot uses floating point numbers, which are more portable and have more predictable performance characteristics than rational arithmetic." >> "HotSpot has its own mechanisms for managing errors." > > I'll add some stuff to the PR change. > >> "HotSpot has its own timing support APIs." > > The argument for chrono is that our existing APIs aren't serving us well. > chrono provides strong type safety. We've had multiple cases of mistakes like > a double seconds being treated as double millis or vice versa, and other > similar errors. But it would be a large effort to adopt chrono. And we'd need > to decide whether to use the predefined clocks or hook up chrono to our > clocks. It may be that using the predefined clocks is fine, but it's a > question that needs careful study. > >> "Initializer lists are an advanced C++ API feature which have surprising >> interactions with other initialization syntaxes in use in HotSpot." > > I think the trailing "in use in HotSpot" can be dropped from that. Mostly I > think they are fine, but the potential ambiguity between some forms of direct > initialization and initializer list initialization, and the resolution of that > ambiguity, is unfortunate. > >> "HotSpot uses floating point numbers ..." > > Note that `` is a *compile-time* rational arithmetic package. It's also > fixed (though parameterized) precision. It's not a general purpose rational > arithmetic facility. My understanding is that it started life as a detail of > chrono, and was extracted and promoted to a public facility in the belief that > it has broader utility. > >> "HotSpot has its own mechanisms for managing errors." > > Well, no, we don't really. Or rather, we've got a plethora of bespoke ad hoc > mechanisms. There's a bunch of discussion happening around that topic lately. > I don't think we've coalesced around any particular approach yet. And even > once we decided on something it's likely to take quite a while for rollout to > really make use of whatever we settle on. I love a good nerd sniping! Thanks. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2421306579 From andrew at openjdk.org Fri Oct 10 18:26:42 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 10 Oct 2025 18:26:42 GMT Subject: RFR: Merge jdk8u:master Message-ID: Merge jdk8u472-b01 ------------- Commit messages: - Merge jdk8u472-b01 - Merge - 8081734: ConcurrentHashMap/ConcurrentAssociateTest.java, times out 90% of time on sparc with 256 cpu. - 8358538: Update GHA Windows runner to 2025 - 8044051: Test jdk/lambda/vm/InterfaceAccessFlagsTest.java gets IOException during compilation - 8312065: Socket.connect does not timeout when profiling - 8205653: test/jdk/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java and RmiSslBootstrapTest.sh fail with handshake_failure - 8228658: test GetTotalSafepointTime.java fails on fast Linux machines with Total safepoint time 0 ms - 8352302: Test sun/security/tools/jarsigner/TimestampCheck.java is failing - 8339414: Fix JDK-8202369 incorrect backport for 8u - ... and 4 more: https://git.openjdk.org/shenandoah-jdk8u/compare/da410a3e...b2c581fc The webrevs contain the adjustments done while merging with regards to each parent branch: - master: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=107&range=00.0 - jdk8u:master: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=107&range=00.1 Changes: https://git.openjdk.org/shenandoah-jdk8u/pull/107/files Stats: 434 lines in 24 files changed: 281 ins; 38 del; 115 mod Patch: https://git.openjdk.org/shenandoah-jdk8u/pull/107.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk8u.git pull/107/head:pull/107 PR: https://git.openjdk.org/shenandoah-jdk8u/pull/107 From andrew at openjdk.org Fri Oct 10 19:01:01 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 10 Oct 2025 19:01:01 GMT Subject: RFR: Merge jdk8u:master In-Reply-To: References: Message-ID: On Fri, 10 Oct 2025 18:20:48 GMT, Andrew John Hughes wrote: > Merge jdk8u472-b01 * Additional Linux builds will be resolved by the Debian update in [JDK-8363965](https://bugs.openjdk.org/browse/JDK-8363965) in b03 * Windows x86_64 builds will be resolved by updating the FreeType build's Windows SDK [JDK-8366112](https://bugs.openjdk.org/browse/JDK-8366112) in b06 ------------- PR Comment: https://git.openjdk.org/shenandoah-jdk8u/pull/107#issuecomment-3391867523 From wkemper at openjdk.org Fri Oct 10 19:49:47 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 10 Oct 2025 19:49:47 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v5] In-Reply-To: References: Message-ID: > Notable changes: > * Improvements to logging > * More accurate tracking of promotion failures > * Use shared allocation for promotions only when the size is above the maximum plab size (not the minimum size) > * Use census information gathered during mark to size promotion reserves and old generation > > With these changes, GenShen is expected to have fewer promotion failures and this is indeed the case. As a result of this, we expect less time to be spent in concurrent marking and update refs for young collections. We may also expect shorter concurrent evacuation phases because GenShen will have fewer densely packed regions stuck in the young generation. With more objects being promoted, we also expect to see longer remembered set scan times. This is generally the case across all benchmarks, but we do also see some counter-intuitive results. > > Here we are comparing 20 executions (10 on x86, 10 on aarch64) of the changes in the PR (experiment) against 20 executions of the same benchmarks results from tip. This is a summary of statistically significant changes of more than 5% across all benchmarks: > > > Concurrent Evacuation: 7 improvements, 3 regressions > ? Best improvements: extremem-large-45g (-29.6%), neo4j-analytics (-26.9%) > ? Worst regression: xalan (+53.7%) > > Concurrent Marking: 15 improvements, 1 regression > ? Best improvements: hyperalloc_a2048_o4096 (-30.1%), crypto.rsa (-27.3%) > ? Only regression: serial (+8.9%) > > Concurrent Scan Remembered Set: 7 improvements, 2 regressions > ? Best improvements: xalan (-49.4%), pmd (-49.0%), crypto.rsa (-41.8%) > ? Worst regression: extremem-phased (+52.4%) > > Concurrent Update Refs: 5 improvements, 4 regressions > ? Best improvements: crypto.rsa (-36.4%), mnemonics (-28.4%) > ? Worst regression: xalan (+89.4%) William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 56 commits: - Merge remote-tracking branch 'jdk/master' into promotion-budget-improvements - Review feedback, bug fixes - Fix windows build more - Fix windows build - Little cleanup - Fix wrong asserts - Only use old generation in generational mode - More accurate method names for cset fields, consider promotion reserves when computing excess old regions - Merge fallout - Merge remote-tracking branch 'jdk/master' into promotion-budget-improvements - ... and 46 more: https://git.openjdk.org/jdk/compare/7e29d294...c51ed54c ------------- Changes: https://git.openjdk.org/jdk/pull/27632/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27632&range=04 Stats: 340 lines in 16 files changed: 172 ins; 91 del; 77 mod Patch: https://git.openjdk.org/jdk/pull/27632.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27632/head:pull/27632 PR: https://git.openjdk.org/jdk/pull/27632 From andrew at openjdk.org Fri Oct 10 20:25:37 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 10 Oct 2025 20:25:37 GMT Subject: git: openjdk/shenandoah-jdk8u: master: 14 new changesets Message-ID: Changeset: a01bf318 Branch: master Author: Sergey Bylokhov Date: 2025-06-02 10:03:02 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/a01bf3180fe943be81529408b9208ee992336be1 8275303: sun/java2d/pipe/InterpolationQualityTest.java fails with D3D basic render driver Reviewed-by: aph Backport-of: bc0379ea1a22a2631b49ecd6a331352bec81c1c6 ! jdk/src/windows/native/sun/java2d/d3d/D3DBadHardware.h Changeset: 6f0f298a Branch: master Author: Dmitry Cherepanov Date: 2025-06-02 13:43:21 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/6f0f298a77e881e1ea7a222240514ae3fc19ade2 8340387: Update OS detection code to recognize Windows Server 2025 Reviewed-by: phh Backport-of: 34cddfbedd20d5804cab8044fbc402564e98eb9c ! hotspot/src/os/windows/vm/os_windows.cpp ! jdk/src/windows/native/java/lang/java_props_md.c Changeset: bf175426 Branch: master Author: Andrew John Hughes Date: 2025-06-04 11:57:08 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/bf1754263cffbe07fc1e84d38b839177b173cc16 8358328: Bump update version of OpenJDK: 8u472 Reviewed-by: sgehwolf ! .jcheck/conf ! common/autoconf/version-numbers Changeset: 4f923420 Branch: master Author: Taizo Kurashige Committer: Severin Gehwolf Date: 2025-06-10 14:07:36 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/4f9234206475401978f3cc33286cbc41f2c8bc1b 8351624: [8u] Xerces-J version wrong in THIRD_PARTY_README after JDK-7150324 Reviewed-by: sgehwolf ! THIRD_PARTY_README Changeset: 51b63079 Branch: master Author: Thomas Fitzsimmons Committer: Andrew John Hughes Date: 2025-06-16 23:04:07 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/51b6307937d9584f8690e4916444e479eeafff28 8339414: Fix JDK-8202369 incorrect backport for 8u Reviewed-by: andrew ! jdk/src/solaris/native/java/net/Inet4AddressImpl.c Changeset: f08dd7fb Branch: master Author: SendaoYan Committer: Paul Hohensee Date: 2025-06-24 14:07:01 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/f08dd7fb6abfb94d72625859c1357ad094cd4d2b 8352302: Test sun/security/tools/jarsigner/TimestampCheck.java is failing Reviewed-by: phh Backport-of: 577ede73d8e916bac9050d3bee80d2f18cc833a7 ! jdk/test/sun/security/tools/jarsigner/TimestampCheck.java Changeset: 5a6e681f Branch: master Author: SendaoYan Committer: Paul Hohensee Date: 2025-06-24 14:08:10 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/5a6e681faecd7ea2df0a278f58075f6e38e62cce 8228658: test GetTotalSafepointTime.java fails on fast Linux machines with Total safepoint time 0 ms Reviewed-by: phh Backport-of: c4e0c2656caaba67128f75d733b4452def9a7afc ! jdk/test/sun/management/HotspotRuntimeMBean/GetTotalSafepointTime.java Changeset: fd623637 Branch: master Author: SendaoYan Committer: Paul Hohensee Date: 2025-06-24 14:09:13 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/fd6236376fd2d94bb589a985ddd5b7d323c03a07 8205653: test/jdk/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java and RmiSslBootstrapTest.sh fail with handshake_failure Test failure due to unsupported DSA keys Reviewed-by: phh Backport-of: 136331b7f064d6d61abf3c09ba7106dc9a22a531 ! jdk/test/sun/management/jmxremote/bootstrap/management_ssltest11_ok.properties.in + jdk/test/sun/management/jmxremote/bootstrap/management_ssltest15_ok.properties.in ! jdk/test/sun/management/jmxremote/bootstrap/ssl/Readme.txt ! jdk/test/sun/management/jmxremote/bootstrap/ssl/keystore ! jdk/test/sun/management/jmxremote/bootstrap/ssl/truststore Changeset: 8a5c3db3 Branch: master Author: Long Yang Committer: Denghui Dong Date: 2025-06-26 09:37:12 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/8a5c3db33936c703f50a0cab593a8474e7abafb7 8312065: Socket.connect does not timeout when profiling Reviewed-by: phh Backport-of: 1ce12c4f33d3d6905703d95df2574f4037dfd57d ! jdk/src/aix/native/java/net/aix_close.c ! jdk/src/solaris/native/java/net/bsd_close.c ! jdk/src/solaris/native/java/net/linux_close.c + jdk/test/java/net/Socket/B8312065.java + jdk/test/java/net/Socket/B8312065.sh + jdk/test/java/net/Socket/NativeThread.java + jdk/test/java/net/Socket/libNativeThread.c Changeset: eb64e7f8 Branch: master Author: Ao Qi Committer: Severin Gehwolf Date: 2025-06-26 10:35:43 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/eb64e7f801c15f47b04db589d4ebb9be100e1d1b 8044051: Test jdk/lambda/vm/InterfaceAccessFlagsTest.java gets IOException during compilation Create the gen-separate directory in the current directory to improve robustness Backport-of: 9b8b6695108762063f96a275d9567bed72b88126 ! jdk/test/jdk/lambda/separate/Compiler.java Changeset: d0281bed Branch: master Author: Antonio Vieiro Committer: Severin Gehwolf Date: 2025-07-07 15:58:58 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/d0281bedf07a51f6b8b93ba156b615d76f561c63 8358538: Update GHA Windows runner to 2025 Reviewed-by: sgehwolf Backport-of: 0927ca70e66ef27b38cbf5c0dd2851c796218067 ! .github/workflows/submit.yml Changeset: 35d219b4 Branch: master Author: SendaoYan Committer: Severin Gehwolf Date: 2025-07-08 08:36:55 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/35d219b4d4864cb05e145feaf3f5a1aeeb158c8a 8081734: ConcurrentHashMap/ConcurrentAssociateTest.java, times out 90% of time on sparc with 256 cpu. Backport-of: 6e48caf2507d4a45e1861ee699a32a5e459d70c2 ! jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java Changeset: af84892a Branch: master Author: Andrew John Hughes Date: 2025-07-18 15:48:34 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/af84892a33772b0624c44902ebb354c8debad13f Merge Changeset: b2c581fc Branch: master Author: Andrew John Hughes Date: 2025-09-12 23:20:02 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/b2c581fc6baad44a2120d774efd7f2dfb2c0e515 Merge jdk8u472-b01 Added tag jdk8u472-b01 for changeset af84892a33772b0624c44902ebb354c8debad13f ! .jcheck/conf ! THIRD_PARTY_README ! .jcheck/conf ! THIRD_PARTY_README From duke at openjdk.org Fri Oct 10 20:25:49 2025 From: duke at openjdk.org (duke) Date: Fri, 10 Oct 2025 20:25:49 GMT Subject: git: openjdk/shenandoah-jdk8u: Added tag jdk8u472-b01 for changeset af84892a Message-ID: <67df64b2-0d32-4ad0-b246-1f0c18e75918@openjdk.org> Tagged by: Andrew Hughes Date: 2025-07-30 13:50:03 +0000 Added tag jdk8u472-b01 for changeset af84892a33772b0624c44902ebb354c8debad13f Changeset: af84892a Author: Andrew John Hughes Date: 2025-07-18 15:48:34 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/af84892a33772b0624c44902ebb354c8debad13f From andrew at openjdk.org Fri Oct 10 20:26:00 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 10 Oct 2025 20:26:00 GMT Subject: git: openjdk/shenandoah-jdk8u: Added tag shenandoah8u472-b01 for changeset b2c581fc Message-ID: Tagged by: Andrew John Hughes Date: 2025-10-10 21:20:24 +0000 Added tag shenandoah8u472-b01 for changeset b2c581fc6ba -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRRMled0VQO0j4ExaDP2g+bNZZCIgUCaOlqiAAKCRDP2g+bNZZC ImGnAQDekhaHOU9Qf6fYp1LaR0a7m2OvrbJDqVIHSGIpVPEmzwEA7voPp6HB2k/I 63xs5DuY3oHkAcZ0dACuU7tTZdCG8QI= =p00z -----END PGP SIGNATURE----- Changeset: b2c581fc Author: Andrew John Hughes Date: 2025-09-12 23:20:02 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/b2c581fc6baad44a2120d774efd7f2dfb2c0e515 From andrew at openjdk.org Fri Oct 10 20:26:25 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 10 Oct 2025 20:26:25 GMT Subject: RFR: Merge jdk8u:master [v2] In-Reply-To: References: Message-ID: > Merge jdk8u472-b01 Andrew John Hughes 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. ------------- Changes: - all: https://git.openjdk.org/shenandoah-jdk8u/pull/107/files - new: https://git.openjdk.org/shenandoah-jdk8u/pull/107/files/b2c581fc..b2c581fc Webrevs: - full: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=107&range=01 - incr: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=107&range=00-01 Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/shenandoah-jdk8u/pull/107.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk8u.git pull/107/head:pull/107 PR: https://git.openjdk.org/shenandoah-jdk8u/pull/107 From iris at openjdk.org Fri Oct 10 20:26:27 2025 From: iris at openjdk.org (Iris Clark) Date: Fri, 10 Oct 2025 20:26:27 GMT Subject: Withdrawn: Merge jdk8u:master In-Reply-To: References: Message-ID: On Fri, 10 Oct 2025 18:20:48 GMT, Andrew John Hughes wrote: > Merge jdk8u472-b01 This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/shenandoah-jdk8u/pull/107 From andrew at openjdk.org Sat Oct 11 17:56:50 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Sat, 11 Oct 2025 17:56:50 GMT Subject: RFR: Merge jdk8u:master Message-ID: Merge jdk8u472-b02 ------------- Commit messages: - Merge jdk8u472-b02 - 8335978: [8u] incorrect include file name in semaphore.inline.hpp The merge commit only contains trivial merges, so no merge-specific webrevs have been generated. Changes: https://git.openjdk.org/shenandoah-jdk8u/pull/108/files Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/shenandoah-jdk8u/pull/108.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk8u.git pull/108/head:pull/108 PR: https://git.openjdk.org/shenandoah-jdk8u/pull/108 From kbarrett at openjdk.org Sun Oct 12 00:06:20 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Sun, 12 Oct 2025 00:06:20 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v3] In-Reply-To: References: Message-ID: > Please review this change to the HotSpot Style Guide to suggest that C++ > Standard Library components may be used, after appropriate vetting and > discussion, rather than just a blanket "no, don't use it" with a few very > narrow exceptions. It provides some guidance on that vetting process and > the criteria to use, along with usage patterns. > > In particular, it proposes that Standard Library headers should not be > included directly, but instead through HotSpot-provided wrapper headers. This > gives us a place to document usage, provide workarounds for platform issues in > a single place, and so on. > > Such wrapper headers are provided by this PR for ``, ``, and > ``, along with updates to use them. I have a separate change for > `` that I plan to propose later, under JDK-8369187. There will be > additional followups for other C compatibility headers besides ``. > > This PR also cleans up some nomenclature issues around forbid vs exclude and > the like. > > Testing: mach5 tier1-5, GHA sanity tests Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits: - Merge branch 'master' into stdlib-header-wrappers - jrose comments - move tuple to undecided category - add wrapper for - add wrapper for - add wrapper for - style guide permits some standard library facilities ------------- Changes: https://git.openjdk.org/jdk/pull/27601/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27601&range=02 Stats: 670 lines in 68 files changed: 430 ins; 134 del; 106 mod Patch: https://git.openjdk.org/jdk/pull/27601.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27601/head:pull/27601 PR: https://git.openjdk.org/jdk/pull/27601 From stefank at openjdk.org Mon Oct 13 06:15:07 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Mon, 13 Oct 2025 06:15:07 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v3] In-Reply-To: References: Message-ID: On Sun, 12 Oct 2025 00:06:20 GMT, Kim Barrett wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits: > > - Merge branch 'master' into stdlib-header-wrappers > - jrose comments > - move tuple to undecided category > - add wrapper for > - add wrapper for > - add wrapper for > - style guide permits some standard library facilities Marked as reviewed by stefank (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27601#pullrequestreview-3330092146 From jsjolen at openjdk.org Mon Oct 13 08:44:07 2025 From: jsjolen at openjdk.org (Johan =?UTF-8?B?U2rDtmxlbg==?=) Date: Mon, 13 Oct 2025 08:44:07 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v3] In-Reply-To: References: <8yuoztJS9xFrnxl2LHCptA8HtSU8dpXiifFrRTaHIOE=.010c05ff-3bbf-41f5-8a85-63f2dc1e0fa3@github.com> Message-ID: On Wed, 8 Oct 2025 18:48:12 GMT, John R Rose wrote: >> I have a different take on the distinction between forbidden and undecided. I >> think of forbidden features as being those where there are good arguments >> against. Whereas I think of undecided as perhaps having wishy washy arguments >> in either direction, or even not seriously thought about. But good arguments >> against can be overcome by better arguments in favor. >> >> But I can see how someone else might take that distinction differently. >> >> I also admit to being somewhat biased against tuple in particular. I've seen >> a few pretty terrible uses... one was even my fault! >> >> So okay, I'll recategorize tuple. > > I'm OK with cracking the door open on tuple, but I have to say I do like API-specific names very much. (And `fst`/`snd` or whatever are not API specific; they are tuple-specific!) So the guidance that steers folks towards name-based techniques, instead of positional techniques, is still sound. > > I even like out-args, personally, in cases where the out-arg is for a return value that is clearly secondary to the main return value. Example: Main value is boolean, and out-arg is some hint about why the main value is what it is, like a position. The out-arg can also be optional if a null pointer is tolerated (explicitly documented as such, of course), which is useful when the out-arg costs extra to compute. (A separate boolean arg is OK for such uses also, but null pointers are so darn useful as optionality sentinels!) Note that our TRAPS/THREAD macro system can be viewed as a giant set of out-args. Often, we can use more "specialized" tuples like `Maybe`, in which case it's fine to have the 'generic' `_value`, `_error` slots. Having a bigger sign saying "hey, hey!! this might fail!!!!" is good, it makes bugs related to missing error handling more shallow. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2425580500 From andrew at openjdk.org Mon Oct 13 15:08:40 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Mon, 13 Oct 2025 15:08:40 GMT Subject: RFR: Merge jdk8u:master In-Reply-To: References: Message-ID: On Sat, 11 Oct 2025 17:52:59 GMT, Andrew John Hughes wrote: > Merge jdk8u472-b02 * Additional Linux builds will be resolved by the Debian update in [JDK-8363965](https://bugs.openjdk.org/browse/JDK-8363965) in b03 * Windows x86_64 builds will be resolved by updating the FreeType build's Windows SDK [JDK-8366112](https://bugs.openjdk.org/browse/JDK-8366112) in b06 ------------- PR Comment: https://git.openjdk.org/shenandoah-jdk8u/pull/108#issuecomment-3397903334 From kdnilsen at openjdk.org Mon Oct 13 22:18:38 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Mon, 13 Oct 2025 22:18:38 GMT Subject: RFR: 8353115: GenShen: mixed evacuation candidate regions need accurate live_data [v12] In-Reply-To: References: Message-ID: <2yyHGosCQCiu03jYG7lG82_2WrppAZqVQgDATo8bcfQ=.9c8bed3d-980f-499f-a467-a5cd1d90b6b8@github.com> > The existing implementation of get_live_data_bytes() and git_live_data_words() does not always behave as might be expected. In particular, the value returned ignores any allocations that occur subsequent to the most recent mark effort that identified live data within the region. This is typically ok for young regions, where the amount of live data determines whether a region should be added to the collection set during the final-mark safepoint. > > However, old-gen regions that are placed into the set of candidates for mixed evacuation are more complicated. In particular, by the time the old-gen region is added to a mixed evacuation, its live data may be much larger than at the time concurrent old marking ended. > > This PR provides comments to clarify the shortcomings of the existing functions, and adds new functions that provide more accurate accountings of live data for mixed-evacuation candidate regions. Kelvin Nilsen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 45 commits: - Merge remote-tracking branch 'jdk/master' into fix-live-data-for-mixed-evac-candidates - remove _mixed_candidate_garbage_words from ShenandoahHeapRegion - reviewer feedback to reduce code duplication - Fix compilation errors after merge - Merge remote-tracking branch 'jdk/master' into fix-live-data-for-mixed-evac-candidates - Fix uninitialized variable - Remove deprecation conditional compiles - Adjust candidate live memory for each mixed evac - Refactor for better abstraction - Fix set_live() after full gc - ... and 35 more: https://git.openjdk.org/jdk/compare/92f2ab2e...24322e75 ------------- Changes: https://git.openjdk.org/jdk/pull/24319/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24319&range=11 Stats: 110 lines in 11 files changed: 68 ins; 28 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/24319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24319/head:pull/24319 PR: https://git.openjdk.org/jdk/pull/24319 From ayang at openjdk.org Tue Oct 14 12:49:22 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 14 Oct 2025 12:49:22 GMT Subject: RFR: 8369814: G1: Relax card mark and store ordering [v5] In-Reply-To: References: Message-ID: > This PR removes the card-mark and store ordering constraint. The first commit changes `card_mark_must_follow_store` to `false` and the second commit removes all uses of `card_mark_must_follow_store`, because both the original method and its override are identical, and no GC have such ordering requirement any more. > > Test: tier1-5 Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: review ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27794/files - new: https://git.openjdk.org/jdk/pull/27794/files/d79b1577..cf3ea34b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27794&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27794&range=03-04 Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27794.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27794/head:pull/27794 PR: https://git.openjdk.org/jdk/pull/27794 From tschatzl at openjdk.org Tue Oct 14 12:49:23 2025 From: tschatzl at openjdk.org (Thomas Schatzl) Date: Tue, 14 Oct 2025 12:49:23 GMT Subject: RFR: 8369814: G1: Relax card mark and store ordering [v5] In-Reply-To: References: Message-ID: On Tue, 14 Oct 2025 12:46:51 GMT, Albert Mingkun Yang wrote: >> This PR removes the card-mark and store ordering constraint. The first commit changes `card_mark_must_follow_store` to `false` and the second commit removes all uses of `card_mark_must_follow_store`, because both the original method and its override are identical, and no GC have such ordering requirement any more. >> >> Test: tier1-5 > > Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: > > review lgtm! ------------- Marked as reviewed by tschatzl (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27794#pullrequestreview-3335427722 From kdnilsen at openjdk.org Tue Oct 14 16:35:48 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 14 Oct 2025 16:35:48 GMT Subject: RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure In-Reply-To: References: Message-ID: On Wed, 8 Oct 2025 19:26:19 GMT, William Kemper wrote: > There are certain code paths in Shenandoah's generational mode that need to _know_ which generation is being collected, but it is not possible to pass this information on the stack (barriers, for example). To address this, we introduced an `_active_generation` member in `ShenandoahHeap`. Over time, the usage of this field grew beyond its intended purpose and we began to have issues where not all threads would see a consistent value for this field. To address _this_ issue, we added another field `_gc_generation` which was only meant to be used by GC threads. At this point, we have three different ways to determine which generation is being collected: the _active_ generation, the _gc_ generation, and the usual function parameters and member fields of the gc components. This PR removes `_gc_generation` and reduces the use of `_active_generation` to only those places where it is not possible to get this information from other means (barriers, mostly). All GC components that can have th is information passed through function calls, now do so. Thanks. Lots of intricate work here. ------------- Marked as reviewed by kdnilsen (Committer). PR Review: https://git.openjdk.org/jdk/pull/27703#pullrequestreview-3336550852 From kdnilsen at openjdk.org Tue Oct 14 16:53:12 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 14 Oct 2025 16:53:12 GMT Subject: RFR: 8369447: GenShen: Regulator thread may observe inconsistent states In-Reply-To: <5Qa66lljxDIXH8mOo9oyCZTDjZ2OyhgHsurqkfKKhGY=.a784a918-bb7b-4a86-bad6-195ee1800650@github.com> References: <5Qa66lljxDIXH8mOo9oyCZTDjZ2OyhgHsurqkfKKhGY=.a784a918-bb7b-4a86-bad6-195ee1800650@github.com> Message-ID: On Wed, 8 Oct 2025 18:46:15 GMT, William Kemper wrote: > Shenandoah's generational mode runs a separate thread to monitor the heap during old collections. This thread is responsible for deciding to start collections. When the thread which actually runs collections (the control thread) changes the state of various gc components _on a safepoint_, it has the expectation that these changes will become visible to mutator threads atomically, and consistently. However, the regulator thread does not participate in safepoints and may observe gc components in inconsistent states and so make incorrect choices about trying to start GC cycles. > > For example: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # Internal Error (src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp:625), pid=3796044, tid=3796163 > # assert(_old_generation->state() == ShenandoahOldGeneration::MARKING) failed: Unexpected old gen state: Waiting for Bootstrap > # > > The solution here is to make the regulator thread participate in safepoints. There is no need for it to run during a safepoint. Thanks for this improvement. ------------- Marked as reviewed by kdnilsen (Committer). PR Review: https://git.openjdk.org/jdk/pull/27702#pullrequestreview-3336621148 From kdnilsen at openjdk.org Tue Oct 14 16:57:55 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 14 Oct 2025 16:57:55 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v3] In-Reply-To: References: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> Message-ID: On Wed, 8 Oct 2025 18:01:55 GMT, William Kemper wrote: >> I'm still maybe a bit confused. Is it get_untenurable_live_bytes_in_young_regions()? Are we distinguishing? >> >> So we have a total of N live bytes within young regions that have been placed into the collection set. We expect that P bytes (P < N) will be promoted, and the remaining S bytes (S + P == N) will be evacuated to "survivor space" within young. >> >> Does get_live_bytes_in_untenurable_regions() equal P + S? > > The _tenure_ here refers to the regions the objects reside in, not the objects themselves. `get_live_bytes_in_tenurable_regions` is the sum of live bytes in all regions with an age above the tenuring threshold (we expect to promote _all_ of these, though some promotions may fail). It's complement `get_live_bytes_in_untenurable_regions` is the sum of live bytes in all regions with an age less than the tenuring threshold (we expect to promote _some_ of these, but we don't really know how many). This was part of the reason I wanted to rename these methods. They represent the provenance of the objects in the collection set, not necessarily the regions they will be evacuated to. > get_live_bytes_in_untenurable_regions is the sum of live bytes in all regions with an age less than the tenuring > threshold (we expect to promote some of these, but we don't really know how many) Given that the promotion potential is determined by mark-time age census, I was thinking we do know how many of the bytes in untenurable_regions we "expect to promote". Isn't this just total_promotable_bytes - get_live_bytes_in_tenurable_regions()? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2429856399 From kdnilsen at openjdk.org Tue Oct 14 17:53:18 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 14 Oct 2025 17:53:18 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v5] In-Reply-To: References: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> <7xGe1GZZMDQlU380bkZlAGkgMsI-Q_jRD6qSVJrM664=.640873a9-2c9d-4297-b64b-ec74c7819442@github.com> Message-ID: On Wed, 8 Oct 2025 18:13:10 GMT, William Kemper wrote: >> So in the new design, we have full awareness of all promotable objects, and we've already done our best to budget for those. So there's no such thing as "unanticipated promotions". >> >> Separate question is whether we scale promotion reserve by ShenandoahPromoEvacWaste. So if old is larger than necessary to handle the anticipated mixed evacuations and promotions, the new code is essentially saying "use this extra space for mixed evacuations rather than for promotions". Since we're not expanding the promoted_reserve, promotions will not be allowed to touch it. >> >> Am I understanding the intent correctly? > > In `compute_evacuation_budgets`, if there are mixed collection candidates we set the initial promotion reserve to zero and the old evacuation reserve to the maximum. However, we then restrict old evacuation reserve to only empty regions. The difference between `old available` and `old unaffiliated` is given to the promotion reserve. Here again, I didn't want to scale the promotion reserve because it's basically the scraps of the old generation and I worry about over committing the old reserve. When there are no mixed collections, we use the entirety of old for promotions. Any old regions not needed for old evacuations or promotions are transferred to the young generation as they were before this change. Thanks for reminding me how this code works. So removal of these lines of code has the effect of the following small change in behavior: 1. In the original code, if there was excess memory in old after computing the old (mixed) evacuation reserves (based on ShenandoahOldEvacWaste), we would dedicate this memory to the promotion budget to allow a few more objects to be promoted. This excess memory is always less than a full region size. Any excess larger than a region size is transferred to the mutator to reduce allocation pressure. 2. In the new code, any excess memory left in the old evacuation budget is simply left in the old evacuation budget. By assigning this surplus memory to the old evacuation budget, we reduce the likelihood of experiencing an OOM during evacuation of old objects. This is because the reserve for old evacuation is even larger than what is specified by ShenandoahOldEvacWaste. Where we place this excess memory is probably of little consequence since the amount of memory is always less than one region size. However, I believe this will slow promotions during mixed evacuation cycles, which may partially explain why we're not seeing as many benefits from this PR as we had hoped for when we measure the impact on real workloads. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2429993573 From wkemper at openjdk.org Tue Oct 14 23:03:16 2025 From: wkemper at openjdk.org (William Kemper) Date: Tue, 14 Oct 2025 23:03:16 GMT Subject: RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure [v2] In-Reply-To: References: Message-ID: > There are certain code paths in Shenandoah's generational mode that need to _know_ which generation is being collected, but it is not possible to pass this information on the stack (barriers, for example). To address this, we introduced an `_active_generation` member in `ShenandoahHeap`. Over time, the usage of this field grew beyond its intended purpose and we began to have issues where not all threads would see a consistent value for this field. To address _this_ issue, we added another field `_gc_generation` which was only meant to be used by GC threads. At this point, we have three different ways to determine which generation is being collected: the _active_ generation, the _gc_ generation, and the usual function parameters and member fields of the gc components. This PR removes `_gc_generation` and reduces the use of `_active_generation` to only those places where it is not possible to get this information from other means (barriers, mostly). All GC components that can have th is information passed through function calls, now do so. William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage - Remove _gc_generation from ShenandoahHeap - Little cleanup, remove one active generation usage - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage - Finish removing usages of gc_generation, start on reducing usages of active_generation - Fix build - Use existing _generation field instead of Heap::_gc_generation where possible - Only shenandoah vm operations participate in active/gc generation scheme ------------- Changes: https://git.openjdk.org/jdk/pull/27703/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27703&range=01 Stats: 494 lines in 32 files changed: 119 ins; 149 del; 226 mod Patch: https://git.openjdk.org/jdk/pull/27703.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27703/head:pull/27703 PR: https://git.openjdk.org/jdk/pull/27703 From wkemper at openjdk.org Wed Oct 15 18:42:35 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 15 Oct 2025 18:42:35 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v3] In-Reply-To: References: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> Message-ID: <1RrkUiDtpqSYgsOI-_2b7WDqj0aYZSSWC57qf5HsT9I=.0c59d198-c0de-4bea-80fa-efd0f0493e82@github.com> On Tue, 14 Oct 2025 16:55:33 GMT, Kelvin Nilsen wrote: >> The _tenure_ here refers to the regions the objects reside in, not the objects themselves. `get_live_bytes_in_tenurable_regions` is the sum of live bytes in all regions with an age above the tenuring threshold (we expect to promote _all_ of these, though some promotions may fail). It's complement `get_live_bytes_in_untenurable_regions` is the sum of live bytes in all regions with an age less than the tenuring threshold (we expect to promote _some_ of these, but we don't really know how many). This was part of the reason I wanted to rename these methods. They represent the provenance of the objects in the collection set, not necessarily the regions they will be evacuated to. > >> get_live_bytes_in_untenurable_regions is the sum of live bytes in all regions with an age less than the tenuring >> threshold (we expect to promote some of these, but we don't really know how many) > > Given that the promotion potential is determined by mark-time age census, I was thinking we do know how many of the bytes in untenurable_regions we "expect to promote". Isn't this just total_promotable_bytes - get_live_bytes_in_tenurable_regions()? The age census doesn't give us the level of detail to break down promotable bytes per region. The collection set has a subset of the tenurable and untenurable regions. Of those, we still don't really _know_ how much of the live data in the tenurable regions will be promoted. The changes here try to plan for the worst case by reserving as much of old as possible for promotions. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2433595356 From wkemper at openjdk.org Wed Oct 15 22:27:35 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 15 Oct 2025 22:27:35 GMT Subject: RFR: 8367709: GenShen: Dirty cards for objects that get promoted by safepoint that intervenes between allocation and stores Message-ID: I believe this sequence of events can lead to the original assertion failing: 1. Shenandoah lowers the tenuring threshold to 1. 2. An object gets allocated on the slow path. 3. We come to a safepoint and run a degenerated cycle. 4. The object is evacuated during the degenerated cycle and has its age raised to 1. 5. The degenerated cycle is "upgraded" to a full GC. 6. The object is at the tenuring age and gets promoted by the full GC into an old region. 7. We leave the safepoint and the assertion fails because this "new" object is an old region. However, there is still a risk that the card marking barriers have been elided for this object. Now that the object is in the old generation we must be sure that if it ends up storing any pointers to young, then these cards must be dirtied. The solution here is conservative in that it just dirties _all_ the cards for this object. We expect this condition to be rare and the card table will refine itself on subsequent GC cycles. Also, note that we will not scan the remembered set without coming to the `init-mark` safepoint, so it will see these dirty cards. ------------- Commit messages: - Slip of the mouse - Remove instrumentation - Merge remote-tracking branch 'jdk/master' into not-allocated-young - Dirty cards for newly allocated objects that are promoted during a safepoint - Instrumentation to track where objects are being evacuated - More instrumentation - Instrumentation for array allocs too - Fix instrumentation - Instrument slowpath allocation Changes: https://git.openjdk.org/jdk/pull/27832/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27832&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8367709 Stats: 25 lines in 5 files changed: 11 ins; 0 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/27832.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27832/head:pull/27832 PR: https://git.openjdk.org/jdk/pull/27832 From ysr at openjdk.org Wed Oct 15 22:54:17 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Wed, 15 Oct 2025 22:54:17 GMT Subject: RFR: 8367709: GenShen: Dirty cards for objects that get promoted by safepoint that intervenes between allocation and stores In-Reply-To: References: Message-ID: On Wed, 15 Oct 2025 20:53:53 GMT, William Kemper wrote: > I believe this sequence of events can lead to the original assertion failing: > 1. Shenandoah lowers the tenuring threshold to 1. > 2. An object gets allocated on the slow path. > 3. We come to a safepoint and run a degenerated cycle. > 4. The object is evacuated during the degenerated cycle and has its age raised to 1. > 5. The degenerated cycle is "upgraded" to a full GC. > 6. The object is at the tenuring age and gets promoted by the full GC into an old region. > 7. We leave the safepoint and the assertion fails because this "new" object is an old region. > > However, there is still a risk that the card marking barriers have been elided for this object. Now that the object is in the old generation we must be sure that if it ends up storing any pointers to young, then these cards must be dirtied. The solution here is conservative in that it just dirties _all_ the cards for this object. We expect this condition to be rare and the card table will refine itself on subsequent GC cycles. Also, note that we will not scan the remembered set without coming to the `init-mark` safepoint, so it will see these dirty cards. Good catch of this slippery, if rare, condition. This looks good, but is it possible that we can use a debug `*ALot` type of flag to manually enlarge the post-allocation window so as to induce this condition (promotion) to happen more frequently in fastdebug runs with the flag enabled? That would exercise this code some. src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp line 106: > 104: } > 105: #endif // COMPILER2_OR_JVMCI > 106: assert(thread->deferred_card_mark().is_empty(), "We don't use this"); This is rare, so probably not worth the extra work, but there is an existing mechanism to defer this until the safepoint (or until another such deferment arises). Not sure if it's worth using it. ------------- PR Review: https://git.openjdk.org/jdk/pull/27832#pullrequestreview-3342585610 PR Review Comment: https://git.openjdk.org/jdk/pull/27832#discussion_r2434156837 From ysr at openjdk.org Wed Oct 15 22:58:03 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Wed, 15 Oct 2025 22:58:03 GMT Subject: RFR: 8367709: GenShen: Dirty cards for objects that get promoted by safepoint that intervenes between allocation and stores In-Reply-To: References: Message-ID: On Wed, 15 Oct 2025 22:51:23 GMT, Y. Srinivas Ramakrishna wrote: >> I believe this sequence of events can lead to the original assertion failing: >> 1. Shenandoah lowers the tenuring threshold to 1. >> 2. An object gets allocated on the slow path. >> 3. We come to a safepoint and run a degenerated cycle. >> 4. The object is evacuated during the degenerated cycle and has its age raised to 1. >> 5. The degenerated cycle is "upgraded" to a full GC. >> 6. The object is at the tenuring age and gets promoted by the full GC into an old region. >> 7. We leave the safepoint and the assertion fails because this "new" object is an old region. >> >> However, there is still a risk that the card marking barriers have been elided for this object. Now that the object is in the old generation we must be sure that if it ends up storing any pointers to young, then these cards must be dirtied. The solution here is conservative in that it just dirties _all_ the cards for this object. We expect this condition to be rare and the card table will refine itself on subsequent GC cycles. Also, note that we will not scan the remembered set without coming to the `init-mark` safepoint, so it will see these dirty cards. > > src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp line 106: > >> 104: } >> 105: #endif // COMPILER2_OR_JVMCI >> 106: assert(thread->deferred_card_mark().is_empty(), "We don't use this"); > > This is rare, so probably not worth the extra work, but there is an existing mechanism to defer this until the safepoint (or until another such deferment arises). Not sure if it's worth using it. Probably not worth the trouble, because that mechanism might require wiring in some other stuff which may not be wired in for GenShen. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27832#discussion_r2434162161 From ysr at openjdk.org Wed Oct 15 23:00:55 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Wed, 15 Oct 2025 23:00:55 GMT Subject: RFR: 8367709: GenShen: Dirty cards for objects that get promoted by safepoint that intervenes between allocation and stores In-Reply-To: References: Message-ID: On Wed, 15 Oct 2025 20:53:53 GMT, William Kemper wrote: > I believe this sequence of events can lead to the original assertion failing: > 1. Shenandoah lowers the tenuring threshold to 1. > 2. An object gets allocated on the slow path. > 3. We come to a safepoint and run a degenerated cycle. > 4. The object is evacuated during the degenerated cycle and has its age raised to 1. > 5. The degenerated cycle is "upgraded" to a full GC. > 6. The object is at the tenuring age and gets promoted by the full GC into an old region. > 7. We leave the safepoint and the assertion fails because this "new" object is an old region. > > However, there is still a risk that the card marking barriers have been elided for this object. Now that the object is in the old generation we must be sure that if it ends up storing any pointers to young, then these cards must be dirtied. The solution here is conservative in that it just dirties _all_ the cards for this object. We expect this condition to be rare and the card table will refine itself on subsequent GC cycles. Also, note that we will not scan the remembered set without coming to the `init-mark` safepoint, so it will see these dirty cards. (Left a comment about possibly exercising this code, if easy to do so.) Not a blocking suggestion, though. Approved. ------------- Marked as reviewed by ysr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27832#pullrequestreview-3342594514 From wkemper at openjdk.org Wed Oct 15 23:08:16 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 15 Oct 2025 23:08:16 GMT Subject: RFR: 8367709: GenShen: Dirty cards for objects that get promoted by safepoint that intervenes between allocation and stores In-Reply-To: References: Message-ID: On Wed, 15 Oct 2025 22:55:47 GMT, Y. Srinivas Ramakrishna wrote: >> src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp line 106: >> >>> 104: } >>> 105: #endif // COMPILER2_OR_JVMCI >>> 106: assert(thread->deferred_card_mark().is_empty(), "We don't use this"); >> >> This is rare, so probably not worth the extra work, but there is an existing mechanism to defer this until the safepoint (or until another such deferment arises). Not sure if it's worth using it. > > Probably not worth the trouble, because that mechanism might require wiring in some other stuff which may not be wired in for GenShen. Yeah, I thought it looked like a lot of complexity to bring in. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27832#discussion_r2434169557 From wkemper at openjdk.org Wed Oct 15 23:08:14 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 15 Oct 2025 23:08:14 GMT Subject: RFR: 8367709: GenShen: Dirty cards for objects that get promoted by safepoint that intervenes between allocation and stores In-Reply-To: References: Message-ID: On Wed, 15 Oct 2025 20:53:53 GMT, William Kemper wrote: > I believe this sequence of events can lead to the original assertion failing: > 1. Shenandoah lowers the tenuring threshold to 1. > 2. An object gets allocated on the slow path. > 3. We come to a safepoint and run a degenerated cycle. > 4. The object is evacuated during the degenerated cycle and has its age raised to 1. > 5. The degenerated cycle is "upgraded" to a full GC. > 6. The object is at the tenuring age and gets promoted by the full GC into an old region. > 7. We leave the safepoint and the assertion fails because this "new" object is an old region. > > However, there is still a risk that the card marking barriers have been elided for this object. Now that the object is in the old generation we must be sure that if it ends up storing any pointers to young, then these cards must be dirtied. The solution here is conservative in that it just dirties _all_ the cards for this object. We expect this condition to be rare and the card table will refine itself on subsequent GC cycles. Also, note that we will not scan the remembered set without coming to the `init-mark` safepoint, so it will see these dirty cards. This condition does happen pretty reliably in the `vmTestbase/vm/gc/concurrent/` family of tests mentioned in the ticket. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27832#issuecomment-3408586943 From ysr at openjdk.org Wed Oct 15 23:08:16 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Wed, 15 Oct 2025 23:08:16 GMT Subject: RFR: 8367709: GenShen: Dirty cards for objects that get promoted by safepoint that intervenes between allocation and stores In-Reply-To: References: Message-ID: On Wed, 15 Oct 2025 23:01:54 GMT, William Kemper wrote: >> Probably not worth the trouble, because that mechanism might require wiring in some other stuff which may not be wired in for GenShen. > > Yeah, I thought it looked like a lot of complexity to bring in. I agree. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27832#discussion_r2434173720 From fandreuzzi at openjdk.org Thu Oct 16 08:20:47 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Thu, 16 Oct 2025 08:20:47 GMT Subject: RFR: 8369814: G1: Relax card mark and store ordering [v5] In-Reply-To: References: Message-ID: On Tue, 14 Oct 2025 12:49:22 GMT, Albert Mingkun Yang wrote: >> This PR removes the card-mark and store ordering constraint. The first commit changes `card_mark_must_follow_store` to `false` and the second commit removes all uses of `card_mark_must_follow_store`, because both the original method and its override are identical, and no GC have such ordering requirement any more. >> >> Test: tier1-5 > > Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: > > review Marked as reviewed by fandreuzzi (Author). ------------- PR Review: https://git.openjdk.org/jdk/pull/27794#pullrequestreview-3343613146 From fandreuzzi at openjdk.org Thu Oct 16 11:09:23 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Thu, 16 Oct 2025 11:09:23 GMT Subject: RFR: 8369980: Use ThreadsClaimTokenScope in ShenandoahThreadRoots Message-ID: The explicit usage of `Threads::change_thread_claim_token` and `Threads::assert_all_threads_claimed` in `ShenandoahThreadRoots` can be replaced with `ThreadsClaimTokenScope`. Passes tier1, tier2, tier[1,2,3]_gc_shenandoah (fastdebug). ------------- Commit messages: - replace Changes: https://git.openjdk.org/jdk/pull/27845/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27845&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8369980 Stats: 11 lines in 2 files changed: 2 ins; 5 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/27845.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27845/head:pull/27845 PR: https://git.openjdk.org/jdk/pull/27845 From ayang at openjdk.org Thu Oct 16 11:17:11 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Thu, 16 Oct 2025 11:17:11 GMT Subject: RFR: 8369980: Use ThreadsClaimTokenScope in ShenandoahThreadRoots In-Reply-To: References: Message-ID: On Thu, 16 Oct 2025 11:02:50 GMT, Francesco Andreuzzi wrote: > The explicit usage of `Threads::change_thread_claim_token` and `Threads::assert_all_threads_claimed` in `ShenandoahThreadRoots` can be replaced with `ThreadsClaimTokenScope`. > > Passes tier1, tier2, tier[1,2,3]_gc_shenandoah (fastdebug). Marked as reviewed by ayang (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27845#pullrequestreview-3344295158 From andrew at openjdk.org Thu Oct 16 14:58:31 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Thu, 16 Oct 2025 14:58:31 GMT Subject: RFR: Merge jdk8u:master [v2] In-Reply-To: References: Message-ID: > Merge jdk8u472-b02 Andrew John Hughes 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. ------------- Changes: - all: https://git.openjdk.org/shenandoah-jdk8u/pull/108/files - new: https://git.openjdk.org/shenandoah-jdk8u/pull/108/files/17dcfa26..17dcfa26 Webrevs: - full: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=108&range=01 - incr: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=108&range=00-01 Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/shenandoah-jdk8u/pull/108.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk8u.git pull/108/head:pull/108 PR: https://git.openjdk.org/shenandoah-jdk8u/pull/108 From duke at openjdk.org Thu Oct 16 14:59:06 2025 From: duke at openjdk.org (duke) Date: Thu, 16 Oct 2025 14:59:06 GMT Subject: git: openjdk/shenandoah-jdk8u: Added tag jdk8u472-b02 for changeset 16949879 Message-ID: <24708909-ca5c-44e8-9f67-9bf1c82ad098@openjdk.org> Tagged by: Andrew Hughes Date: 2025-08-06 13:43:08 +0000 Added tag jdk8u472-b02 for changeset 16949879ae5 Changeset: 16949879 Author: SendaoYan Committer: Severin Gehwolf Date: 2025-07-22 14:15:09 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/16949879ae5d8decf8613db2765dd58fd9a140ad From iris at openjdk.org Thu Oct 16 14:58:32 2025 From: iris at openjdk.org (Iris Clark) Date: Thu, 16 Oct 2025 14:58:32 GMT Subject: Withdrawn: Merge jdk8u:master In-Reply-To: References: Message-ID: On Sat, 11 Oct 2025 17:52:59 GMT, Andrew John Hughes wrote: > Merge jdk8u472-b02 This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/shenandoah-jdk8u/pull/108 From andrew at openjdk.org Thu Oct 16 14:59:09 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Thu, 16 Oct 2025 14:59:09 GMT Subject: git: openjdk/shenandoah-jdk8u: Added tag shenandoah8u472-b02 for changeset 17dcfa26 Message-ID: Tagged by: Andrew John Hughes Date: 2025-10-16 15:54:06 +0000 Added tag shenandoah8u472-b02 for changeset 17dcfa260ae -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRRMled0VQO0j4ExaDP2g+bNZZCIgUCaPEHDgAKCRDP2g+bNZZC IgZZAQDRzIDMy8D8hD7jEQ4hsegtgu3W3+TIAuxFYzJBtN+bkgEAkuq/ni0mVz1i fSa4dqa9/HA9vNBhuhM4fovvur8m+A8= =ATa3 -----END PGP SIGNATURE----- Changeset: 17dcfa26 Author: Andrew John Hughes Date: 2025-10-10 21:25:46 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/17dcfa260aead1f86998b32a233062d05ced502c From andrew at openjdk.org Thu Oct 16 14:58:51 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Thu, 16 Oct 2025 14:58:51 GMT Subject: git: openjdk/shenandoah-jdk8u: master: 2 new changesets Message-ID: <46398bb0-2ba8-4bfa-a516-d88b542d212c@openjdk.org> Changeset: 16949879 Branch: master Author: SendaoYan Committer: Severin Gehwolf Date: 2025-07-22 14:15:09 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/16949879ae5d8decf8613db2765dd58fd9a140ad 8335978: [8u] incorrect include file name in semaphore.inline.hpp Reviewed-by: phh ! hotspot/src/share/vm/runtime/semaphore.inline.hpp Changeset: 17dcfa26 Branch: master Author: Andrew John Hughes Date: 2025-10-10 21:25:46 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/17dcfa260aead1f86998b32a233062d05ced502c Merge jdk8u472-b02 Added tag jdk8u472-b02 for changeset 16949879ae5 From andrew at openjdk.org Thu Oct 16 15:47:26 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Thu, 16 Oct 2025 15:47:26 GMT Subject: RFR: Merge jdk8u:master Message-ID: <15bVUQ4_2U3ae-YSxjm1enVSONu-4y7Zzs_JpJo71p4=.777a7f3d-494c-4d3b-8ee0-2571047cdeb3@github.com> Merge jdk8u472-b03 Windows x86_64 builds will be resolved by updating the FreeType build's Windows SDK [JDK-8366112](https://bugs.openjdk.org/browse/JDK-8366112) in b06 ------------- Commit messages: - Merge jdk8u472-b03 - 8363965: GHA: Switch cross-compiling sysroots to Debian bookworm - 8185348: Major performance regression in GetMethodDeclaringClass and other JVMTI Method functions The merge commit only contains trivial merges, so no merge-specific webrevs have been generated. Changes: https://git.openjdk.org/shenandoah-jdk8u/pull/109/files Stats: 9 lines in 3 files changed: 5 ins; 3 del; 1 mod Patch: https://git.openjdk.org/shenandoah-jdk8u/pull/109.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk8u.git pull/109/head:pull/109 PR: https://git.openjdk.org/shenandoah-jdk8u/pull/109 From wkemper at openjdk.org Thu Oct 16 17:52:06 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 16 Oct 2025 17:52:06 GMT Subject: Integrated: 8367709: GenShen: Dirty cards for objects that get promoted by safepoint that intervenes between allocation and stores In-Reply-To: References: Message-ID: On Wed, 15 Oct 2025 20:53:53 GMT, William Kemper wrote: > I believe this sequence of events can lead to the original assertion failing: > 1. Shenandoah lowers the tenuring threshold to 1. > 2. An object gets allocated on the slow path. > 3. We come to a safepoint and run a degenerated cycle. > 4. The object is evacuated during the degenerated cycle and has its age raised to 1. > 5. The degenerated cycle is "upgraded" to a full GC. > 6. The object is at the tenuring age and gets promoted by the full GC into an old region. > 7. We leave the safepoint and the assertion fails because this "new" object is an old region. > > However, there is still a risk that the card marking barriers have been elided for this object. Now that the object is in the old generation we must be sure that if it ends up storing any pointers to young, then these cards must be dirtied. The solution here is conservative in that it just dirties _all_ the cards for this object. We expect this condition to be rare and the card table will refine itself on subsequent GC cycles. Also, note that we will not scan the remembered set without coming to the `init-mark` safepoint, so it will see these dirty cards. This pull request has now been integrated. Changeset: d4472979 Author: William Kemper URL: https://git.openjdk.org/jdk/commit/d4472979c43d9825ed2d008dbaed26dbf6d36180 Stats: 25 lines in 5 files changed: 11 ins; 0 del; 14 mod 8367709: GenShen: Dirty cards for objects that get promoted by safepoint that intervenes between allocation and stores Reviewed-by: ysr ------------- PR: https://git.openjdk.org/jdk/pull/27832 From wkemper at openjdk.org Thu Oct 16 18:38:53 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 16 Oct 2025 18:38:53 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v4] In-Reply-To: References: Message-ID: On Thu, 9 Oct 2025 23:44:04 GMT, Y. Srinivas Ramakrishna wrote: >> William Kemper has updated the pull request incrementally with one additional commit since the last revision: >> >> Review feedback, bug fixes > >> Here we are comparing 20 executions (10 on x86, 10 on aarch64) of the changes in the PR (experiment) against 20 executions of the same benchmarks results from tip. > > @earthling-amzn : Can the comparisons be done in each of the two classes, i.e. x86 and aarch64, separately? Not sure if it'll give more statistically significant differences between test and control. > > Was there any significant difference (on x86 or aarch64 separately) on SPECjbb? @ysramakrishna , the results between aarch64 and x86 are similar. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27632#issuecomment-3412312046 From wkemper at openjdk.org Thu Oct 16 18:38:54 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 16 Oct 2025 18:38:54 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v5] In-Reply-To: References: <50uKtYv5OrEm6XAdBu-5NkZVsbP8t2pV4VBtDvV8Lys=.71995eda-8d3a-433d-80ac-efae58bc0d88@github.com> <7xGe1GZZMDQlU380bkZlAGkgMsI-Q_jRD6qSVJrM664=.640873a9-2c9d-4297-b64b-ec74c7819442@github.com> Message-ID: On Tue, 14 Oct 2025 17:50:16 GMT, Kelvin Nilsen wrote: >> In `compute_evacuation_budgets`, if there are mixed collection candidates we set the initial promotion reserve to zero and the old evacuation reserve to the maximum. However, we then restrict old evacuation reserve to only empty regions. The difference between `old available` and `old unaffiliated` is given to the promotion reserve. Here again, I didn't want to scale the promotion reserve because it's basically the scraps of the old generation and I worry about over committing the old reserve. When there are no mixed collections, we use the entirety of old for promotions. Any old regions not needed for old evacuations or promotions are transferred to the young generation as they were before this change. > > Thanks for reminding me how this code works. So removal of these lines of code has the effect of the following small change in behavior: > > 1. In the original code, if there was excess memory in old after computing the old (mixed) evacuation reserves (based on ShenandoahOldEvacWaste), we would dedicate this memory to the promotion budget to allow a few more objects to be promoted. This excess memory is always less than a full region size. Any excess larger than a region size is transferred to the mutator to reduce allocation pressure. > > 2. In the new code, any excess memory left in the old evacuation budget is simply left in the old evacuation budget. By assigning this surplus memory to the old evacuation budget, we reduce the likelihood of experiencing an OOM during evacuation of old objects. This is because the reserve for old evacuation is even larger than what is specified by ShenandoahOldEvacWaste. > > Where we place this excess memory is probably of little consequence since the amount of memory is always less than one region size. > > However, I believe this will slow promotions during mixed evacuation cycles, which may partially explain why we're not seeing as many benefits from this PR as we had hoped for when we measure the impact on real workloads. This part of the algorithm didn't really change. During a mixed evacuation, it attempts to restrict old evacuations to _empty_ regions. The difference between the old reserve and the memory available in empty regions is made available for promotions. I believe the sum of the memory available in these non-empty old regions could be more than a single region. Anything not expected to be used by old evacuations or promotions is returned to the mutator's partition. Before this change, the value of _expected promotions_ was computed as `tenurable region count * region size * promo waste`. After this change, the value of _expected promotions_ is computed directly from the census during mark. It is generally the case that expected promotions _before_ this change will be less than expected promotions _after_ this change. Excess old reserve is still transferred to the mutator partition, but it will generally be less now. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27632#discussion_r2437060757 From wkemper at openjdk.org Thu Oct 16 18:51:56 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 16 Oct 2025 18:51:56 GMT Subject: RFR: 8369980: Use ThreadsClaimTokenScope in ShenandoahThreadRoots In-Reply-To: References: Message-ID: On Thu, 16 Oct 2025 11:02:50 GMT, Francesco Andreuzzi wrote: > The explicit usage of `Threads::change_thread_claim_token` and `Threads::assert_all_threads_claimed` in `ShenandoahThreadRoots` can be replaced with `ThreadsClaimTokenScope`. > > Passes tier1, tier2, tier[1,2,3]_gc_shenandoah (fastdebug). Looks good to me. ------------- Marked as reviewed by wkemper (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27845#pullrequestreview-3346499018 From wkemper at openjdk.org Thu Oct 16 19:09:40 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 16 Oct 2025 19:09:40 GMT Subject: RFR: 8241066: Shenandoah: fix or cleanup SH::do_full_collection Message-ID: This `ShenandoahHeap::do_full_collection` will never be called by our implementation of `collect_as_vm_thread`. ------------- Commit messages: - Clarify comment - Fix commented out assertion with actual assertion and explanation. Changes: https://git.openjdk.org/jdk/pull/27853/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27853&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8241066 Stats: 6 lines in 1 file changed: 3 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27853.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27853/head:pull/27853 PR: https://git.openjdk.org/jdk/pull/27853 From andrew at openjdk.org Thu Oct 16 23:32:05 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Thu, 16 Oct 2025 23:32:05 GMT Subject: RFR: Merge jdk8u:master [v2] In-Reply-To: <15bVUQ4_2U3ae-YSxjm1enVSONu-4y7Zzs_JpJo71p4=.777a7f3d-494c-4d3b-8ee0-2571047cdeb3@github.com> References: <15bVUQ4_2U3ae-YSxjm1enVSONu-4y7Zzs_JpJo71p4=.777a7f3d-494c-4d3b-8ee0-2571047cdeb3@github.com> Message-ID: <_5qVCQp8qE8PnJ0n0RFibnc_-KMDUKv47BYmA13soKo=.094514ec-e0f9-4b7d-a720-334c29d7bb6c@github.com> > Merge jdk8u472-b03 > > Windows x86_64 builds will be resolved by updating the FreeType build's Windows SDK [JDK-8366112](https://bugs.openjdk.org/browse/JDK-8366112) in b06 Andrew John Hughes 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. ------------- Changes: - all: https://git.openjdk.org/shenandoah-jdk8u/pull/109/files - new: https://git.openjdk.org/shenandoah-jdk8u/pull/109/files/2d8afa3f..2d8afa3f Webrevs: - full: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=109&range=01 - incr: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=109&range=00-01 Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/shenandoah-jdk8u/pull/109.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk8u.git pull/109/head:pull/109 PR: https://git.openjdk.org/shenandoah-jdk8u/pull/109 From iris at openjdk.org Thu Oct 16 23:32:06 2025 From: iris at openjdk.org (Iris Clark) Date: Thu, 16 Oct 2025 23:32:06 GMT Subject: Withdrawn: Merge jdk8u:master In-Reply-To: <15bVUQ4_2U3ae-YSxjm1enVSONu-4y7Zzs_JpJo71p4=.777a7f3d-494c-4d3b-8ee0-2571047cdeb3@github.com> References: <15bVUQ4_2U3ae-YSxjm1enVSONu-4y7Zzs_JpJo71p4=.777a7f3d-494c-4d3b-8ee0-2571047cdeb3@github.com> Message-ID: On Thu, 16 Oct 2025 15:42:10 GMT, Andrew John Hughes wrote: > Merge jdk8u472-b03 > > Windows x86_64 builds will be resolved by updating the FreeType build's Windows SDK [JDK-8366112](https://bugs.openjdk.org/browse/JDK-8366112) in b06 This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/shenandoah-jdk8u/pull/109 From duke at openjdk.org Thu Oct 16 23:34:00 2025 From: duke at openjdk.org (duke) Date: Thu, 16 Oct 2025 23:34:00 GMT Subject: git: openjdk/shenandoah-jdk8u: Added tag jdk8u472-b03 for changeset 7b9b1e17 Message-ID: <201c6a98-7387-4df0-baf9-a13456b84777@openjdk.org> Tagged by: Andrew Hughes Date: 2025-08-11 16:52:01 +0000 Added tag jdk8u472-b03 for changeset 7b9b1e17adb Changeset: 7b9b1e17 Author: Severin Gehwolf Date: 2025-08-08 08:07:57 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/7b9b1e17adb757515ce3f7b6e9587e78fdfd7fe2 From andrew at openjdk.org Thu Oct 16 23:33:51 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Thu, 16 Oct 2025 23:33:51 GMT Subject: git: openjdk/shenandoah-jdk8u: master: 3 new changesets Message-ID: <2923cbd9-480b-40b1-ae66-22519a0587fa@openjdk.org> Changeset: 8234312b Branch: master Author: Zhengyu Gu Date: 2025-08-05 19:23:49 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/8234312bb061930df0479d04f2350eea80b72dbd 8185348: Major performance regression in GetMethodDeclaringClass and other JVMTI Method functions Reviewed-by: phh ! hotspot/src/share/vm/oops/method.cpp ! hotspot/src/share/vm/prims/jniCheck.cpp Changeset: 7b9b1e17 Branch: master Author: Severin Gehwolf Date: 2025-08-08 08:07:57 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/7b9b1e17adb757515ce3f7b6e9587e78fdfd7fe2 8363965: GHA: Switch cross-compiling sysroots to Debian bookworm Reviewed-by: shade, andrew Backport-of: 3ff903a37cc0bbe4cb5e2a6b08faa48fde71445f ! .github/workflows/submit.yml Changeset: 2d8afa3f Branch: master Author: Andrew John Hughes Date: 2025-10-16 15:55:03 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/2d8afa3f7754a19fa477708db60bf5c9af6a9e5c Merge jdk8u472-b03 Added tag jdk8u472-b03 for changeset 7b9b1e17adb From andrew at openjdk.org Thu Oct 16 23:34:03 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Thu, 16 Oct 2025 23:34:03 GMT Subject: git: openjdk/shenandoah-jdk8u: Added tag shenandoah8u472-b03 for changeset 2d8afa3f Message-ID: <528bb75b-fc36-45fc-80cb-fcb4167f1b9a@openjdk.org> Tagged by: Andrew John Hughes Date: 2025-10-17 00:28:57 +0000 Added tag shenandoah8u472-b03 for changeset 2d8afa3f775 -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRRMled0VQO0j4ExaDP2g+bNZZCIgUCaPF/uQAKCRDP2g+bNZZC IkQ1AQDPVdHkMxrSLiU3Gscx5iYrDp11Ixzh+1eV3Iy0cJbh/gEAgrLh+ILDWrBw HuVgKQo3mZR4Qy8T/WxW4ipyVEBTHw4= =oKeX -----END PGP SIGNATURE----- Changeset: 2d8afa3f Author: Andrew John Hughes Date: 2025-10-16 15:55:03 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/2d8afa3f7754a19fa477708db60bf5c9af6a9e5c From ayang at openjdk.org Fri Oct 17 09:36:18 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Fri, 17 Oct 2025 09:36:18 GMT Subject: RFR: 8369814: G1: Relax card mark and store ordering [v5] In-Reply-To: References: Message-ID: On Tue, 14 Oct 2025 12:49:22 GMT, Albert Mingkun Yang wrote: >> This PR removes the card-mark and store ordering constraint. The first commit changes `card_mark_must_follow_store` to `false` and the second commit removes all uses of `card_mark_must_follow_store`, because both the original method and its override are identical, and no GC have such ordering requirement any more. >> >> Test: tier1-5 > > Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision: > > review Thanks for review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27794#issuecomment-3414639309 From ayang at openjdk.org Fri Oct 17 09:36:19 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Fri, 17 Oct 2025 09:36:19 GMT Subject: Integrated: 8369814: G1: Relax card mark and store ordering In-Reply-To: References: Message-ID: On Tue, 14 Oct 2025 09:46:55 GMT, Albert Mingkun Yang wrote: > This PR removes the card-mark and store ordering constraint. The first commit changes `card_mark_must_follow_store` to `false` and the second commit removes all uses of `card_mark_must_follow_store`, because both the original method and its override are identical, and no GC have such ordering requirement any more. > > Test: tier1-5 This pull request has now been integrated. Changeset: 0a97bef8 Author: Albert Mingkun Yang URL: https://git.openjdk.org/jdk/commit/0a97bef840f8799313a1a55a65d9334e09cc1cf4 Stats: 123 lines in 11 files changed: 0 ins; 120 del; 3 mod 8369814: G1: Relax card mark and store ordering Reviewed-by: tschatzl, fandreuzzi ------------- PR: https://git.openjdk.org/jdk/pull/27794 From fandreuzzi at openjdk.org Fri Oct 17 09:43:02 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Fri, 17 Oct 2025 09:43:02 GMT Subject: RFR: 8369980: Use ThreadsClaimTokenScope in ShenandoahThreadRoots In-Reply-To: References: Message-ID: On Thu, 16 Oct 2025 11:14:53 GMT, Albert Mingkun Yang wrote: >> The explicit usage of `Threads::change_thread_claim_token` and `Threads::assert_all_threads_claimed` in `ShenandoahThreadRoots` can be replaced with `ThreadsClaimTokenScope`. >> >> Passes tier1, tier2, tier[1,2,3]_gc_shenandoah (fastdebug). > > Marked as reviewed by ayang (Reviewer). Thanks for the review @albertnetymk and @earthling-amzn. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27845#issuecomment-3414666821 From duke at openjdk.org Fri Oct 17 09:43:04 2025 From: duke at openjdk.org (duke) Date: Fri, 17 Oct 2025 09:43:04 GMT Subject: RFR: 8369980: Use ThreadsClaimTokenScope in ShenandoahThreadRoots In-Reply-To: References: Message-ID: On Thu, 16 Oct 2025 11:02:50 GMT, Francesco Andreuzzi wrote: > The explicit usage of `Threads::change_thread_claim_token` and `Threads::assert_all_threads_claimed` in `ShenandoahThreadRoots` can be replaced with `ThreadsClaimTokenScope`. > > Passes tier1, tier2, tier[1,2,3]_gc_shenandoah (fastdebug). @fandreuz Your change (at version 42b50e908a49cf3378c36b44ec8c0f66efb5288d) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27845#issuecomment-3414669462 From shade at openjdk.org Fri Oct 17 09:50:13 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Fri, 17 Oct 2025 09:50:13 GMT Subject: RFR: 8241066: Shenandoah: fix or cleanup SH::do_full_collection In-Reply-To: References: Message-ID: On Thu, 16 Oct 2025 19:02:16 GMT, William Kemper wrote: > This `ShenandoahHeap::do_full_collection` will never be called by our implementation of `collect_as_vm_thread`. Marked as reviewed by shade (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27853#pullrequestreview-3349159907 From andrew at openjdk.org Fri Oct 17 12:25:31 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 17 Oct 2025 12:25:31 GMT Subject: RFR: Merge jdk8u:master Message-ID: Merge jdk8u472-b04 Windows x86_64 builds will be resolved by updating the FreeType build's Windows SDK [JDK-8366112](https://bugs.openjdk.org/browse/JDK-8366112) in b06 ------------- Commit messages: - Merge jdk8u472-b04 - 7102969: currency.properties supercede not working correctly - 8345414: Google CAInterop test failures The merge commit only contains trivial merges, so no merge-specific webrevs have been generated. Changes: https://git.openjdk.org/shenandoah-jdk8u/pull/110/files Stats: 399 lines in 8 files changed: 289 ins; 42 del; 68 mod Patch: https://git.openjdk.org/shenandoah-jdk8u/pull/110.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk8u.git pull/110/head:pull/110 PR: https://git.openjdk.org/shenandoah-jdk8u/pull/110 From fandreuzzi at openjdk.org Fri Oct 17 14:22:16 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Fri, 17 Oct 2025 14:22:16 GMT Subject: Integrated: 8369980: Use ThreadsClaimTokenScope in ShenandoahThreadRoots In-Reply-To: References: Message-ID: <8lsZJbG1d8-GGZdyXQiwtY4gWAWFreX4StEVakabmeU=.719eaec5-61d8-4a0c-ab68-ced40c990774@github.com> On Thu, 16 Oct 2025 11:02:50 GMT, Francesco Andreuzzi wrote: > The explicit usage of `Threads::change_thread_claim_token` and `Threads::assert_all_threads_claimed` in `ShenandoahThreadRoots` can be replaced with `ThreadsClaimTokenScope`. > > Passes tier1, tier2, tier[1,2,3]_gc_shenandoah (fastdebug). This pull request has now been integrated. Changeset: b159ca09 Author: Francesco Andreuzzi Committer: Aleksey Shipilev URL: https://git.openjdk.org/jdk/commit/b159ca097a71407d0bc10f6c5d86d5f45c7d7642 Stats: 11 lines in 2 files changed: 2 ins; 5 del; 4 mod 8369980: Use ThreadsClaimTokenScope in ShenandoahThreadRoots Reviewed-by: ayang, wkemper ------------- PR: https://git.openjdk.org/jdk/pull/27845 From andrew at openjdk.org Fri Oct 17 14:24:52 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 17 Oct 2025 14:24:52 GMT Subject: git: openjdk/shenandoah-jdk8u: master: 3 new changesets Message-ID: <03b29f2f-5947-4e09-995a-96ecf66a3f0a@openjdk.org> Changeset: 1b94cbfa Branch: master Author: Andrew John Hughes Date: 2025-08-13 11:07:14 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/1b94cbfabcb238da175846372ad26cc3434e77ba 8345414: Google CAInterop test failures Reviewed-by: sgehwolf Backport-of: e61f97d3ac3ae1cc3f807abcc10d3f405ab69852 ! jdk/test/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java Changeset: 89b85a8f Branch: master Author: Severin Gehwolf Date: 2025-08-13 13:55:35 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/89b85a8f5b0f8e4f7763cf9b4d15e051d6e9f43f 7102969: currency.properties supercede not working correctly 8157138: Error while fetching currency instance by Currency.getInstance(currencycode) Reviewed-by: andrew Backport-of: 93f4f6c1b50c17bf713a2cfa806e64a8d73d6770 ! jdk/make/src/classes/build/tools/generatecurrencydata/GenerateCurrencyData.java ! jdk/src/share/classes/java/util/Currency.java ! jdk/src/share/classes/java/util/CurrencyData.properties ! jdk/test/java/util/Currency/ISO4217-list-one.txt ! jdk/test/java/util/Currency/PropertiesTest.java ! jdk/test/java/util/Currency/PropertiesTest.sh ! jdk/test/java/util/Currency/currency.properties Changeset: 383898ee Branch: master Author: Andrew John Hughes Date: 2025-10-17 00:32:23 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/383898ee9c34930637e01804bd0bb0015a21f8cc Merge jdk8u472-b04 Added tag jdk8u472-b04 for changeset 89b85a8f5b0 From duke at openjdk.org Fri Oct 17 14:25:08 2025 From: duke at openjdk.org (duke) Date: Fri, 17 Oct 2025 14:25:08 GMT Subject: git: openjdk/shenandoah-jdk8u: Added tag jdk8u472-b04 for changeset 89b85a8f Message-ID: Tagged by: Andrew Hughes Date: 2025-08-20 18:08:15 +0000 Added tag jdk8u472-b04 for changeset 89b85a8f5b0 Changeset: 89b85a8f Author: Severin Gehwolf Date: 2025-08-13 13:55:35 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/89b85a8f5b0f8e4f7763cf9b4d15e051d6e9f43f From andrew at openjdk.org Fri Oct 17 14:24:53 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 17 Oct 2025 14:24:53 GMT Subject: RFR: Merge jdk8u:master [v2] In-Reply-To: References: Message-ID: > Merge jdk8u472-b04 > > Windows x86_64 builds will be resolved by updating the FreeType build's Windows SDK [JDK-8366112](https://bugs.openjdk.org/browse/JDK-8366112) in b06 Andrew John Hughes 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. ------------- Changes: - all: https://git.openjdk.org/shenandoah-jdk8u/pull/110/files - new: https://git.openjdk.org/shenandoah-jdk8u/pull/110/files/383898ee..383898ee Webrevs: - full: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=110&range=01 - incr: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=110&range=00-01 Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/shenandoah-jdk8u/pull/110.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk8u.git pull/110/head:pull/110 PR: https://git.openjdk.org/shenandoah-jdk8u/pull/110 From iris at openjdk.org Fri Oct 17 14:24:54 2025 From: iris at openjdk.org (Iris Clark) Date: Fri, 17 Oct 2025 14:24:54 GMT Subject: Withdrawn: Merge jdk8u:master In-Reply-To: References: Message-ID: On Fri, 17 Oct 2025 12:20:24 GMT, Andrew John Hughes wrote: > Merge jdk8u472-b04 > > Windows x86_64 builds will be resolved by updating the FreeType build's Windows SDK [JDK-8366112](https://bugs.openjdk.org/browse/JDK-8366112) in b06 This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/shenandoah-jdk8u/pull/110 From andrew at openjdk.org Fri Oct 17 14:25:10 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 17 Oct 2025 14:25:10 GMT Subject: git: openjdk/shenandoah-jdk8u: Added tag shenandoah8u472-b04 for changeset 383898ee Message-ID: Tagged by: Andrew John Hughes Date: 2025-10-17 15:10:54 +0000 Added tag shenandoah8u472-b04 for changeset 383898ee9c3 -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRRMled0VQO0j4ExaDP2g+bNZZCIgUCaPJObgAKCRDP2g+bNZZC Il84AP9skjpnPVQTPeaU2UrLoqjz4n9XhSFgX37somSk/LZtKAEAmRcebhqYPe9V h71Ka/FgXUY8b/Ybj0KBVPLv6KLqFgU= =9GrP -----END PGP SIGNATURE----- Changeset: 383898ee Author: Andrew John Hughes Date: 2025-10-17 00:32:23 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/383898ee9c34930637e01804bd0bb0015a21f8cc From wkemper at openjdk.org Fri Oct 17 16:57:13 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 17 Oct 2025 16:57:13 GMT Subject: Integrated: 8241066: Shenandoah: fix or cleanup SH::do_full_collection In-Reply-To: References: Message-ID: On Thu, 16 Oct 2025 19:02:16 GMT, William Kemper wrote: > This `ShenandoahHeap::do_full_collection` will never be called by our implementation of `collect_as_vm_thread`. This pull request has now been integrated. Changeset: f84be36d Author: William Kemper URL: https://git.openjdk.org/jdk/commit/f84be36dd59ae6b00aea334944b8266ecf8f5cbd Stats: 6 lines in 1 file changed: 3 ins; 0 del; 3 mod 8241066: Shenandoah: fix or cleanup SH::do_full_collection Reviewed-by: shade ------------- PR: https://git.openjdk.org/jdk/pull/27853 From andrew at openjdk.org Fri Oct 17 17:17:50 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 17 Oct 2025 17:17:50 GMT Subject: RFR: Merge jdk8u:master Message-ID: Merge jdk8u472-b05 Windows x86_64 builds will be resolved by updating the FreeType build's Windows SDK [JDK-8366112](https://bugs.openjdk.org/browse/JDK-8366112) in b06 ------------- Commit messages: - Merge jdk8u472-b05 - 8365560: [8u] ppc64le MaxRAM default is too low at 4GiB The merge commit only contains trivial merges, so no merge-specific webrevs have been generated. Changes: https://git.openjdk.org/shenandoah-jdk8u/pull/111/files Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/shenandoah-jdk8u/pull/111.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk8u.git pull/111/head:pull/111 PR: https://git.openjdk.org/shenandoah-jdk8u/pull/111 From kdnilsen at openjdk.org Fri Oct 17 17:20:19 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 17 Oct 2025 17:20:19 GMT Subject: Integrated: 8368681: Shenandoah: Add documentation comments for ShenandoahAllocationRate In-Reply-To: References: Message-ID: On Thu, 25 Sep 2025 23:33:56 GMT, Kelvin Nilsen wrote: > Add documentation to ShenandoahAllocationRate This pull request has now been integrated. Changeset: a3e41ea6 Author: Kelvin Nilsen URL: https://git.openjdk.org/jdk/commit/a3e41ea6c60eb278da93dbc2daf940f0dc9abd11 Stats: 44 lines in 2 files changed: 44 ins; 0 del; 0 mod 8368681: Shenandoah: Add documentation comments for ShenandoahAllocationRate Reviewed-by: wkemper, xpeng ------------- PR: https://git.openjdk.org/jdk/pull/27505 From andrew at openjdk.org Fri Oct 17 17:26:18 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 17 Oct 2025 17:26:18 GMT Subject: git: openjdk/shenandoah-jdk8u: master: 2 new changesets Message-ID: Changeset: 2821dcef Branch: master Author: Jonathan Dowland Date: 2025-08-18 09:42:47 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/2821dcef9484b0a551d1c6b4ab014892ab07b55a 8365560: [8u] ppc64le MaxRAM default is too low at 4GiB Reviewed-by: stuefe ! hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp Changeset: 228f82a8 Branch: master Author: Andrew John Hughes Date: 2025-10-17 15:21:12 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/228f82a893740003c935159f5d8c4a46d7985920 Merge jdk8u472-b05 Added tag jdk8u472-b05 for changeset 2821dcef948 From duke at openjdk.org Fri Oct 17 17:26:27 2025 From: duke at openjdk.org (duke) Date: Fri, 17 Oct 2025 17:26:27 GMT Subject: git: openjdk/shenandoah-jdk8u: Added tag jdk8u472-b05 for changeset 2821dcef Message-ID: <9da40367-3831-48fa-af21-9c49dac1086a@openjdk.org> Tagged by: Andrew Hughes Date: 2025-08-27 13:19:59 +0000 Added tag jdk8u472-b05 for changeset 2821dcef948 Changeset: 2821dcef Author: Jonathan Dowland Date: 2025-08-18 09:42:47 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/2821dcef9484b0a551d1c6b4ab014892ab07b55a From andrew at openjdk.org Fri Oct 17 17:26:29 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 17 Oct 2025 17:26:29 GMT Subject: git: openjdk/shenandoah-jdk8u: Added tag shenandoah8u472-b05 for changeset 228f82a8 Message-ID: <16d6ec0d-c252-4682-a8eb-f9c42ba639d0@openjdk.org> Tagged by: Andrew John Hughes Date: 2025-10-17 18:23:41 +0000 Added tag shenandoah8u472-b05 for changeset 228f82a8937 -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRRMled0VQO0j4ExaDP2g+bNZZCIgUCaPJ7nQAKCRDP2g+bNZZC IjpYAP9VCF4TRuLsDkXaQ0FUpUgVEQoSwNmLSnMX43TZ3A+jhwD6Aj04Y0gIRpaU bP9qd0SZjoFAGNoNNL/QFyC4UL7e4g8= =WLY4 -----END PGP SIGNATURE----- Changeset: 228f82a8 Author: Andrew John Hughes Date: 2025-10-17 15:21:12 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/228f82a893740003c935159f5d8c4a46d7985920 From andrew at openjdk.org Fri Oct 17 17:27:31 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 17 Oct 2025 17:27:31 GMT Subject: RFR: Merge jdk8u:master [v2] In-Reply-To: References: Message-ID: > Merge jdk8u472-b05 > > Windows x86_64 builds will be resolved by updating the FreeType build's Windows SDK [JDK-8366112](https://bugs.openjdk.org/browse/JDK-8366112) in b06 Andrew John Hughes 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. ------------- Changes: - all: https://git.openjdk.org/shenandoah-jdk8u/pull/111/files - new: https://git.openjdk.org/shenandoah-jdk8u/pull/111/files/228f82a8..228f82a8 Webrevs: - full: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=111&range=01 - incr: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=111&range=00-01 Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/shenandoah-jdk8u/pull/111.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk8u.git pull/111/head:pull/111 PR: https://git.openjdk.org/shenandoah-jdk8u/pull/111 From iris at openjdk.org Fri Oct 17 17:27:32 2025 From: iris at openjdk.org (Iris Clark) Date: Fri, 17 Oct 2025 17:27:32 GMT Subject: Withdrawn: Merge jdk8u:master In-Reply-To: References: Message-ID: On Fri, 17 Oct 2025 17:13:07 GMT, Andrew John Hughes wrote: > Merge jdk8u472-b05 > > Windows x86_64 builds will be resolved by updating the FreeType build's Windows SDK [JDK-8366112](https://bugs.openjdk.org/browse/JDK-8366112) in b06 This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/shenandoah-jdk8u/pull/111 From wkemper at openjdk.org Fri Oct 17 17:43:15 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 17 Oct 2025 17:43:15 GMT Subject: RFR: 8369048: GenShen: Defer ShenFreeSet::available() during rebuild In-Reply-To: <_PEoOc0oWb8Vzq16-Or_hykkL4NkIrwEFgLCgCRac5U=.2c23c497-acbe-48f9-a1dc-4eb4e8f25a8d@github.com> References: <_PEoOc0oWb8Vzq16-Or_hykkL4NkIrwEFgLCgCRac5U=.2c23c497-acbe-48f9-a1dc-4eb4e8f25a8d@github.com> Message-ID: On Thu, 2 Oct 2025 17:58:48 GMT, Kelvin Nilsen wrote: > This code introduces a new rebuild-freeset lock for purposes of coordinating the freeset rebuild activities and queries as to memory available for allocation in the mutator partition. > > This addresses a problem that results if available memory is probed while we are rebuilding the freeset. > > Rather than using the existing global heap lock to synchronize these activities, a new more narrowly scoped lock is introduced. This allows the available memory to be probed even when other activities hold the global heap lock for reasons other than rebuilding the freeset, such as when they are allocating memory. It is known that the global heap lock is heavily contended for certain workloads, and using this new lock avoids adding to contention for the global heap lock. If I understand correctly, the general issue is that `available` is not accurate when the freeset is being rebuilt. There are three solutions tested: 1. Existing code, returns a sentinel value (`SIZE_MAX`) during freeset rebuilt 2. Return the last known value of `available` during the rebuild (this appears to cause more aggressive heuristics) 3. Block threads that call `available` during rebuild As it stands, only the regulator thread (which is evaluating heuristics for genshen) will call `available` during a free set rebuild (though this may change in the future). With the first solution, it seems we would have the heuristics believe there is much more memory available than there actually is. This would risk the heuristic not triggering when it should? It makes sense that option `2` would trigger more GCs than option `1`, but it seems the risk of triggering too late would be lower here. Option `3` might also delay triggering, but at least the heuristic would base the trigger decision on an accurate accounting of available memory. If we go with the third option, I think we should move the lock management into the freeset and not have to change existing callers. void ShenandoahFreeSet::prepare_to_rebuild(...) { _lock.lock(); // do preparation // ... } void ShenandoahFreeSet::finish_rebuild(...) { // finish rebuild // ... _lock.unlock(); } Could we also now remove the sentinel value (`FreeSetUnderConstruction`)? ------------- Changes requested by wkemper (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27612#pullrequestreview-3351287418 From andrew at openjdk.org Fri Oct 17 17:49:52 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 17 Oct 2025 17:49:52 GMT Subject: RFR: Merge jdk8u:master Message-ID: Merge jdk8u472-b06 ------------- Commit messages: - Merge jdk8u472-b06 - 8361212: Remove AffirmTrust root CAs - 8160767: [TEST_BUG] java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java - 8041924: [TESTBUG] sun/net/www/http/ChunkedOutputStream/checkError.java fails on some systems - 8056283: @ignore tools/javac/defaultMethods/Assertions.java until JDK-8047675 is fixed - 8365811: test/jdk/java/net/CookieHandler/B6644726.java failure - "Should have 5 cookies. Got only 4, expires probably didn't parse correctly" - 8366112: [8u] GHA: Fix broken installation of Windows SDK - 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests. The merge commit only contains trivial merges, so no merge-specific webrevs have been generated. Changes: https://git.openjdk.org/shenandoah-jdk8u/pull/112/files Stats: 1740 lines in 97 files changed: 279 ins; 1087 del; 374 mod Patch: https://git.openjdk.org/shenandoah-jdk8u/pull/112.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk8u.git pull/112/head:pull/112 PR: https://git.openjdk.org/shenandoah-jdk8u/pull/112 From andrew at openjdk.org Fri Oct 17 21:30:26 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 17 Oct 2025 21:30:26 GMT Subject: git: openjdk/shenandoah-jdk8u: master: 8 new changesets Message-ID: <7eb002c8-d833-4d1d-acc7-0141fabffa18@openjdk.org> Changeset: cc30193d Branch: master Author: yaqsun <62052878+yaqsun at users.noreply.github.com> Committer: Severin Gehwolf Date: 2025-08-26 08:37:02 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/cc30193d1bd7ab9217f2c7b6d08de612c558cd96 8185500: [TESTBUG] Add keywords headful/printer in java/awt and javax tests. 8186259: IOExceptionIfEncodedURLTest.sh versus IOExceptionIfEncodedURLTest.java Add new keyword 'printer'. Some minor test fixes to show headless exception. Add some @requires windows. Reviewed-by: serb Backport-of: 34afeced211cd7115e2529b043c1e57dfa1291fe ! jdk/test/TEST.ROOT ! jdk/test/com/apple/eawt/DefaultMenuBar/DefaultMenuBarTest.java ! jdk/test/com/apple/laf/ScreenMenu/ScreenMenuMemoryLeakTest.java ! jdk/test/java/awt/Desktop/DesktopGtkLoadTest/DesktopGtkLoadTest.java ! jdk/test/java/awt/Dialog/CloseDialog/CloseDialogTest.java ! jdk/test/java/awt/EmbeddedFrame/DisplayChangedTest/DisplayChangedTest.java ! jdk/test/java/awt/EmbeddedFrame/EmbeddedFrameGrabTest/EmbeddedFrameGrabTest.java ! jdk/test/java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.html ! jdk/test/java/awt/EventQueue/6980209/bug6980209.java ! jdk/test/java/awt/Focus/FocusEmbeddedFrameTest/FocusEmbeddedFrameTest.java ! jdk/test/java/awt/FontClass/HelvLtOblTest.java ! jdk/test/java/awt/FontClass/SurrogateTest/SuppCharTest.java ! jdk/test/java/awt/Frame/ExceptionOnSetExtendedStateTest/ExceptionOnSetExtendedStateTest.java ! jdk/test/java/awt/Frame/MaximizedByPlatform/MaximizedByPlatform.java ! jdk/test/java/awt/Frame/NormalToIconified/NormalToIconifiedTest.java ! jdk/test/java/awt/Frame/SetMaximizedBounds/SetMaximizedBounds.java ! jdk/test/java/awt/Frame/WindowDragTest/WindowDragTest.java ! jdk/test/java/awt/KeyboardFocusmanager/DefaultPolicyChange/DefaultPolicyChange_Swing.java ! jdk/test/java/awt/MenuBar/8007006/bug8007006.java ! jdk/test/java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java ! jdk/test/java/awt/SplashScreen/FullscreenAfterSplash/FullScreenAfterSplash.java ! jdk/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/IOExceptionIfEncodedURLTest.java ! jdk/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/IOExceptionIfEncodedURLTest.sh ! jdk/test/java/awt/datatransfer/DragImage/MultiResolutionDragImageTest.java ! jdk/test/java/awt/datatransfer/HTMLDataFlavors/HTMLDataFlavorTest.java ! jdk/test/java/awt/event/KeyEvent/8020209/bug8020209.java ! jdk/test/java/awt/event/KeyEvent/DeadKey/DeadKeyMacOSXInputText.java ! jdk/test/java/awt/event/KeyEvent/DeadKey/deadKeyMacOSX.java ! jdk/test/java/awt/font/TextLayout/TestSinhalaChar.java ! jdk/test/java/awt/im/6396526/IMLookAndFeel.java ! jdk/test/java/awt/im/8041990/bug8041990.java ! jdk/test/java/awt/image/MultiResolutionImageTest.java ! jdk/test/java/awt/image/multiresolution/MultiResolutionToolkitImageTest.java ! jdk/test/java/awt/keyboard/AltPlusNumberKeyCombinationsTest/AltPlusNumberKeyCombinationsTest.java ! jdk/test/java/awt/print/PrinterJob/CheckPrivilege.java ! jdk/test/java/awt/print/PrinterJob/ExceptionTest.java ! jdk/test/java/awt/print/PrinterJob/ImagePrinting/NullClipARGB.java ! jdk/test/java/awt/print/PrinterJob/Margins.java ! jdk/test/java/awt/print/PrinterJob/PaintText.java ! jdk/test/java/awt/print/PrinterJob/PrintCrashTest.java ! jdk/test/java/awt/print/PrinterJob/PrintTextPane.java ! jdk/test/java/awt/print/PrinterJob/PrtException.java ! jdk/test/javax/print/CheckDupFlavor.java ! jdk/test/javax/print/PrintSE/PrintSE.sh ! jdk/test/javax/print/attribute/AttributeTest.java ! jdk/test/javax/print/attribute/GetCopiesSupported.java ! jdk/test/javax/print/attribute/SidesPageRangesTest.java ! jdk/test/javax/print/attribute/SupportedPrintableAreas.java ! jdk/test/javax/swing/JComboBox/8019180/Test8019180.java ! jdk/test/javax/swing/JComponent/4337267/bug4337267.java ! jdk/test/javax/swing/JComponent/8043610/bug8043610.java ! jdk/test/javax/swing/JDialog/6639507/bug6639507.java ! jdk/test/javax/swing/JFileChooser/6713352/bug6713352.java ! jdk/test/javax/swing/JFileChooser/6817933/Test6817933.java ! jdk/test/javax/swing/JFileChooser/8013442/Test8013442.java ! jdk/test/javax/swing/JFrame/8016356/bug8016356.java ! jdk/test/javax/swing/JFrame/NSTexturedJFrame/NSTexturedJFrame.java ! jdk/test/javax/swing/JInternalFrame/Test6325652.java ! jdk/test/javax/swing/JMenu/6538132/bug6538132.java ! jdk/test/javax/swing/JMenuItem/8152981/MenuItemIconTest.java ! jdk/test/javax/swing/JMenuItem/ActionListenerCalledTwice/ActionListenerCalledTwiceTest.java ! jdk/test/javax/swing/JPopupMenu/6217905/bug6217905.java ! jdk/test/javax/swing/JPopupMenu/7154841/bug7154841.java ! jdk/test/javax/swing/JTabbedPane/7170310/bug7170310.java ! jdk/test/javax/swing/JTextArea/6940863/bug6940863.java ! jdk/test/javax/swing/Security/6938813/bug6938813.java ! jdk/test/javax/swing/ToolTipManager/7123767/bug7123767.java ! jdk/test/javax/swing/plaf/aqua/CustomComboBoxFocusTest.java ! jdk/test/javax/swing/plaf/basic/BasicComboPopup/8154069/Bug8154069.java ! jdk/test/javax/swing/plaf/basic/BasicHTML/4960629/bug4960629.java ! jdk/test/javax/swing/plaf/basic/BasicLabelUI/bug7172652.java ! jdk/test/javax/swing/plaf/nimbus/8041642/ScrollBarThumbVisibleTest.java ! jdk/test/javax/swing/plaf/windows/WindowsRootPaneUI/WrongAltProcessing/WrongAltProcessing.java ! jdk/test/javax/swing/system/6799345/TestShutdown.java ! jdk/test/javax/swing/text/FlowView/LayoutTest.java ! jdk/test/javax/swing/text/View/8015853/bug8015853.java ! jdk/test/javax/swing/text/html/Test4783068.java ! jdk/test/sun/java2d/DirectX/IAEforEmptyFrameTest/IAEforEmptyFrameTest.java Changeset: 41e6bf7d Branch: master Author: Zdenek Zambersky Date: 2025-08-26 12:06:22 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/41e6bf7d1f6a0b576c46c1f00e2c4cbc89a48a96 8366112: [8u] GHA: Fix broken installation of Windows SDK Reviewed-by: sgehwolf ! .github/workflows/freetype.vcxproj ! .github/workflows/submit.yml Changeset: 7fea4115 Branch: master Author: SendaoYan Committer: Severin Gehwolf Date: 2025-08-27 08:29:26 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/7fea4115570935878cc8b13704c6af0ad63a3a75 8365811: test/jdk/java/net/CookieHandler/B6644726.java failure - "Should have 5 cookies. Got only 4, expires probably didn't parse correctly" Reviewed-by: sgehwolf Backport-of: b453eb63c641e1e69b4aef57a220ebe45b9d1693 ! jdk/test/java/net/CookieHandler/B6644726.java Changeset: f362183b Branch: master Author: SendaoYan Committer: Severin Gehwolf Date: 2025-08-28 08:37:58 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/f362183b50937f7e7ab34427f2ab2c8fab895e20 8056283: @ignore tools/javac/defaultMethods/Assertions.java until JDK-8047675 is fixed Backport-of: d66c4567eea47bd74037b49acbd85d71a2cf239a ! langtools/test/tools/javac/defaultMethods/Assertions.java Changeset: 1d7e1018 Branch: master Author: SendaoYan Committer: Severin Gehwolf Date: 2025-08-28 08:38:22 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/1d7e10189fecbe673f5873f298a6d825bfbc1888 8041924: [TESTBUG] sun/net/www/http/ChunkedOutputStream/checkError.java fails on some systems Reviewed-by: phh Backport-of: 6461c37c9a106cbf07731ef414873ca9dbe5c698 + jdk/test/sun/net/www/http/ChunkedOutputStream/CheckError.java - jdk/test/sun/net/www/http/ChunkedOutputStream/checkError.java Changeset: bb19ce35 Branch: master Author: Taizo Kurashige Committer: Paul Hohensee Date: 2025-08-28 17:58:29 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/bb19ce35ff190c77d0dc030286bfbec0473b6b81 8160767: [TEST_BUG] java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java Reviewed-by: phh Backport-of: b46b19cb58d8b43e57cd81a0588d4e18ad6afa9a ! jdk/test/java/awt/Frame/MaximizedToIconified/MaximizedToIconified.java Changeset: 3f2b6ffe Branch: master Author: Severin Gehwolf Date: 2025-09-01 08:19:47 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/3f2b6ffee4b2a077f5fc8e00d58bce906a80cca0 8361212: Remove AffirmTrust root CAs Reviewed-by: andrew Backport-of: 5173435bfd0db5db0113a6209f2f827b16598596 - jdk/make/data/cacerts/affirmtrustcommercialca - jdk/make/data/cacerts/affirmtrustnetworkingca - jdk/make/data/cacerts/affirmtrustpremiumca - jdk/make/data/cacerts/affirmtrustpremiumeccca ! jdk/src/share/classes/sun/security/validator/EntrustTLSPolicy.java ! jdk/test/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java ! jdk/test/sun/security/lib/cacerts/VerifyCACerts.java ! jdk/test/sun/security/ssl/X509TrustManagerImpl/distrust/Entrust.java - jdk/test/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustcommercialca-chain.pem - jdk/test/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustnetworkingca-chain.pem - jdk/test/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumca-chain.pem - jdk/test/sun/security/ssl/X509TrustManagerImpl/distrust/chains/entrust/affirmtrustpremiumeccca-chain.pem Changeset: 3c6f270b Branch: master Author: Andrew John Hughes Date: 2025-10-17 18:24:04 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/3c6f270b66b63ad42126572e4796abe6d1f541a2 Merge jdk8u472-b06 Added tag jdk8u472-b06 for changeset 3f2b6ffee4b From duke at openjdk.org Fri Oct 17 21:30:36 2025 From: duke at openjdk.org (duke) Date: Fri, 17 Oct 2025 21:30:36 GMT Subject: git: openjdk/shenandoah-jdk8u: Added tag jdk8u472-b06 for changeset 3f2b6ffe Message-ID: Tagged by: Andrew Hughes Date: 2025-09-01 14:33:32 +0000 Added tag jdk8u472-b06 for changeset 3f2b6ffee4b Changeset: 3f2b6ffe Author: Severin Gehwolf Date: 2025-09-01 08:19:47 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/3f2b6ffee4b2a077f5fc8e00d58bce906a80cca0 From andrew at openjdk.org Fri Oct 17 21:30:40 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 17 Oct 2025 21:30:40 GMT Subject: git: openjdk/shenandoah-jdk8u: Added tag shenandoah8u472-b06 for changeset 3c6f270b Message-ID: <3b166e61-a456-4c7f-8fb8-a7cbc4292011@openjdk.org> Tagged by: Andrew John Hughes Date: 2025-10-17 22:28:48 +0000 Added tag shenandoah8u472-b06 for changeset 3c6f270b66b -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRRMled0VQO0j4ExaDP2g+bNZZCIgUCaPK1EAAKCRDP2g+bNZZC Irh0APsF6U7W4Xi8tX4LjSsqeMrkLwfwZf3+O5vOXavVZiIgnQEA3YvIHTEeW3zO BAGfFG5rX1npzs2AB1Bn/CWYswnsjA8= =OH1Q -----END PGP SIGNATURE----- Changeset: 3c6f270b Author: Andrew John Hughes Date: 2025-10-17 18:24:04 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/3c6f270b66b63ad42126572e4796abe6d1f541a2 From andrew at openjdk.org Fri Oct 17 21:32:18 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 17 Oct 2025 21:32:18 GMT Subject: RFR: Merge jdk8u:master [v2] In-Reply-To: References: Message-ID: > Merge jdk8u472-b06 Andrew John Hughes 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. ------------- Changes: - all: https://git.openjdk.org/shenandoah-jdk8u/pull/112/files - new: https://git.openjdk.org/shenandoah-jdk8u/pull/112/files/3c6f270b..3c6f270b Webrevs: - full: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=112&range=01 - incr: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=112&range=00-01 Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/shenandoah-jdk8u/pull/112.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk8u.git pull/112/head:pull/112 PR: https://git.openjdk.org/shenandoah-jdk8u/pull/112 From iris at openjdk.org Fri Oct 17 21:32:19 2025 From: iris at openjdk.org (Iris Clark) Date: Fri, 17 Oct 2025 21:32:19 GMT Subject: Withdrawn: Merge jdk8u:master In-Reply-To: References: Message-ID: On Fri, 17 Oct 2025 17:45:07 GMT, Andrew John Hughes wrote: > Merge jdk8u472-b06 This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/shenandoah-jdk8u/pull/112 From andrew at openjdk.org Fri Oct 17 22:06:49 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Fri, 17 Oct 2025 22:06:49 GMT Subject: RFR: Merge jdk8u:master Message-ID: Merge jdk8u472-b07 ------------- Commit messages: - Merge jdk8u472-b07 - 8365389: Remove static color fields from SwingUtilities3 and WindowsMenuItemUI - 8368308: ISO 4217 Amendment 180 Update - 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel The merge commit only contains trivial merges, so no merge-specific webrevs have been generated. Changes: https://git.openjdk.org/shenandoah-jdk8u/pull/113/files Stats: 676 lines in 11 files changed: 557 ins; 83 del; 36 mod Patch: https://git.openjdk.org/shenandoah-jdk8u/pull/113.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk8u.git pull/113/head:pull/113 PR: https://git.openjdk.org/shenandoah-jdk8u/pull/113 From ysr at openjdk.org Fri Oct 17 22:19:00 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Fri, 17 Oct 2025 22:19:00 GMT Subject: RFR: 8369447: GenShen: Regulator thread may observe inconsistent states In-Reply-To: <5Qa66lljxDIXH8mOo9oyCZTDjZ2OyhgHsurqkfKKhGY=.a784a918-bb7b-4a86-bad6-195ee1800650@github.com> References: <5Qa66lljxDIXH8mOo9oyCZTDjZ2OyhgHsurqkfKKhGY=.a784a918-bb7b-4a86-bad6-195ee1800650@github.com> Message-ID: On Wed, 8 Oct 2025 18:46:15 GMT, William Kemper wrote: > Shenandoah's generational mode runs a separate thread to monitor the heap during old collections. This thread is responsible for deciding to start collections. When the thread which actually runs collections (the control thread) changes the state of various gc components _on a safepoint_, it has the expectation that these changes will become visible to mutator threads atomically, and consistently. However, the regulator thread does not participate in safepoints and may observe gc components in inconsistent states and so make incorrect choices about trying to start GC cycles. > > For example: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # Internal Error (src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp:625), pid=3796044, tid=3796163 > # assert(_old_generation->state() == ShenandoahOldGeneration::MARKING) failed: Unexpected old gen state: Waiting for Bootstrap > # > > The solution here is to make the regulator thread participate in safepoints. There is no need for it to run during a safepoint. Nice! ? ------------- Marked as reviewed by ysr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27702#pullrequestreview-3352286714 From ysr at openjdk.org Fri Oct 17 23:01:07 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Fri, 17 Oct 2025 23:01:07 GMT Subject: RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure [v2] In-Reply-To: References: Message-ID: On Tue, 14 Oct 2025 23:03:16 GMT, William Kemper wrote: >> There are certain code paths in Shenandoah's generational mode that need to _know_ which generation is being collected, but it is not possible to pass this information on the stack (barriers, for example). To address this, we introduced an `_active_generation` member in `ShenandoahHeap`. Over time, the usage of this field grew beyond its intended purpose and we began to have issues where not all threads would see a consistent value for this field. To address _this_ issue, we added another field `_gc_generation` which was only meant to be used by GC threads. At this point, we have three different ways to determine which generation is being collected: the _active_ generation, the _gc_ generation, and the usual function parameters and member fields of the gc components. This PR removes `_gc_generation` and reduces the use of `_active_generation` to only those places where it is not possible to get this information from other means (barriers, mostly). All GC components that can have t his information passed through function calls, now do so. > > William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: > > - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage > - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage > - Remove _gc_generation from ShenandoahHeap > - Little cleanup, remove one active generation usage > - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage > - Finish removing usages of gc_generation, start on reducing usages of active_generation > - Fix build > - Use existing _generation field instead of Heap::_gc_generation where possible > - Only shenandoah vm operations participate in active/gc generation scheme @earthling-amzn : is it possible to add the stack retrace and the test that elicited the assertion failure to the ticket as an archival forensic trail? ------------- PR Comment: https://git.openjdk.org/jdk/pull/27703#issuecomment-3417455849 From wkemper at openjdk.org Fri Oct 17 23:53:12 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 17 Oct 2025 23:53:12 GMT Subject: Integrated: 8369447: GenShen: Regulator thread may observe inconsistent states In-Reply-To: <5Qa66lljxDIXH8mOo9oyCZTDjZ2OyhgHsurqkfKKhGY=.a784a918-bb7b-4a86-bad6-195ee1800650@github.com> References: <5Qa66lljxDIXH8mOo9oyCZTDjZ2OyhgHsurqkfKKhGY=.a784a918-bb7b-4a86-bad6-195ee1800650@github.com> Message-ID: On Wed, 8 Oct 2025 18:46:15 GMT, William Kemper wrote: > Shenandoah's generational mode runs a separate thread to monitor the heap during old collections. This thread is responsible for deciding to start collections. When the thread which actually runs collections (the control thread) changes the state of various gc components _on a safepoint_, it has the expectation that these changes will become visible to mutator threads atomically, and consistently. However, the regulator thread does not participate in safepoints and may observe gc components in inconsistent states and so make incorrect choices about trying to start GC cycles. > > For example: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # Internal Error (src/hotspot/share/gc/shenandoah/heuristics/shenandoahOldHeuristics.cpp:625), pid=3796044, tid=3796163 > # assert(_old_generation->state() == ShenandoahOldGeneration::MARKING) failed: Unexpected old gen state: Waiting for Bootstrap > # > > The solution here is to make the regulator thread participate in safepoints. There is no need for it to run during a safepoint. This pull request has now been integrated. Changeset: 926f61f2 Author: William Kemper URL: https://git.openjdk.org/jdk/commit/926f61f2e358c92cdb7ccdf75c853aa599f4dde3 Stats: 3 lines in 1 file changed: 3 ins; 0 del; 0 mod 8369447: GenShen: Regulator thread may observe inconsistent states Reviewed-by: kdnilsen, ysr ------------- PR: https://git.openjdk.org/jdk/pull/27702 From wkemper at openjdk.org Sat Oct 18 00:22:03 2025 From: wkemper at openjdk.org (William Kemper) Date: Sat, 18 Oct 2025 00:22:03 GMT Subject: RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure [v2] In-Reply-To: References: Message-ID: On Fri, 17 Oct 2025 22:58:20 GMT, Y. Srinivas Ramakrishna wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: >> >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Remove _gc_generation from ShenandoahHeap >> - Little cleanup, remove one active generation usage >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Finish removing usages of gc_generation, start on reducing usages of active_generation >> - Fix build >> - Use existing _generation field instead of Heap::_gc_generation where possible >> - Only shenandoah vm operations participate in active/gc generation scheme > > @earthling-amzn : is it possible to add the stack retrace and the test that elicited the assertion failure to the ticket as an archival forensic trail? @ysramakrishna - Aye, the original, linked ticket has the stack traces and logs: https://bugs.openjdk.org/browse/JDK-8365792. Also a description of our original understanding of the problem in this PR: https://github.com/openjdk/jdk/pull/27373. That understanding is still valid, it's just that `ShenandoahSafepoint::is_at_shenandoah_safepoint` lies when it is called from a concurrent worker thread. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27703#issuecomment-3417557209 From andrew at openjdk.org Sat Oct 18 08:39:45 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Sat, 18 Oct 2025 08:39:45 GMT Subject: git: openjdk/shenandoah-jdk8u: master: 4 new changesets Message-ID: Changeset: 333a5510 Branch: master Author: Antonio Vieiro Committer: Andrew John Hughes Date: 2025-09-26 00:10:57 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/333a55103ed3e480793539f7329bff6e23771047 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel 8365375: Method SU3.setAcceleratorSelectionForeground assigns to acceleratorForeground Reviewed-by: sgehwolf, andrew Backport-of: 31fc05c4721aa1aaf12e5f326a52c1db48006abb ! jdk/src/share/classes/com/sun/java/swing/SwingUtilities3.java ! jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxMenuItemUI.java ! jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsIconFactory.java ! jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java ! jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuUI.java ! jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsRadioButtonMenuItemUI.java ! jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java + jdk/test/javax/swing/JMenuItem/TestRadioAndCheckMenuItemWithIcon.java Changeset: 2e6cbc97 Branch: master Author: Severin Gehwolf Date: 2025-09-26 15:47:15 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/2e6cbc976f558ccbf004f2803d82be70ad20dfde 8368308: ISO 4217 Amendment 180 Update Reviewed-by: andrew Backport-of: 85f5bf3f415cc3d44d1618ec574e73f846bb91c4 ! jdk/src/share/classes/java/util/CurrencyData.properties ! jdk/test/java/util/Currency/ISO4217-list-one.txt ! jdk/test/java/util/Currency/ValidateISO4217.java Changeset: 5cffbcb0 Branch: master Author: Andrew John Hughes Date: 2025-09-26 15:53:13 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/5cffbcb0344f2cf16682a09519894ba705182241 8365389: Remove static color fields from SwingUtilities3 and WindowsMenuItemUI Reviewed-by: sgehwolf Backport-of: 3468c6e5ef7e7592cf9484736ce333fbe0eaf34d ! jdk/src/share/classes/com/sun/java/swing/SwingUtilities3.java ! jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsCheckBoxMenuItemUI.java ! jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuItemUI.java ! jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsMenuUI.java ! jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsRadioButtonMenuItemUI.java ! jdk/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java Changeset: abe20734 Branch: master Author: Andrew John Hughes Date: 2025-10-17 22:29:47 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/abe2073424fd0334f9f9ed48493f340047e2e04f Merge jdk8u472-b07 Added tag jdk8u472-b07 for changeset 5cffbcb0344 From duke at openjdk.org Sat Oct 18 08:39:55 2025 From: duke at openjdk.org (duke) Date: Sat, 18 Oct 2025 08:39:55 GMT Subject: git: openjdk/shenandoah-jdk8u: Added tag jdk8u472-b07 for changeset 5cffbcb0 Message-ID: Tagged by: Andrew Hughes Date: 2025-09-29 17:45:41 +0000 Added tag jdk8u472-b07 for changeset 5cffbcb0344 -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRRMled0VQO0j4ExaDP2g+bNZZCIgUCaNq3tQAKCRDP2g+bNZZC ItX1AP42Iz334eJrZdf8DAdx+xvXM9wAzUmBEYjRBESVu8E3SQD/WvwM+yRlTdG/ 4PrWI2+0E1oU26cme3DZMk4zgYmJEAc= =SRU1 -----END PGP SIGNATURE----- Changeset: 5cffbcb0 Author: Andrew John Hughes Date: 2025-09-26 15:53:13 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/5cffbcb0344f2cf16682a09519894ba705182241 From andrew at openjdk.org Sat Oct 18 08:39:58 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Sat, 18 Oct 2025 08:39:58 GMT Subject: git: openjdk/shenandoah-jdk8u: Added tag shenandoah8u472-b07 for changeset abe20734 Message-ID: <037c211b-0f10-4122-a954-999d97b909b7@openjdk.org> Tagged by: Andrew John Hughes Date: 2025-10-17 23:05:57 +0000 Added tag shenandoah8u472-b07 for changeset abe2073424f -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRRMled0VQO0j4ExaDP2g+bNZZCIgUCaPK9xQAKCRDP2g+bNZZC ImqaAP0WdnEfx/AK43tMI3dpbz5hjQnhMi3g0XjZcHyPZeNnbAD/T5aKoeUzSGBZ v1EKoRk+KW+38fmNSANIxGQpSJr0Kgw= =fCfo -----END PGP SIGNATURE----- Changeset: abe20734 Author: Andrew John Hughes Date: 2025-10-17 22:29:47 +0000 URL: https://git.openjdk.org/shenandoah-jdk8u/commit/abe2073424fd0334f9f9ed48493f340047e2e04f From andrew at openjdk.org Sat Oct 18 08:41:00 2025 From: andrew at openjdk.org (Andrew John Hughes) Date: Sat, 18 Oct 2025 08:41:00 GMT Subject: RFR: Merge jdk8u:master [v2] In-Reply-To: References: Message-ID: <6dIcdNxVSIVKfZ1zgaoRubUYpu2FAmounFfKIcycy1I=.0c6403cb-9f9a-44ac-83e8-be25680c8afb@github.com> > Merge jdk8u472-b07 Andrew John Hughes 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. ------------- Changes: - all: https://git.openjdk.org/shenandoah-jdk8u/pull/113/files - new: https://git.openjdk.org/shenandoah-jdk8u/pull/113/files/abe20734..abe20734 Webrevs: - full: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=113&range=01 - incr: https://webrevs.openjdk.org/?repo=shenandoah-jdk8u&pr=113&range=00-01 Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/shenandoah-jdk8u/pull/113.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk8u.git pull/113/head:pull/113 PR: https://git.openjdk.org/shenandoah-jdk8u/pull/113 From iris at openjdk.org Sat Oct 18 08:41:01 2025 From: iris at openjdk.org (Iris Clark) Date: Sat, 18 Oct 2025 08:41:01 GMT Subject: Withdrawn: Merge jdk8u:master In-Reply-To: References: Message-ID: On Fri, 17 Oct 2025 22:02:00 GMT, Andrew John Hughes wrote: > Merge jdk8u472-b07 This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/shenandoah-jdk8u/pull/113 From kbarrett at openjdk.org Sat Oct 18 17:11:48 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Sat, 18 Oct 2025 17:11:48 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v4] In-Reply-To: References: Message-ID: > Please review this change to the HotSpot Style Guide to suggest that C++ > Standard Library components may be used, after appropriate vetting and > discussion, rather than just a blanket "no, don't use it" with a few very > narrow exceptions. It provides some guidance on that vetting process and > the criteria to use, along with usage patterns. > > In particular, it proposes that Standard Library headers should not be > included directly, but instead through HotSpot-provided wrapper headers. This > gives us a place to document usage, provide workarounds for platform issues in > a single place, and so on. > > Such wrapper headers are provided by this PR for ``, ``, and > ``, along with updates to use them. I have a separate change for > `` that I plan to propose later, under JDK-8369187. There will be > additional followups for other C compatibility headers besides ``. > > This PR also cleans up some nomenclature issues around forbid vs exclude and > the like. > > Testing: mach5 tier1-5, GHA sanity tests Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: - Merge branch 'master' into stdlib-header-wrappers - Merge branch 'master' into stdlib-header-wrappers - Merge branch 'master' into stdlib-header-wrappers - jrose comments - move tuple to undecided category - add wrapper for - add wrapper for - add wrapper for - style guide permits some standard library facilities ------------- Changes: https://git.openjdk.org/jdk/pull/27601/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27601&range=03 Stats: 670 lines in 68 files changed: 430 ins; 134 del; 106 mod Patch: https://git.openjdk.org/jdk/pull/27601.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27601/head:pull/27601 PR: https://git.openjdk.org/jdk/pull/27601 From kdnilsen at openjdk.org Sat Oct 18 22:23:30 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Sat, 18 Oct 2025 22:23:30 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v26] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: After initialization, check for SoftMaxHeapSize changed by constraints enforcement ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/9b36ee38..891e96b8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=25 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=24-25 Stats: 2 lines in 1 file changed: 2 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From lkorinth at openjdk.org Mon Oct 20 09:18:08 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Mon, 20 Oct 2025 09:18:08 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v4] In-Reply-To: References: Message-ID: On Sat, 18 Oct 2025 17:11:48 GMT, Kim Barrett wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: > > - Merge branch 'master' into stdlib-header-wrappers > - Merge branch 'master' into stdlib-header-wrappers > - Merge branch 'master' into stdlib-header-wrappers > - jrose comments > - move tuple to undecided category > - add wrapper for > - add wrapper for > - add wrapper for > - style guide permits some standard library facilities I think this is a nice way forward. I would have liked more of the c++ library included (like tuples, optional and expected), but this is a good start. Thanks for putting so much effort into this!!! ------------- Marked as reviewed by lkorinth (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27601#pullrequestreview-3355641379 From kbarrett at openjdk.org Mon Oct 20 20:56:06 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Mon, 20 Oct 2025 20:56:06 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v4] In-Reply-To: References: Message-ID: On Sat, 18 Oct 2025 17:11:48 GMT, Kim Barrett wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: > > - Merge branch 'master' into stdlib-header-wrappers > - Merge branch 'master' into stdlib-header-wrappers > - Merge branch 'master' into stdlib-header-wrappers > - jrose comments > - move tuple to undecided category > - add wrapper for > - add wrapper for > - add wrapper for > - style guide permits some standard library facilities I forgot to update gtests to use the newly introduced wrapper headers. I'll deal with that later as a separate change, to avoid making this one even bigger with not very interesting changes to a bunch more files. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27601#issuecomment-3423683169 From kbarrett at openjdk.org Mon Oct 20 21:00:07 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Mon, 20 Oct 2025 21:00:07 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v4] In-Reply-To: References: Message-ID: On Mon, 20 Oct 2025 09:15:14 GMT, Leo Korinth wrote: > [...] I would have liked more of the c++ library included (like tuples, optional and expected), but this is a good start. This PR is intentionally quite limited; it doesn't add anything to the set of what's permitted. It is instead about establishing that such additions are possible, and a framework for doing so. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27601#issuecomment-3423694560 From kdnilsen at openjdk.org Mon Oct 20 22:24:38 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Mon, 20 Oct 2025 22:24:38 GMT Subject: RFR: 8358735: GenShen: bug in #undef'd code in block_start() [v3] In-Reply-To: References: Message-ID: <6c-bIgvNvrGeDztqyi43wvvWMS4soCOHZ8Hnch2pq0c=.f7159ec5-ad89-4b76-9e24-bdddb05c0461@github.com> > When scanning a range of dirty cards within the GenShen remembered set, we need to find the object that spans the beginning of the left-most dirty card. The existing code is not reliable following class unloading. > > The new code uses the marking context when it is available to determine the location of live objects that reside below TAMS within each region. Above TAMS, all objects are presumed live and parsable. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: Fixup handling of weakly marked objects in remembered set ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27353/files - new: https://git.openjdk.org/jdk/pull/27353/files/668e8615..80198abe Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27353&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27353&range=01-02 Stats: 32 lines in 1 file changed: 20 ins; 1 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/27353.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27353/head:pull/27353 PR: https://git.openjdk.org/jdk/pull/27353 From wkemper at openjdk.org Mon Oct 20 23:51:53 2025 From: wkemper at openjdk.org (William Kemper) Date: Mon, 20 Oct 2025 23:51:53 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v6] In-Reply-To: References: Message-ID: > Notable changes: > * Improvements to logging > * More accurate tracking of promotion failures > * Use shared allocation for promotions only when the size is above the maximum plab size (not the minimum size) > * Use census information gathered during mark to size promotion reserves and old generation > > With these changes, GenShen is expected to have fewer promotion failures and this is indeed the case. As a result of this, we expect less time to be spent in concurrent marking and update refs for young collections. We may also expect shorter concurrent evacuation phases because GenShen will have fewer densely packed regions stuck in the young generation. With more objects being promoted, we also expect to see longer remembered set scan times. This is generally the case across all benchmarks, but we do also see some counter-intuitive results. > > Here we are comparing 20 executions (10 on x86, 10 on aarch64) of the changes in the PR (experiment) against 20 executions of the same benchmarks results from tip. This is a summary of statistically significant changes of more than 5% across all benchmarks: > > > Concurrent Evacuation: 7 improvements, 3 regressions > ? Best improvements: extremem-large-45g (-29.6%), neo4j-analytics (-26.9%) > ? Worst regression: xalan (+53.7%) > > Concurrent Marking: 15 improvements, 1 regression > ? Best improvements: hyperalloc_a2048_o4096 (-30.1%), crypto.rsa (-27.3%) > ? Only regression: serial (+8.9%) > > Concurrent Scan Remembered Set: 7 improvements, 2 regressions > ? Best improvements: xalan (-49.4%), pmd (-49.0%), crypto.rsa (-41.8%) > ? Worst regression: extremem-phased (+52.4%) > > Concurrent Update Refs: 5 improvements, 4 regressions > ? Best improvements: crypto.rsa (-36.4%), mnemonics (-28.4%) > ? Worst regression: xalan (+89.4%) William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 58 commits: - Merge tag 'jdk-26+20' into promotion-budget-improvements Added tag jdk-26+20 for changeset b5b83247 - Proper format bytes in logs for better readability - Merge remote-tracking branch 'jdk/master' into promotion-budget-improvements - Review feedback, bug fixes - Fix windows build more - Fix windows build - Little cleanup - Fix wrong asserts - Only use old generation in generational mode - More accurate method names for cset fields, consider promotion reserves when computing excess old regions - ... and 48 more: https://git.openjdk.org/jdk/compare/b5b83247...c9af7069 ------------- Changes: https://git.openjdk.org/jdk/pull/27632/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27632&range=05 Stats: 346 lines in 16 files changed: 177 ins; 89 del; 80 mod Patch: https://git.openjdk.org/jdk/pull/27632.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27632/head:pull/27632 PR: https://git.openjdk.org/jdk/pull/27632 From epeter at openjdk.org Tue Oct 21 07:18:05 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Tue, 21 Oct 2025 07:18:05 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v3] In-Reply-To: References: Message-ID: <84MqtoPPB-QssENCh58yZai2AXiBUmiJMchtZxclf50=.b43920a8-6e84-4904-81e9-5c2166a697d9@github.com> > When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. > > Here, I'm doing the following: > - Add more documentation, and improve it in other cases. > - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. > - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` > - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` > - Made some methods private, and added some additional asserts. > > I'd be more than happy for even better names, and suggestions how to improve the documentation further :) > > Related issues: > https://github.com/openjdk/jdk/pull/27889 > https://github.com/openjdk/jdk/pull/15720 > > TODO: improve `VerifyLoopOptimizations` to check that we can call `get_ctrl` on all live nodes after loop-opts. Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: fix merge ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27892/files - new: https://git.openjdk.org/jdk/pull/27892/files/c3ab0698..e0b6ad68 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=01-02 Stats: 8 lines in 2 files changed: 1 ins; 0 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/27892.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27892/head:pull/27892 PR: https://git.openjdk.org/jdk/pull/27892 From epeter at openjdk.org Tue Oct 21 07:21:07 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Tue, 21 Oct 2025 07:21:07 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v3] In-Reply-To: References: <7nfOylxfH7KPKOj291d3N3f67w5rKrGwhc17OKv77NY=.afb319e9-f3be-4330-abe9-b1c19b61dc75@github.com> Message-ID: On Mon, 20 Oct 2025 13:36:13 GMT, Christian Hagedorn wrote: >> src/hotspot/share/opto/loopnode.hpp line 1176: >> >>> 1174: // - Update the node inputs of all uses. >>> 1175: // - Lazily update the ctrl and idom info of all uses, via a ctrl/idom forwarding. >>> 1176: void replace_ctrl_node_and_forward_ctrl_and_idom(Node *old_node, Node *new_node) { >> >> Maybe add here and/or in `install_lazy_ctrl_and_idom_forwarding()` an assert that we have a CFG nodes (i.e. `is_CFG()`) additionally to the `!has_ctrl()` asserts. > > Just noticed this: We often (intuitively?) seem to use "control" when talking about just some control nodes and "ctrl" when talking about the nodes found/fetched from `_loop_or_ctrl`. Under this light, we might want to name the method "replace_control_node_and_forward_ctrl_and_idom" to better distinguish them. But I don't have a strong opinion about it - your call ? I'm not sure we do that consistently. I think I'll just keep it as is, in a shorter form. The name is already quite long ? Adding the `is_CFG`, good idea! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2446988758 From epeter at openjdk.org Tue Oct 21 07:29:41 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Tue, 21 Oct 2025 07:29:41 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v4] In-Reply-To: References: Message-ID: <3TcuvopXlzCCI30K0S5aC07hKiGgQ1xkIOHbc_0ZmNo=.45f10950-7238-4d3f-a51e-53a281e3fa75@github.com> > When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. > > Here, I'm doing the following: > - Add more documentation, and improve it in other cases. > - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. > - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` > - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` > - Made some methods private, and added some additional asserts. > > I'd be more than happy for even better names, and suggestions how to improve the documentation further :) > > Related issues: > https://github.com/openjdk/jdk/pull/27889 > https://github.com/openjdk/jdk/pull/15720 > > TODO: improve `VerifyLoopOptimizations` to check that we can call `get_ctrl` on all live nodes after loop-opts. Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: for Christian part 1 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27892/files - new: https://git.openjdk.org/jdk/pull/27892/files/e0b6ad68..d9f7926e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=02-03 Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/27892.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27892/head:pull/27892 PR: https://git.openjdk.org/jdk/pull/27892 From epeter at openjdk.org Tue Oct 21 07:35:20 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Tue, 21 Oct 2025 07:35:20 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v5] In-Reply-To: References: Message-ID: <9RB0Ls1iPyS_xeJWj5DLw5b_un7ueUWZ4bX5ix9F_kw=.3495c8e4-a6ed-430e-b7d8-a6e4acf2b99a@github.com> > When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. > > Here, I'm doing the following: > - Add more documentation, and improve it in other cases. > - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. > - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` > - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` > - Made some methods private, and added some additional asserts. > > I'd be more than happy for even better names, and suggestions how to improve the documentation further :) > > Related issues: > https://github.com/openjdk/jdk/pull/27889 > https://github.com/openjdk/jdk/pull/15720 > > TODO: improve `VerifyLoopOptimizations` to check that we can call `get_ctrl` on all live nodes after loop-opts. Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: Apply suggestions from code review Co-authored-by: Christian Hagedorn ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27892/files - new: https://git.openjdk.org/jdk/pull/27892/files/d9f7926e..73bb42f5 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=03-04 Stats: 6 lines in 1 file changed: 0 ins; 0 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/27892.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27892/head:pull/27892 PR: https://git.openjdk.org/jdk/pull/27892 From epeter at openjdk.org Tue Oct 21 07:42:13 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Tue, 21 Oct 2025 07:42:13 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v5] In-Reply-To: <7nfOylxfH7KPKOj291d3N3f67w5rKrGwhc17OKv77NY=.afb319e9-f3be-4330-abe9-b1c19b61dc75@github.com> References: <7nfOylxfH7KPKOj291d3N3f67w5rKrGwhc17OKv77NY=.afb319e9-f3be-4330-abe9-b1c19b61dc75@github.com> Message-ID: On Mon, 20 Oct 2025 13:25:58 GMT, Christian Hagedorn wrote: >> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: >> >> Apply suggestions from code review >> >> Co-authored-by: Christian Hagedorn > > src/hotspot/share/opto/loopnode.hpp line 1154: > >> 1152: // forwarding in the future. >> 1153: // - When querying "idom": from some node get its old idom, which >> 1154: // may be dead but has a ctrl forwarding to the new and live > > Maybe add this: > Suggestion: > > // may be dead but has an idom forwarding (piggy-backing on '_loop_or_ctrl') to the new and live Thanks for the suggestion. I applied something that is inspired by your suggestion instead :) > src/hotspot/share/opto/loopnode.hpp line 1160: > >> 1158: // the entry for the old dead node now, and we do not have to update all >> 1159: // the nodes that had the old_node as their "get_ctrl" or "idom". We >> 1160: // clean up the forwarding links when we query "get_ctrl" or "idom". > > Suggestion: > > // clean up the forwarding links when we query "get_ctrl" or "idom" for these nodes the next time. Applied it but with a line break ;) > src/hotspot/share/opto/loopnode.hpp line 1161: > >> 1159: // the nodes that had the old_node as their "get_ctrl" or "idom". We >> 1160: // clean up the forwarding links when we query "get_ctrl" or "idom". >> 1161: void install_lazy_ctrl_and_idom_forwarding(Node* old_node, Node* new_node) { > > Maybe we don't need lazy sice "install forwarding" is already expressive enough: > > Suggestion: > > void install_ctrl_and_idom_forwarding(Node* old_node, Node* new_node) { Applied systematically :) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447051099 PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447056113 PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447060094 From epeter at openjdk.org Tue Oct 21 07:47:07 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Tue, 21 Oct 2025 07:47:07 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v5] In-Reply-To: <7nfOylxfH7KPKOj291d3N3f67w5rKrGwhc17OKv77NY=.afb319e9-f3be-4330-abe9-b1c19b61dc75@github.com> References: <7nfOylxfH7KPKOj291d3N3f67w5rKrGwhc17OKv77NY=.afb319e9-f3be-4330-abe9-b1c19b61dc75@github.com> Message-ID: <6fV6WCQAoTBHoBnxKZLvMdINAZgsMRtrw6ol63bqOGQ=.8df8a005-2b10-41ef-b533-74d184bf976a@github.com> On Mon, 20 Oct 2025 13:50:08 GMT, Christian Hagedorn wrote: >> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: >> >> Apply suggestions from code review >> >> Co-authored-by: Christian Hagedorn > > src/hotspot/share/opto/loopnode.hpp line 1262: > >> 1260: // forwarding installed, using "install_lazy_ctrl_and_idom_forwarding". >> 1261: // We now have to jump from the old (dead) ctrl node to the new (live) >> 1262: // ctrl/idom node, in possibly multiple ctrl/idom forwarding steps. > > Maybe for clarification since it's somehow surprising at first that we reuse `_loop_or_ctrl`: > Suggestion: > > // idom node, in possibly multiple idom forwarding steps. > // Note that we piggy back on `_loop_or_ctrl` do the the forwarding. Applied with even more information. > src/hotspot/share/opto/loopnode.hpp line 1274: > >> 1272: } >> 1273: >> 1274: Node* idom(uint didx) const { > > While at it: Maybe also name this `node_index`? I chose to replace it with `node_idx`, since it comes from `n->_idx`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447068474 PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447075460 From epeter at openjdk.org Tue Oct 21 07:57:39 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Tue, 21 Oct 2025 07:57:39 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v6] In-Reply-To: References: Message-ID: <59V3v8eASx0Rblb7t7fSAlMC4YOGOIHP4OGlUmOjbH8=.9894dc12-027d-4e17-b250-1c3c5dbfe395@github.com> > When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. > > Here, I'm doing the following: > - Add more documentation, and improve it in other cases. > - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. > - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` > - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` > - Made some methods private, and added some additional asserts. > > I'd be more than happy for even better names, and suggestions how to improve the documentation further :) > > Related issues: > https://github.com/openjdk/jdk/pull/27889 > https://github.com/openjdk/jdk/pull/15720 Emanuel Peter has updated the pull request incrementally with three additional commits since the last revision: - Apply suggestions from code review Co-authored-by: Tobias Hartmann - more for Christian part 3 - more for Christian part 2 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27892/files - new: https://git.openjdk.org/jdk/pull/27892/files/73bb42f5..a91396be Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=04-05 Stats: 33 lines in 3 files changed: 10 ins; 0 del; 23 mod Patch: https://git.openjdk.org/jdk/pull/27892.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27892/head:pull/27892 PR: https://git.openjdk.org/jdk/pull/27892 From thartmann at openjdk.org Tue Oct 21 07:57:43 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Tue, 21 Oct 2025 07:57:43 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v5] In-Reply-To: <9RB0Ls1iPyS_xeJWj5DLw5b_un7ueUWZ4bX5ix9F_kw=.3495c8e4-a6ed-430e-b7d8-a6e4acf2b99a@github.com> References: <9RB0Ls1iPyS_xeJWj5DLw5b_un7ueUWZ4bX5ix9F_kw=.3495c8e4-a6ed-430e-b7d8-a6e4acf2b99a@github.com> Message-ID: On Tue, 21 Oct 2025 07:35:20 GMT, Emanuel Peter wrote: >> When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. >> >> Here, I'm doing the following: >> - Add more documentation, and improve it in other cases. >> - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. >> - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` >> - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` >> - Made some methods private, and added some additional asserts. >> >> I'd be more than happy for even better names, and suggestions how to improve the documentation further :) >> >> Related issues: >> https://github.com/openjdk/jdk/pull/27889 >> https://github.com/openjdk/jdk/pull/15720 > > Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: > > Apply suggestions from code review > > Co-authored-by: Christian Hagedorn src/hotspot/share/opto/loopUnswitch.cpp line 523: > 521: register_control(region, lp, new_multiversion_slow_proj); > 522: > 523: // Hook region into slow_path, in stead of the multiversion_slow_proj. Suggestion: // Hook region into slow_path, instead of the multiversion_slow_proj. src/hotspot/share/opto/loopnode.hpp line 1176: > 1174: // - Update the node inputs of all uses. > 1175: // - Lazily update the ctrl and idom info of all uses, via a ctrl/idom forwarding. > 1176: void replace_ctrl_node_and_forward_ctrl_and_idom(Node *old_node, Node *new_node) { Drive-by comment (sorry): I think this is way too heavy. Descriptive names are good but for complex methods, not all the semantics can be put into the name but should rather be in a comment. Couldn't we just name these `replace_and_update_ctrl` and `update_ctrl`? I think this entails updating idom which is dependent on ctrl. And the comments explain the details well enough. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447056340 PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447097742 From epeter at openjdk.org Tue Oct 21 08:11:10 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Tue, 21 Oct 2025 08:11:10 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v5] In-Reply-To: References: <9RB0Ls1iPyS_xeJWj5DLw5b_un7ueUWZ4bX5ix9F_kw=.3495c8e4-a6ed-430e-b7d8-a6e4acf2b99a@github.com> Message-ID: On Tue, 21 Oct 2025 07:51:04 GMT, Tobias Hartmann wrote: >> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: >> >> Apply suggestions from code review >> >> Co-authored-by: Christian Hagedorn > > src/hotspot/share/opto/loopnode.hpp line 1176: > >> 1174: // - Update the node inputs of all uses. >> 1175: // - Lazily update the ctrl and idom info of all uses, via a ctrl/idom forwarding. >> 1176: void replace_ctrl_node_and_forward_ctrl_and_idom(Node *old_node, Node *new_node) { > > Drive-by comment (sorry): I think this is way too heavy. Descriptive names are good but for complex methods, not all the semantics can be put into the name but should rather be in a comment. > > Couldn't we just name these `replace_and_update_ctrl` and `update_ctrl`? I think this entails updating idom which is dependent on ctrl. And the comments explain the details well enough. @TobiHartmann `update_ctrl`: Sounds too much like `set_ctrl`, but it is not at all similar conceptually. What about: - `install_ctrl_and_idom_forwarding` -> `forward_ctrl` - `replace_ctrl_node_and_forward_ctrl_and_idom` -> `replace_node_and_forward_ctrl` - Because it is really a specialization of `_igvn.replace_node`, so it should have some name similarity. What do you think? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447148523 From thartmann at openjdk.org Tue Oct 21 08:11:11 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Tue, 21 Oct 2025 08:11:11 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v5] In-Reply-To: References: <9RB0Ls1iPyS_xeJWj5DLw5b_un7ueUWZ4bX5ix9F_kw=.3495c8e4-a6ed-430e-b7d8-a6e4acf2b99a@github.com> Message-ID: On Tue, 21 Oct 2025 08:06:27 GMT, Emanuel Peter wrote: >> src/hotspot/share/opto/loopnode.hpp line 1176: >> >>> 1174: // - Update the node inputs of all uses. >>> 1175: // - Lazily update the ctrl and idom info of all uses, via a ctrl/idom forwarding. >>> 1176: void replace_ctrl_node_and_forward_ctrl_and_idom(Node *old_node, Node *new_node) { >> >> Drive-by comment (sorry): I think this is way too heavy. Descriptive names are good but for complex methods, not all the semantics can be put into the name but should rather be in a comment. >> >> Couldn't we just name these `replace_and_update_ctrl` and `update_ctrl`? I think this entails updating idom which is dependent on ctrl. And the comments explain the details well enough. > > @TobiHartmann > > `update_ctrl`: Sounds too much like `set_ctrl`, but it is not at all similar conceptually. > > What about: > - `install_ctrl_and_idom_forwarding` -> `forward_ctrl` > - `replace_ctrl_node_and_forward_ctrl_and_idom` -> `replace_node_and_forward_ctrl` > - Because it is really a specialization of `_igvn.replace_node`, so it should have some name similarity. > > What do you think? Yes, that's much better, good with me! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447155999 From epeter at openjdk.org Tue Oct 21 08:20:26 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Tue, 21 Oct 2025 08:20:26 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v7] In-Reply-To: References: Message-ID: <5NCbOn36uvy0cTen6j1ys_E4uDD-qWjW5N1B-doqCGU=.4f75ce02-f27c-4d9a-ace8-5073f211d78f@github.com> > When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. > > Here, I'm doing the following: > - Add more documentation, and improve it in other cases. > - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. > - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` > - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` > - Made some methods private, and added some additional asserts. > > I'd be more than happy for even better names, and suggestions how to improve the documentation further :) > > Related issues: > https://github.com/openjdk/jdk/pull/27889 > https://github.com/openjdk/jdk/pull/15720 Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: renaming for Tobias ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27892/files - new: https://git.openjdk.org/jdk/pull/27892/files/a91396be..aaa91d18 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=05-06 Stats: 49 lines in 8 files changed: 0 ins; 1 del; 48 mod Patch: https://git.openjdk.org/jdk/pull/27892.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27892/head:pull/27892 PR: https://git.openjdk.org/jdk/pull/27892 From epeter at openjdk.org Tue Oct 21 08:23:14 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Tue, 21 Oct 2025 08:23:14 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v7] In-Reply-To: <7nfOylxfH7KPKOj291d3N3f67w5rKrGwhc17OKv77NY=.afb319e9-f3be-4330-abe9-b1c19b61dc75@github.com> References: <7nfOylxfH7KPKOj291d3N3f67w5rKrGwhc17OKv77NY=.afb319e9-f3be-4330-abe9-b1c19b61dc75@github.com> Message-ID: On Mon, 20 Oct 2025 13:55:49 GMT, Christian Hagedorn wrote: >> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: >> >> renaming for Tobias > > Thanks a lot for following up with a documentation and renaming! Some small suggestions, otherwise, looks good! > > Note: There are some build failures in GHA. @chhagedorn Thanks for all the suggestions / comments, I think I applied them all now :) @TobiHartmann thanks for the drive-by comment / suggestion. @rwestrel You are somewhat familiar with this code, would you mind reviewing? @vnkozlov You may also want to have quick look, just so you are aware of the renamings. But feel free to also review ;) ------------- PR Comment: https://git.openjdk.org/jdk/pull/27892#issuecomment-3425369640 From thartmann at openjdk.org Tue Oct 21 08:38:23 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Tue, 21 Oct 2025 08:38:23 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v7] In-Reply-To: <5NCbOn36uvy0cTen6j1ys_E4uDD-qWjW5N1B-doqCGU=.4f75ce02-f27c-4d9a-ace8-5073f211d78f@github.com> References: <5NCbOn36uvy0cTen6j1ys_E4uDD-qWjW5N1B-doqCGU=.4f75ce02-f27c-4d9a-ace8-5073f211d78f@github.com> Message-ID: On Tue, 21 Oct 2025 08:20:26 GMT, Emanuel Peter wrote: >> When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. >> >> Here, I'm doing the following: >> - Add more documentation, and improve it in other cases. >> - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. >> - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` >> - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` >> - Made some methods private, and added some additional asserts. >> >> I'd be more than happy for even better names, and suggestions how to improve the documentation further :) >> >> Related issues: >> https://github.com/openjdk/jdk/pull/27889 >> https://github.com/openjdk/jdk/pull/15720 > > Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: > > renaming for Tobias Nice improvement, looks good to me! ------------- Marked as reviewed by thartmann (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27892#pullrequestreview-3359424704 From chagedorn at openjdk.org Tue Oct 21 09:45:17 2025 From: chagedorn at openjdk.org (Christian Hagedorn) Date: Tue, 21 Oct 2025 09:45:17 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v7] In-Reply-To: <5NCbOn36uvy0cTen6j1ys_E4uDD-qWjW5N1B-doqCGU=.4f75ce02-f27c-4d9a-ace8-5073f211d78f@github.com> References: <5NCbOn36uvy0cTen6j1ys_E4uDD-qWjW5N1B-doqCGU=.4f75ce02-f27c-4d9a-ace8-5073f211d78f@github.com> Message-ID: On Tue, 21 Oct 2025 08:20:26 GMT, Emanuel Peter wrote: >> When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. >> >> Here, I'm doing the following: >> - Add more documentation, and improve it in other cases. >> - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. >> - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` >> - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` >> - Made some methods private, and added some additional asserts. >> >> I'd be more than happy for even better names, and suggestions how to improve the documentation further :) >> >> Related issues: >> https://github.com/openjdk/jdk/pull/27889 >> https://github.com/openjdk/jdk/pull/15720 > > Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: > > renaming for Tobias Good naming update! The update looks good to me apart from some last nits. src/hotspot/share/opto/loopnode.hpp line 1161: > 1159: // future. > 1160: // Note: while the "idom" information is stored in the "_idom" > 1161: // side-table, the idom forwarding piggy-packs on the ctrl Suggestion: // side-table, the idom forwarding piggybacks on the ctrl src/hotspot/share/opto/loopnode.hpp line 1182: > 1180: // - Update the node inputs of all uses. > 1181: // - Lazily update the ctrl and idom info of all uses, via a ctrl/idom forwarding. > 1182: void replace_node_and_forward_ctrl(Node *old_node, Node *new_node) { Suggestion: void replace_node_and_forward_ctrl(Node* old_node, Node* new_node) { src/hotspot/share/opto/loopnode.hpp line 1269: > 1267: // the old (dead) idom node to the new (live) idom node, in possibly > 1268: // multiple idom forwarding steps. > 1269: // Note that we piggy-back on "_loop_or_ctrl" to do the forwarding, Suggestion: // Note that we piggyback on "_loop_or_ctrl" to do the forwarding, ------------- Marked as reviewed by chagedorn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27892#pullrequestreview-3359723589 PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447507606 PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447512959 PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447509451 From epeter at openjdk.org Tue Oct 21 12:17:23 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Tue, 21 Oct 2025 12:17:23 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v8] In-Reply-To: References: Message-ID: > When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. > > Here, I'm doing the following: > - Add more documentation, and improve it in other cases. > - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. > - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` > - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` > - Made some methods private, and added some additional asserts. > > I'd be more than happy for even better names, and suggestions how to improve the documentation further :) > > Related issues: > https://github.com/openjdk/jdk/pull/27889 > https://github.com/openjdk/jdk/pull/15720 Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: Apply suggestions from code review Co-authored-by: Christian Hagedorn ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27892/files - new: https://git.openjdk.org/jdk/pull/27892/files/aaa91d18..ac057395 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=06-07 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/27892.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27892/head:pull/27892 PR: https://git.openjdk.org/jdk/pull/27892 From epeter at openjdk.org Tue Oct 21 15:57:16 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Tue, 21 Oct 2025 15:57:16 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v8] In-Reply-To: References: Message-ID: On Tue, 21 Oct 2025 12:17:23 GMT, Emanuel Peter wrote: >> When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. >> >> Here, I'm doing the following: >> - Add more documentation, and improve it in other cases. >> - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. >> - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` >> - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` >> - Made some methods private, and added some additional asserts. >> >> I'd be more than happy for even better names, and suggestions how to improve the documentation further :) >> >> Related issues: >> https://github.com/openjdk/jdk/pull/27889 >> https://github.com/openjdk/jdk/pull/15720 > > Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: > > Apply suggestions from code review > > Co-authored-by: Christian Hagedorn Seems GHA is giving me some failures I did not see in our internal testing: `compiler.lib.ir_framework.flag.FlagVM compiler.gcbarriers.TestShenandoahBarrierExpansion ` # Internal Error (/home/runner/work/jdk/jdk/src/hotspot/share/opto/loopnode.hpp:1168), pid=5884, tid=5904 # assert(!has_ctrl(old_node) && old_node->is_CFG() && old_node->in(0) == nullptr) failed: must be dead ctrl (CFG) node This is part of the assert I added. Will have to investigate. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27892#issuecomment-3427379718 From kdnilsen at openjdk.org Tue Oct 21 23:42:49 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Tue, 21 Oct 2025 23:42:49 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v27] In-Reply-To: References: Message-ID: <4qrP0qDQkfL-ogpd0AQ2gJMMlnvo80IQJ36aQHYbTDo=.790fee9b-1720-4aab-bde2-e4ff205426d0@github.com> > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: Fix up vmstructs and other infrastructure for jmap heap dump ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/891e96b8..ee617c30 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=26 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=25-26 Stats: 130 lines in 5 files changed: 63 ins; 59 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From ysr at openjdk.org Wed Oct 22 01:53:16 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Wed, 22 Oct 2025 01:53:16 GMT Subject: RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure [v2] In-Reply-To: References: Message-ID: On Tue, 14 Oct 2025 23:03:16 GMT, William Kemper wrote: >> There are certain code paths in Shenandoah's generational mode that need to _know_ which generation is being collected, but it is not possible to pass this information on the stack (barriers, for example). To address this, we introduced an `_active_generation` member in `ShenandoahHeap`. Over time, the usage of this field grew beyond its intended purpose and we began to have issues where not all threads would see a consistent value for this field. To address _this_ issue, we added another field `_gc_generation` which was only meant to be used by GC threads. At this point, we have three different ways to determine which generation is being collected: the _active_ generation, the _gc_ generation, and the usual function parameters and member fields of the gc components. This PR removes `_gc_generation` and reduces the use of `_active_generation` to only those places where it is not possible to get this information from other means (barriers, mostly). All GC components that can have t his information passed through function calls, now do so. > > William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: > > - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage > - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage > - Remove _gc_generation from ShenandoahHeap > - Little cleanup, remove one active generation usage > - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage > - Finish removing usages of gc_generation, start on reducing usages of active_generation > - Fix build > - Use existing _generation field instead of Heap::_gc_generation where possible > - Only shenandoah vm operations participate in active/gc generation scheme Left a few minor suggestions. This is a very nice clean-up, thank you! src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp line 358: > 356: assert(_from_region != nullptr, "must set before work"); > 357: assert(_heap->marking_context()->is_marked(p), "must be marked"); > 358: assert(!_heap->marking_context()->allocated_after_mark_start(p), "must be truly marked"); Why not `_generation->complete_marking_context()...` with the help of a `_generation` field kept in the object? It would make the idiom uniform and consistent across all these closures. src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp line 802: > 800: } > 801: void do_object(oop p) { > 802: assert(_heap->marking_context()->is_marked(p), "must be marked"); Just use `_ctx` from line 784? src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp line 886: > 884: > 885: void do_object(oop p) { > 886: assert(_heap->marking_context()->is_marked(p), "must be marked"); ditto (comment at line 802). src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp line 174: > 172: // contained herein. > 173: void ShenandoahGenerationalEvacuationTask::promote_in_place(ShenandoahHeapRegion* region) { > 174: assert(!_generation->is_old(), "Sanity check"); Would `assert(_generation->is_young()...` be too strong at line 174 for some reason? e.g. could `_generation` be `is_global()` here? You could then confidently replace the `_heap->young_generation()` indirection at line 175 below with just `_generation`, also simplifying comprehension complexity & code maintainability. src/hotspot/share/gc/shenandoah/shenandoahGenerationalFullGC.cpp line 56: > 54: auto heap = ShenandoahGenerationalHeap::heap(); > 55: // Since we may arrive here from degenerated GC failure of either young or old, establish generation as GLOBAL. > 56: heap->set_active_generation(heap->global_generation()); While this is good practice for consistency, is `_active_generation` ever used by the worker threads when doing a full gc? Not asking to remove this line, just wondering if it's ever used now, following your changes in this PR. src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp line 851: > 849: } > 850: > 851: if (!_generation->is_global()) { Is this ever `_generation->is_old()` ? I am guessing this is either global or young? I am guessing for the case of update_refs for a mixed collection we still pass in the `young` gen here? It might be a good idea wherever we have a `_generation` field member in a class to indicate what it represents. In most cases, it's probably clear that it represents the generation subject to collection in that cycle. But for mixed collection sets, what does the `_generation` field represent? src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.hpp line 92: > 90: oop try_evacuate_object(oop p, Thread* thread, ShenandoahHeapRegion* from_region, ShenandoahAffiliation target_gen); > 91: void evacuate_collection_set(ShenandoahGeneration* generation, bool concurrent) override; > 92: void promote_regions_in_place(ShenandoahGeneration* generation, bool concurrent); Document what the parameters to the call represent, in particular `generation`. src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.hpp line 102: > 100: // ---------- Update References > 101: // > 102: void update_heap_references(ShenandoahGeneration* generation, bool concurrent) override; Ditto (to comment at line 92). src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp line 149: > 147: > 148: // This is set and cleared by only the VMThread > 149: // at each STW pause (safepoint) to the value given to the VM operation. Very nice simplification which cleans up a lot of the old messiness. Thanks! src/hotspot/share/gc/shenandoah/shenandoahMark.cpp line 82: > 80: template > 81: void ShenandoahMark::mark_loop(uint worker_id, TaskTerminator* terminator, > 82: ShenandoahGenerationType generation, StringDedup::Requests* const req) { Since `ShenandoahMark` has a `_generation` data member with a `generation()` accessor, I'd rename the formal parameters of type `ShenandoahGenerationType` for all these methods from `generation` to `gen_type` or something like that to reduce confusion while reading the code. src/hotspot/share/gc/shenandoah/shenandoahMark.cpp line 104: > 102: } > 103: > 104: void ShenandoahMark::mark_loop(uint worker_id, TaskTerminator* terminator, ShenandoahGenerationType generation, parm name comment at line 82, applies below as well. src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp line 1: > 1: /* Some of the spots here on where we need a completed marking context and where we are permitted to use a possibly in flight marking context isn't terribly clear. At some point, we should probably go through and clarify. src/hotspot/share/gc/shenandoah/shenandoahRootVerifier.hpp line 47: > 45: // Used to seed ShenandoahVerifier, do not honor root type filter > 46: static void roots_do(OopIterateClosure* cl, ShenandoahGeneration* generation); > 47: static void strong_roots_do(OopIterateClosure* cl, ShenandoahGeneration* generation); Document what the parameter `generation` represents here. src/hotspot/share/gc/shenandoah/shenandoahSTWMark.cpp line 152: > 150: StringDedup::Requests requests; > 151: > 152: // TODO: Why are we passing our own fields to our own method? It's a method on our parent class which doesn't have a Terminator object handy. src/hotspot/share/gc/shenandoah/shenandoahVMOperations.hpp line 55: > 53: explicit VM_ShenandoahOperation(ShenandoahGeneration* generation) > 54: : _gc_id(GCId::current()) > 55: , _generation(generation) { style question: shouldn't the comma go at the end of the previous line? ------------- Marked as reviewed by ysr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27703#pullrequestreview-3352384744 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2450040309 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2450050185 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2450050669 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2441449826 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2450058990 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2450082830 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2450086356 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2450086707 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2441455419 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2450129501 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2450130541 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2450145164 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2450147249 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2450159840 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2441471022 From ysr at openjdk.org Wed Oct 22 01:53:17 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Wed, 22 Oct 2025 01:53:17 GMT Subject: RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure [v2] In-Reply-To: References: Message-ID: On Wed, 22 Oct 2025 00:29:29 GMT, Y. Srinivas Ramakrishna wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: >> >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Remove _gc_generation from ShenandoahHeap >> - Little cleanup, remove one active generation usage >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Finish removing usages of gc_generation, start on reducing usages of active_generation >> - Fix build >> - Use existing _generation field instead of Heap::_gc_generation where possible >> - Only shenandoah vm operations participate in active/gc generation scheme > > src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp line 358: > >> 356: assert(_from_region != nullptr, "must set before work"); >> 357: assert(_heap->marking_context()->is_marked(p), "must be marked"); >> 358: assert(!_heap->marking_context()->allocated_after_mark_start(p), "must be truly marked"); > > Why not `_generation->complete_marking_context()...` with the help of a `_generation` field kept in the object? It would make the idiom uniform and consistent across all these closures. Or like you did below at line 784, perhaps `_heap->global_generation()->complete_marking_context()...` stashed in local `_ctx` field ? > src/hotspot/share/gc/shenandoah/shenandoahGenerationalFullGC.cpp line 56: > >> 54: auto heap = ShenandoahGenerationalHeap::heap(); >> 55: // Since we may arrive here from degenerated GC failure of either young or old, establish generation as GLOBAL. >> 56: heap->set_active_generation(heap->global_generation()); > > While this is good practice for consistency, is `_active_generation` ever used by the worker threads when doing a full gc? Not asking to remove this line, just wondering if it's ever used now, following your changes in this PR. PS: My reasoning is that we are doing this at a safepoint, presumably, and the full gc will be done by the time we get out of the safepoint. Thus, mutators will never see this value. Further, worker threads seem now to use a `generation` member field passed in with the relevant work closure/method. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2450047381 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2450061214 From epeter at openjdk.org Wed Oct 22 06:33:54 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Wed, 22 Oct 2025 06:33:54 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v9] In-Reply-To: References: Message-ID: > When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. > > Here, I'm doing the following: > - Add more documentation, and improve it in other cases. > - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. > - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` > - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` > - Made some methods private, and added some additional asserts. > > I'd be more than happy for even better names, and suggestions how to improve the documentation further :) > > Related issues: > https://github.com/openjdk/jdk/pull/27889 > https://github.com/openjdk/jdk/pull/15720 Emanuel Peter has updated the pull request incrementally with two additional commits since the last revision: - Merge branch 'JDK-8370220-get-ctrl-documentation' of https://github.com/eme64/jdk into JDK-8370220-get-ctrl-documentation - fix shenandoah replace for phis ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27892/files - new: https://git.openjdk.org/jdk/pull/27892/files/ac057395..44e808bb Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=07-08 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/27892.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27892/head:pull/27892 PR: https://git.openjdk.org/jdk/pull/27892 From epeter at openjdk.org Wed Oct 22 06:49:05 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Wed, 22 Oct 2025 06:49:05 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v9] In-Reply-To: References: Message-ID: On Wed, 22 Oct 2025 06:33:54 GMT, Emanuel Peter wrote: >> When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. >> >> Here, I'm doing the following: >> - Add more documentation, and improve it in other cases. >> - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. >> - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` >> - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` >> - Made some methods private, and added some additional asserts. >> >> I'd be more than happy for even better names, and suggestions how to improve the documentation further :) >> >> Related issues: >> https://github.com/openjdk/jdk/pull/27889 >> https://github.com/openjdk/jdk/pull/15720 > > Emanuel Peter has updated the pull request incrementally with two additional commits since the last revision: > > - Merge branch 'JDK-8370220-get-ctrl-documentation' of https://github.com/eme64/jdk into JDK-8370220-get-ctrl-documentation > - fix shenandoah replace for phis src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp line 1780: > 1778: fix_memory_uses(u, n, n, c); > 1779: } else if (_phase->C->get_alias_index(u->adr_type()) == _alias) { > 1780: _phase->igvn().replace_node(u, n); As far as I can see, the `lazy_replace` only did `igvn.replace_node` for non-ctrl nodes anyway. Since we are dealing with `PhiNode`s here, we might as well only use `igvn.replace_node`. I discovered this, because it hit my `!old_node->is_CFG()` check. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2450605644 From epeter at openjdk.org Wed Oct 22 07:59:33 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Wed, 22 Oct 2025 07:59:33 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v9] In-Reply-To: References: Message-ID: On Wed, 22 Oct 2025 06:46:21 GMT, Emanuel Peter wrote: >> Emanuel Peter has updated the pull request incrementally with two additional commits since the last revision: >> >> - Merge branch 'JDK-8370220-get-ctrl-documentation' of https://github.com/eme64/jdk into JDK-8370220-get-ctrl-documentation >> - fix shenandoah replace for phis > > src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp line 1780: > >> 1778: fix_memory_uses(u, n, n, c); >> 1779: } else if (_phase->C->get_alias_index(u->adr_type()) == _alias) { >> 1780: _phase->igvn().replace_node(u, n); > > As far as I can see, the `lazy_replace` only did `igvn.replace_node` for non-ctrl nodes anyway. Since we are dealing with `PhiNode`s here, we might as well only use `igvn.replace_node`. > > I discovered this, because it hit my `!old_node->is_CFG()` check. @rwestrel Do you have an opinion on this? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2450776790 From kdnilsen at openjdk.org Wed Oct 22 17:22:46 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Wed, 22 Oct 2025 17:22:46 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v28] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: Add sleep to CompressedClassSpaceSizeInJmapHeap.java test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/ee617c30..da92c344 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=27 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=26-27 Stats: 2 lines in 1 file changed: 2 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From wkemper at openjdk.org Wed Oct 22 21:17:58 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 22 Oct 2025 21:17:58 GMT Subject: RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure [v2] In-Reply-To: References: Message-ID: On Fri, 17 Oct 2025 23:40:24 GMT, Y. Srinivas Ramakrishna wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: >> >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Remove _gc_generation from ShenandoahHeap >> - Little cleanup, remove one active generation usage >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Finish removing usages of gc_generation, start on reducing usages of active_generation >> - Fix build >> - Use existing _generation field instead of Heap::_gc_generation where possible >> - Only shenandoah vm operations participate in active/gc generation scheme > > src/hotspot/share/gc/shenandoah/shenandoahGenerationalEvacuationTask.cpp line 174: > >> 172: // contained herein. >> 173: void ShenandoahGenerationalEvacuationTask::promote_in_place(ShenandoahHeapRegion* region) { >> 174: assert(!_generation->is_old(), "Sanity check"); > > Would `assert(_generation->is_young()...` be too strong at line 174 for some reason? e.g. could `_generation` be `is_global()` here? > > You could then confidently replace the `_heap->young_generation()` indirection at line 175 below with just `_generation`, also simplifying comprehension complexity & code maintainability. Right, `_generation` could be global here. Global collections are allowed to promote in place. > src/hotspot/share/gc/shenandoah/shenandoahVMOperations.hpp line 55: > >> 53: explicit VM_ShenandoahOperation(ShenandoahGeneration* generation) >> 54: : _gc_id(GCId::current()) >> 55: , _generation(generation) { > > style question: shouldn't the comma go at the end of the previous line? Yes (old habits). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2453370865 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2453372543 From wkemper at openjdk.org Wed Oct 22 21:21:39 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 22 Oct 2025 21:21:39 GMT Subject: RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure [v2] In-Reply-To: References: Message-ID: On Wed, 22 Oct 2025 00:36:25 GMT, Y. Srinivas Ramakrishna wrote: >> src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp line 358: >> >>> 356: assert(_from_region != nullptr, "must set before work"); >>> 357: assert(_heap->marking_context()->is_marked(p), "must be marked"); >>> 358: assert(!_heap->marking_context()->allocated_after_mark_start(p), "must be truly marked"); >> >> Why not `_generation->complete_marking_context()...` with the help of a `_generation` field kept in the object? It would make the idiom uniform and consistent across all these closures. > > Or like you did below at line 784, perhaps `_heap->global_generation()->complete_marking_context()...` stashed in local `_ctx` field ? The context here is only used for the assertion. I'll add an `assert(_heap->global_generation()->is_marking_complete())`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2453379755 From wkemper at openjdk.org Wed Oct 22 23:12:33 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 22 Oct 2025 23:12:33 GMT Subject: RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure [v2] In-Reply-To: References: Message-ID: On Wed, 22 Oct 2025 01:05:28 GMT, Y. Srinivas Ramakrishna wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: >> >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Remove _gc_generation from ShenandoahHeap >> - Little cleanup, remove one active generation usage >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Finish removing usages of gc_generation, start on reducing usages of active_generation >> - Fix build >> - Use existing _generation field instead of Heap::_gc_generation where possible >> - Only shenandoah vm operations participate in active/gc generation scheme > > src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp line 851: > >> 849: } >> 850: >> 851: if (!_generation->is_global()) { > > Is this ever `_generation->is_old()` ? I am guessing this is either global or young? I am guessing for the case of update_refs for a mixed collection we still pass in the `young` gen here? > > It might be a good idea wherever we have a `_generation` field member in a class to indicate what it represents. In most cases, it's probably clear that it represents the generation subject to collection in that cycle. But for mixed collection sets, what does the `_generation` field represent? I changed this to check if `_generation->is_young` because it will never be old here and this is more direct. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2453545886 From wkemper at openjdk.org Wed Oct 22 23:23:23 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 22 Oct 2025 23:23:23 GMT Subject: RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure [v2] In-Reply-To: References: Message-ID: <3hNmxXwDIQqbSuy_DwXM-JuiY4JYg_91rxy1uZEg_is=.621dbeaf-df56-4075-b43b-d1748f0dc7f2@github.com> On Wed, 22 Oct 2025 01:21:30 GMT, Y. Srinivas Ramakrishna wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: >> >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Remove _gc_generation from ShenandoahHeap >> - Little cleanup, remove one active generation usage >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Finish removing usages of gc_generation, start on reducing usages of active_generation >> - Fix build >> - Use existing _generation field instead of Heap::_gc_generation where possible >> - Only shenandoah vm operations participate in active/gc generation scheme > > src/hotspot/share/gc/shenandoah/shenandoahMark.cpp line 82: > >> 80: template >> 81: void ShenandoahMark::mark_loop(uint worker_id, TaskTerminator* terminator, >> 82: ShenandoahGenerationType generation, StringDedup::Requests* const req) { > > Since `ShenandoahMark` has a `_generation` data member with a `generation()` accessor, I'd rename the formal parameters of type `ShenandoahGenerationType` for all these methods from `generation` to `gen_type` or something like that to reduce confusion while reading the code. Good point. > src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp line 1: > >> 1: /* > > Some of the spots here on where we need a completed marking context and where we are permitted to use a possibly in flight marking context isn't terribly clear. At some point, we should probably go through and clarify. The `complete_marking_context` method just has an assertion in it that marking is complete. I believe the only code that need access to the incomplete marking context is the marking code itself. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2453555375 PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2453558370 From wkemper at openjdk.org Wed Oct 22 23:30:00 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 22 Oct 2025 23:30:00 GMT Subject: RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure [v2] In-Reply-To: References: Message-ID: On Wed, 22 Oct 2025 01:43:50 GMT, Y. Srinivas Ramakrishna wrote: >> William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: >> >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Remove _gc_generation from ShenandoahHeap >> - Little cleanup, remove one active generation usage >> - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage >> - Finish removing usages of gc_generation, start on reducing usages of active_generation >> - Fix build >> - Use existing _generation field instead of Heap::_gc_generation where possible >> - Only shenandoah vm operations participate in active/gc generation scheme > > src/hotspot/share/gc/shenandoah/shenandoahSTWMark.cpp line 152: > >> 150: StringDedup::Requests requests; >> 151: >> 152: // TODO: Why are we passing our own fields to our own method? > > It's a method on our parent class which doesn't have a Terminator object handy. I think it's mostly because other uses of this (public) method are from `MarkingTasks` which have a `Terminator` but not a `ShenandoahGeneration`. I deleted the TODO. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27703#discussion_r2453568818 From iwalulya at openjdk.org Thu Oct 23 08:32:08 2025 From: iwalulya at openjdk.org (Ivan Walulya) Date: Thu, 23 Oct 2025 08:32:08 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v4] In-Reply-To: References: Message-ID: On Sat, 18 Oct 2025 17:11:48 GMT, Kim Barrett wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: > > - Merge branch 'master' into stdlib-header-wrappers > - Merge branch 'master' into stdlib-header-wrappers > - Merge branch 'master' into stdlib-header-wrappers > - jrose comments > - move tuple to undecided category > - add wrapper for > - add wrapper for > - add wrapper for > - style guide permits some standard library facilities Marked as reviewed by iwalulya (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27601#pullrequestreview-3368792334 From kdnilsen at openjdk.org Thu Oct 23 14:11:16 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Thu, 23 Oct 2025 14:11:16 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v29] In-Reply-To: References: Message-ID: <2l4P4pkKeL63Muti7IZhWjXpqBqSxwEoOogPijXY7dE=.242f9bf9-96cd-42d0-91eb-8b403d6279a4@github.com> > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: Add debug instrumentation to CompressedClassSpaceSizeInJmapHeap.java ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/da92c344..b107bc5c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=28 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=27-28 Stats: 26 lines in 1 file changed: 20 ins; 0 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From wkemper at openjdk.org Thu Oct 23 14:30:27 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 23 Oct 2025 14:30:27 GMT Subject: RFR: Merge openjdk/jdk21u:master Message-ID: <5dYgggR5B5FV8_h-XRix-KM9KMnB9TmCGApRhHkGV5M=.8e665c4d-83c3-4358-88b8-357cfa5c5f82@github.com> Merges tag jdk-21.0.9-ga ------------- Commit messages: - 8369643: [21u] Remove designator DEFAULT_PROMOTED_VERSION_PRE=ea for release 21.0.9 - 8360937: Enhance certificate handling - 8359454: Enhance String handling - 8356294: Enhance Path Factories - 8352637: Enhance bytecode verification The merge commit only contains trivial merges, so no merge-specific webrevs have been generated. Changes: https://git.openjdk.org/shenandoah-jdk21u/pull/225/files Stats: 253 lines in 16 files changed: 196 ins; 14 del; 43 mod Patch: https://git.openjdk.org/shenandoah-jdk21u/pull/225.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk21u.git pull/225/head:pull/225 PR: https://git.openjdk.org/shenandoah-jdk21u/pull/225 From kdnilsen at openjdk.org Thu Oct 23 16:28:31 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Thu, 23 Oct 2025 16:28:31 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v30] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: fix errors in CompressedClassSpaceSizeInJmapHeap.java ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/b107bc5c..3b56759c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=29 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=28-29 Stats: 4 lines in 1 file changed: 1 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From wkemper at openjdk.org Thu Oct 23 17:08:59 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 23 Oct 2025 17:08:59 GMT Subject: RFR: Merge openjdk/jdk21u:master [v2] In-Reply-To: <5dYgggR5B5FV8_h-XRix-KM9KMnB9TmCGApRhHkGV5M=.8e665c4d-83c3-4358-88b8-357cfa5c5f82@github.com> References: <5dYgggR5B5FV8_h-XRix-KM9KMnB9TmCGApRhHkGV5M=.8e665c4d-83c3-4358-88b8-357cfa5c5f82@github.com> Message-ID: <-RKKRS7f7z6UbDa5QhhFIZg2qmKFNHwKHpc-viXPVCg=.033f3b30-95ca-4e32-9147-079788d3a16c@github.com> > Merges tag jdk-21.0.9-ga William Kemper 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. ------------- Changes: - all: https://git.openjdk.org/shenandoah-jdk21u/pull/225/files - new: https://git.openjdk.org/shenandoah-jdk21u/pull/225/files/7f146482..7f146482 Webrevs: - full: https://webrevs.openjdk.org/?repo=shenandoah-jdk21u&pr=225&range=01 - incr: https://webrevs.openjdk.org/?repo=shenandoah-jdk21u&pr=225&range=00-01 Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/shenandoah-jdk21u/pull/225.diff Fetch: git fetch https://git.openjdk.org/shenandoah-jdk21u.git pull/225/head:pull/225 PR: https://git.openjdk.org/shenandoah-jdk21u/pull/225 From wkemper at openjdk.org Thu Oct 23 17:09:01 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 23 Oct 2025 17:09:01 GMT Subject: Integrated: Merge openjdk/jdk21u:master In-Reply-To: <5dYgggR5B5FV8_h-XRix-KM9KMnB9TmCGApRhHkGV5M=.8e665c4d-83c3-4358-88b8-357cfa5c5f82@github.com> References: <5dYgggR5B5FV8_h-XRix-KM9KMnB9TmCGApRhHkGV5M=.8e665c4d-83c3-4358-88b8-357cfa5c5f82@github.com> Message-ID: On Thu, 23 Oct 2025 14:24:35 GMT, William Kemper wrote: > Merges tag jdk-21.0.9-ga This pull request has now been integrated. Changeset: 92633517 Author: William Kemper URL: https://git.openjdk.org/shenandoah-jdk21u/commit/92633517cb9ab59154d384d0dacbe97ade9de317 Stats: 253 lines in 16 files changed: 196 ins; 14 del; 43 mod Merge ------------- PR: https://git.openjdk.org/shenandoah-jdk21u/pull/225 From wkemper at openjdk.org Thu Oct 23 17:10:36 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 23 Oct 2025 17:10:36 GMT Subject: RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure [v3] In-Reply-To: References: Message-ID: > There are certain code paths in Shenandoah's generational mode that need to _know_ which generation is being collected, but it is not possible to pass this information on the stack (barriers, for example). To address this, we introduced an `_active_generation` member in `ShenandoahHeap`. Over time, the usage of this field grew beyond its intended purpose and we began to have issues where not all threads would see a consistent value for this field. To address _this_ issue, we added another field `_gc_generation` which was only meant to be used by GC threads. At this point, we have three different ways to determine which generation is being collected: the _active_ generation, the _gc_ generation, and the usual function parameters and member fields of the gc components. This PR removes `_gc_generation` and reduces the use of `_active_generation` to only those places where it is not possible to get this information from other means (barriers, mostly). All GC components that can have th is information passed through function calls, now do so. William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: - More cleanup, review feedback - Some cleanup, review feedback - Fix idiosyncratic formatting - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage - Remove _gc_generation from ShenandoahHeap - Little cleanup, remove one active generation usage - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage - Finish removing usages of gc_generation, start on reducing usages of active_generation - ... and 3 more: https://git.openjdk.org/jdk/compare/45e145fa...d6238476 ------------- Changes: https://git.openjdk.org/jdk/pull/27703/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27703&range=02 Stats: 522 lines in 32 files changed: 121 ins; 161 del; 240 mod Patch: https://git.openjdk.org/jdk/pull/27703.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27703/head:pull/27703 PR: https://git.openjdk.org/jdk/pull/27703 From ysr at openjdk.org Thu Oct 23 17:45:23 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Thu, 23 Oct 2025 17:45:23 GMT Subject: RFR: 8369068: GenShen: Generations still aren't reconciled assertion failure [v3] In-Reply-To: References: Message-ID: <9N0e9G1mJKNpBv7HEZLiBdOAkgDG8buiCeRxNcXTaxQ=.b2b821fb-530b-4768-bf35-acc9cd58bb82@github.com> On Thu, 23 Oct 2025 17:10:36 GMT, William Kemper wrote: >> There are certain code paths in Shenandoah's generational mode that need to _know_ which generation is being collected, but it is not possible to pass this information on the stack (barriers, for example). To address this, we introduced an `_active_generation` member in `ShenandoahHeap`. Over time, the usage of this field grew beyond its intended purpose and we began to have issues where not all threads would see a consistent value for this field. To address _this_ issue, we added another field `_gc_generation` which was only meant to be used by GC threads. At this point, we have three different ways to determine which generation is being collected: the _active_ generation, the _gc_ generation, and the usual function parameters and member fields of the gc components. This PR removes `_gc_generation` and reduces the use of `_active_generation` to only those places where it is not possible to get this information from other means (barriers, mostly). All GC components that can have t his information passed through function calls, now do so. > > William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: > > - More cleanup, review feedback > - Some cleanup, review feedback > - Fix idiosyncratic formatting > - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage > - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage > - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage > - Remove _gc_generation from ShenandoahHeap > - Little cleanup, remove one active generation usage > - Merge remote-tracking branch 'jdk/master' into reduce-gc_generation-usage > - Finish removing usages of gc_generation, start on reducing usages of active_generation > - ... and 3 more: https://git.openjdk.org/jdk/compare/45e145fa...d6238476 ? ------------- Marked as reviewed by ysr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27703#pullrequestreview-3371556400 From wkemper at openjdk.org Thu Oct 23 19:09:58 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 23 Oct 2025 19:09:58 GMT Subject: Integrated: 8369068: GenShen: Generations still aren't reconciled assertion failure In-Reply-To: References: Message-ID: On Wed, 8 Oct 2025 19:26:19 GMT, William Kemper wrote: > There are certain code paths in Shenandoah's generational mode that need to _know_ which generation is being collected, but it is not possible to pass this information on the stack (barriers, for example). To address this, we introduced an `_active_generation` member in `ShenandoahHeap`. Over time, the usage of this field grew beyond its intended purpose and we began to have issues where not all threads would see a consistent value for this field. To address _this_ issue, we added another field `_gc_generation` which was only meant to be used by GC threads. At this point, we have three different ways to determine which generation is being collected: the _active_ generation, the _gc_ generation, and the usual function parameters and member fields of the gc components. This PR removes `_gc_generation` and reduces the use of `_active_generation` to only those places where it is not possible to get this information from other means (barriers, mostly). All GC components that can have th is information passed through function calls, now do so. This pull request has now been integrated. Changeset: b2e431a1 Author: William Kemper URL: https://git.openjdk.org/jdk/commit/b2e431a1cb22b78eca396ac1d97e6c272de72aa9 Stats: 522 lines in 32 files changed: 121 ins; 161 del; 240 mod 8369068: GenShen: Generations still aren't reconciled assertion failure Reviewed-by: ysr, kdnilsen ------------- PR: https://git.openjdk.org/jdk/pull/27703 From wkemper at openjdk.org Thu Oct 23 22:53:18 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 23 Oct 2025 22:53:18 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures Message-ID: Keep track of promotion failures. Report the number of failures and total number of bytes that could not be promoted. These changes were hoisted out of https://github.com/openjdk/jdk/pull/27632. ------------- Commit messages: - Actually log number of objects and their total size that failed promotion - Track and report number of objects and their total size that failed promotion Changes: https://git.openjdk.org/jdk/pull/27962/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27962&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8370520 Stats: 32 lines in 3 files changed: 23 ins; 3 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/27962.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27962/head:pull/27962 PR: https://git.openjdk.org/jdk/pull/27962 From wkemper at openjdk.org Thu Oct 23 22:56:13 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 23 Oct 2025 22:56:13 GMT Subject: RFR: 8370521: GenShen: Various code cleanup related to promotion Message-ID: * Use more log tags for finer grained control over debug output. * Add instrumentation for plab and cset decisions * Fix typos in comments and minor formatting issues * Rename some methods and variables for easier reading There are no behavioral changes here. These changes were hoisted from https://github.com/openjdk/jdk/pull/27632 to facilitate its review. ------------- Commit messages: - Use tags to control log volume, rename methods in collection set, general cleanup Changes: https://git.openjdk.org/jdk/pull/27963/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27963&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8370521 Stats: 75 lines in 12 files changed: 18 ins; 10 del; 47 mod Patch: https://git.openjdk.org/jdk/pull/27963.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27963/head:pull/27963 PR: https://git.openjdk.org/jdk/pull/27963 From kdnilsen at openjdk.org Fri Oct 24 03:41:50 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 24 Oct 2025 03:41:50 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v31] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: Rework implementation of CompressedClassSpaceSizeInJmapHeap.java ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/3b56759c..467e7514 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=30 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=29-30 Stats: 27 lines in 1 file changed: 1 ins; 17 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From fandreuzzi at openjdk.org Fri Oct 24 08:29:05 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Fri, 24 Oct 2025 08:29:05 GMT Subject: RFR: 8370521: GenShen: Various code cleanup related to promotion In-Reply-To: References: Message-ID: On Thu, 23 Oct 2025 22:50:04 GMT, William Kemper wrote: > * Use more log tags for finer grained control over debug output. > * Add instrumentation for plab and cset decisions > * Fix typos in comments and minor formatting issues > * Rename some methods and variables for easier reading > > There are no behavioral changes here. These changes were hoisted from https://github.com/openjdk/jdk/pull/27632 to facilitate its review. Marked as reviewed by fandreuzzi (Author). ------------- PR Review: https://git.openjdk.org/jdk/pull/27963#pullrequestreview-3375081429 From fandreuzzi at openjdk.org Fri Oct 24 08:33:03 2025 From: fandreuzzi at openjdk.org (Francesco Andreuzzi) Date: Fri, 24 Oct 2025 08:33:03 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures In-Reply-To: References: Message-ID: On Thu, 23 Oct 2025 22:46:00 GMT, William Kemper wrote: > Keep track of promotion failures. Report the number of failures and total number of bytes that could not be promoted. These changes were hoisted out of https://github.com/openjdk/jdk/pull/27632. Marked as reviewed by fandreuzzi (Author). ------------- PR Review: https://git.openjdk.org/jdk/pull/27962#pullrequestreview-3375098543 From shade at openjdk.org Fri Oct 24 14:27:39 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Fri, 24 Oct 2025 14:27:39 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures In-Reply-To: References: Message-ID: On Thu, 23 Oct 2025 22:46:00 GMT, William Kemper wrote: > Keep track of promotion failures. Report the number of failures and total number of bytes that could not be promoted. These changes were hoisted out of https://github.com/openjdk/jdk/pull/27632. Looks fine, with a nit. src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.hpp line 129: > 127: // Return the count and size (in words) of failed promotions since the last reset > 128: size_t get_promotion_failed_count() const { return _promotion_failure_count; } > 129: size_t get_promotion_failed_words() const { return _promotion_failure_words; } Shouldn't these be `AtomicAccess::load(...)`-s? I don't think you need memory ordering, but if you are doing the updates atomically somewhere, it stands to reason you want to match the loads with atomics as well. ------------- Marked as reviewed by shade (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27962#pullrequestreview-3377147963 PR Review Comment: https://git.openjdk.org/jdk/pull/27962#discussion_r2460754950 From wkemper at openjdk.org Fri Oct 24 17:36:42 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 24 Oct 2025 17:36:42 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures [v2] In-Reply-To: References: Message-ID: > Keep track of promotion failures. Report the number of failures and total number of bytes that could not be promoted. These changes were hoisted out of https://github.com/openjdk/jdk/pull/27632. William Kemper has updated the pull request incrementally with one additional commit since the last revision: Use atomic load when reading promotion failure counters ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27962/files - new: https://git.openjdk.org/jdk/pull/27962/files/1e80c2a9..9213b8cb Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27962&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27962&range=00-01 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27962.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27962/head:pull/27962 PR: https://git.openjdk.org/jdk/pull/27962 From duke at openjdk.org Fri Oct 24 18:34:34 2025 From: duke at openjdk.org (Harshit470250) Date: Fri, 24 Oct 2025 18:34:34 GMT Subject: RFR: 8347396: Efficient TypeFunc creations Message-ID: This PR do similar changes done by [JDK-8330851](https://bugs.openjdk.org/browse/JDK-8330851) on the GC TypeFunc creation as suggested by [JDK-8347396](https://bugs.openjdk.org/browse/JDK-8347396). As discussed in [https://github.com/openjdk/jdk/pull/21782#discussion_r1906535686,](https://github.com/openjdk/jdk/pull/21782#discussion_r1906535686) I have put guard on the shenandoah gc specific part of the code. ------------- Commit messages: - update make_barrier_type - Merge branch 'openjdk:master' into new_pr - Merge branch 'openjdk:master' into new_pr - My chages Changes: https://git.openjdk.org/jdk/pull/27279/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27279&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8347396 Stats: 146 lines in 4 files changed: 100 ins; 42 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/27279.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27279/head:pull/27279 PR: https://git.openjdk.org/jdk/pull/27279 From kdnilsen at openjdk.org Fri Oct 24 19:50:31 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 24 Oct 2025 19:50:31 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v32] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 154 commits: - Merge remote-tracking branch 'jdk/master' into freeset-has-authoritative-tallies - Rework implementation of CompressedClassSpaceSizeInJmapHeap.java - fix errors in CompressedClassSpaceSizeInJmapHeap.java - Add debug instrumentation to CompressedClassSpaceSizeInJmapHeap.java - Add sleep to CompressedClassSpaceSizeInJmapHeap.java test - Fix up vmstructs and other infrastructure for jmap heap dump - After initialization, check for SoftMaxHeapSize changed by constraints enforcement - clamp SoftMaxHeapSize during initialization - revert change to SoftMaxHeapSizeConstraintFunc - fix anothr override declaration - ... and 144 more: https://git.openjdk.org/jdk/compare/97e5ac6e...abf9b1f8 ------------- Changes: https://git.openjdk.org/jdk/pull/26867/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=31 Stats: 3529 lines in 44 files changed: 2120 ins; 1005 del; 404 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From kdnilsen at openjdk.org Fri Oct 24 20:36:02 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 24 Oct 2025 20:36:02 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures [v2] In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 20:29:41 GMT, Kelvin Nilsen wrote: >> William Kemper has updated the pull request incrementally with one additional commit since the last revision: >> >> Use atomic load when reading promotion failure counters > > src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp line 684: > >> 682: const size_t gc_id = heap->control_thread()->get_gc_id(); >> 683: >> 684: AtomicAccess::inc(&_promotion_failure_count); > > Just noticing that in the next code block, we acquire the heap->lock(). Could we just use that same heap lock to protect adjustments to _promotion_failure_count and _promotion_failure_words and then we would need to use Atomic access operations? Should probably be ok to read these variables without lock. We're only logging these results when evacuation is no longer happening. Right? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27962#discussion_r2461905434 From kdnilsen at openjdk.org Fri Oct 24 20:36:02 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 24 Oct 2025 20:36:02 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures [v2] In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 17:36:42 GMT, William Kemper wrote: >> Keep track of promotion failures. Report the number of failures and total number of bytes that could not be promoted. These changes were hoisted out of https://github.com/openjdk/jdk/pull/27632. > > William Kemper has updated the pull request incrementally with one additional commit since the last revision: > > Use atomic load when reading promotion failure counters src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp line 684: > 682: const size_t gc_id = heap->control_thread()->get_gc_id(); > 683: > 684: AtomicAccess::inc(&_promotion_failure_count); Just noticing that in the next code block, we acquire the heap->lock(). Could we just use that same heap lock to protect adjustments to _promotion_failure_count and _promotion_failure_words and then we would need to use Atomic access operations? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27962#discussion_r2461900363 From kdnilsen at openjdk.org Fri Oct 24 20:36:03 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 24 Oct 2025 20:36:03 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures [v2] In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 20:31:52 GMT, Kelvin Nilsen wrote: >> src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp line 684: >> >>> 682: const size_t gc_id = heap->control_thread()->get_gc_id(); >>> 683: >>> 684: AtomicAccess::inc(&_promotion_failure_count); >> >> Just noticing that in the next code block, we acquire the heap->lock(). Could we just use that same heap lock to protect adjustments to _promotion_failure_count and _promotion_failure_words and then we would need to use Atomic access operations? > > Should probably be ok to read these variables without lock. We're only logging these results when evacuation is no longer happening. Right? Now that we have this new log message, can we get rid of the "promotion failure messages" for individual objects? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27962#discussion_r2461910193 From kdnilsen at openjdk.org Fri Oct 24 20:43:04 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 24 Oct 2025 20:43:04 GMT Subject: RFR: 8370521: GenShen: Various code cleanup related to promotion In-Reply-To: References: Message-ID: On Thu, 23 Oct 2025 22:50:04 GMT, William Kemper wrote: > * Use more log tags for finer grained control over debug output. > * Add instrumentation for plab and cset decisions > * Fix typos in comments and minor formatting issues > * Rename some methods and variables for easier reading > > There are no behavioral changes here. These changes were hoisted from https://github.com/openjdk/jdk/pull/27632 to facilitate its review. Marked as reviewed by kdnilsen (Committer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27963#pullrequestreview-3378773101 From kdnilsen at openjdk.org Fri Oct 24 20:58:17 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 24 Oct 2025 20:58:17 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v32] In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 19:50:31 GMT, Kelvin Nilsen wrote: >> This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. >> Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. >> >> This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. >> >> The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. > > Kelvin Nilsen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 154 commits: > > - Merge remote-tracking branch 'jdk/master' into freeset-has-authoritative-tallies > - Rework implementation of CompressedClassSpaceSizeInJmapHeap.java > - fix errors in CompressedClassSpaceSizeInJmapHeap.java > - Add debug instrumentation to CompressedClassSpaceSizeInJmapHeap.java > - Add sleep to CompressedClassSpaceSizeInJmapHeap.java test > - Fix up vmstructs and other infrastructure for jmap heap dump > - After initialization, check for SoftMaxHeapSize changed by constraints enforcement > - clamp SoftMaxHeapSize during initialization > - revert change to SoftMaxHeapSizeConstraintFunc > - fix anothr override declaration > - ... and 144 more: https://git.openjdk.org/jdk/compare/97e5ac6e...abf9b1f8 > I'm not convinced the change above to move the constraints check sooner is needed in order to use the value of SoftMaxHeapSize in ShenandoahHeap::initialize(). > > What's the error you see without this change? I did some testing after reverting my change to the shared code, and I wasn't able to identify exactly how this change relates to particular regression failures. I've committed new changes to mitigate the issues without changing shared code: 1. Inside ShenandoahHeap::initialize(), we clamp the assignment to _soft_max_size between min_capacity() and max_capacity() 2. In ShenandoahHeap::post_initialize(), we check_soft_max_changed(). This will change the value of _soft_max_size if the current value of SoftMaxHeapSize, which has now had its constraints enforced, differs from the current value of _soft_max_size. Constraints are enforced following initialize() but before post_initialize(). ------------- PR Comment: https://git.openjdk.org/jdk/pull/26867#issuecomment-3444885624 From wkemper at openjdk.org Fri Oct 24 21:06:13 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 24 Oct 2025 21:06:13 GMT Subject: RFR: 8370041: GenShen: Filter young pointers from thread local SATB buffers when only marking old Message-ID: When GenShen is only marking the old generation, we do not need the SATB mechanism to preserve young pointers. We currently filter these out of the SATB buffers during the final-update-refs and init-mark safepoints. This increases latency and introduces no small amount of complexity. It should be possible to instead filter out these pointers when the SATB buffers are 'compacted' before being 'completed'. # Background When GenShen is marking the old generation it leaves the SATB barrier enabled. When a young collection interrupts old marking, it creates a situation where a mutator thread could overwrite a field holding a pointer into a collection set region. The SATB barrier will dutifully place this object in the SATB queue. If this pointer makes it into a mark queue, the marking thread will crash. Prior to this change, GenShen filtered out such pointers _after_ the thread local SATB buffers were completed. After this change, such pointers are filtered out _before_ the buffers are completed. This is more inline with the natural way of things. ------------- Commit messages: - Fix typo in comment - Remove duplicate satb flush closure - Only flush satb once during degenerated cycle - Cleanup and comments - Merge remote-tracking branch 'jdk/master' into piggyback-satb-flush-on-update-roots - Fix assertion - Oops, move inline definition out of ifdef ASSERT - Try piggybacking satb flush on update roots - Flush old satb after update references - Remove unused code - ... and 8 more: https://git.openjdk.org/jdk/compare/62f11cd4...ec58b72f Changes: https://git.openjdk.org/jdk/pull/27983/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27983&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8370041 Stats: 295 lines in 10 files changed: 93 ins; 180 del; 22 mod Patch: https://git.openjdk.org/jdk/pull/27983.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27983/head:pull/27983 PR: https://git.openjdk.org/jdk/pull/27983 From wkemper at openjdk.org Fri Oct 24 21:13:13 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 24 Oct 2025 21:13:13 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v31] In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 03:41:50 GMT, Kelvin Nilsen wrote: >> This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. >> Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. >> >> This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. >> >> The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. > > Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: > > Rework implementation of CompressedClassSpaceSizeInJmapHeap.java test/hotspot/jtreg/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java line 78: > 76: do { > 77: exitValue = run(pb); > 78: } while ((exitValue != 0) && (allowed_retries-- > 0)); Just a nit, but the other variables here use Java's camel case convention, so should probably have `allowedRetries`, not `allowed_retries`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/26867#discussion_r2461988687 From kdnilsen at openjdk.org Fri Oct 24 21:30:01 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 24 Oct 2025 21:30:01 GMT Subject: RFR: 8370041: GenShen: Filter young pointers from thread local SATB buffers when only marking old In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 21:00:40 GMT, William Kemper wrote: > When GenShen is only marking the old generation, we do not need the SATB mechanism to preserve young pointers. We currently filter these out of the SATB buffers during the final-update-refs and init-mark safepoints. This increases latency and introduces no small amount of complexity. It should be possible to instead filter out these pointers when the SATB buffers are 'compacted' before being 'completed'. > > # Background > When GenShen is marking the old generation it leaves the SATB barrier enabled. When a young collection interrupts old marking, it creates a situation where a mutator thread could overwrite a field holding a pointer into a collection set region. The SATB barrier will dutifully place this object in the SATB queue. If this pointer makes it into a mark queue, the marking thread will crash. Prior to this change, GenShen filtered out such pointers _after_ the thread local SATB buffers were completed. After this change, such pointers are filtered out _before_ the buffers are completed. This is more inline with the natural way of things. This is a great simplification. Do we have any performance numbers, especially for reduction in p99.999 and p100 latencies with certain Extremem workloads, which I believe to be related to safepoint flushing of satb buffers? src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp line 1144: > 1142: // becoming part of the old snapshot. > 1143: // 2. The region is allocated during evacuation of old. This is also not a concern because > 1144: // we haven't yet finished marking old so no mixed evacuations will happen. Might be worth mentioning that there may be some additional analysis and code required when we use the forwarding table to recycle cset regions during evacuation and/or updating. If one of these regions becomes old before the SATB buffers have been flushed, then a young cset pointer that lingers in a SATB buffer will "all of a sudden" look like a valid old pointer and will not be purged from the SATB buffer. When we subsequently scan the "object" referenced by this obsolete pointer, we are likely to find "garbage memory", possibly resulting in a crash. I am thinking that an initial fix might be to do this flushing at init-update-refs instead of at final update refs, and to not recycle cset regions until evacuation is all done. Is there a different handshake there that we might piggyback on? ------------- PR Review: https://git.openjdk.org/jdk/pull/27983#pullrequestreview-3378867185 PR Review Comment: https://git.openjdk.org/jdk/pull/27983#discussion_r2461998590 From wkemper at openjdk.org Fri Oct 24 21:57:01 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 24 Oct 2025 21:57:01 GMT Subject: RFR: 8370041: GenShen: Filter young pointers from thread local SATB buffers when only marking old In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 21:16:10 GMT, Kelvin Nilsen wrote: >> When GenShen is only marking the old generation, we do not need the SATB mechanism to preserve young pointers. We currently filter these out of the SATB buffers during the final-update-refs and init-mark safepoints. This increases latency and introduces no small amount of complexity. It should be possible to instead filter out these pointers when the SATB buffers are 'compacted' before being 'completed'. >> >> # Background >> When GenShen is marking the old generation it leaves the SATB barrier enabled. When a young collection interrupts old marking, it creates a situation where a mutator thread could overwrite a field holding a pointer into a collection set region. The SATB barrier will dutifully place this object in the SATB queue. If this pointer makes it into a mark queue, the marking thread will crash. Prior to this change, GenShen filtered out such pointers _after_ the thread local SATB buffers were completed. After this change, such pointers are filtered out _before_ the buffers are completed. This is more inline with the natural way of things. > > src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp line 1144: > >> 1142: // becoming part of the old snapshot. >> 1143: // 2. The region is allocated during evacuation of old. This is also not a concern because >> 1144: // we haven't yet finished marking old so no mixed evacuations will happen. > > Might be worth mentioning that there may be some additional analysis and code required when we use the forwarding table to recycle cset regions during evacuation and/or updating. If one of these regions becomes old before the SATB buffers have been flushed, then a young cset pointer that lingers in a SATB buffer will "all of a sudden" look like a valid old pointer and will not be purged from the SATB buffer. When we subsequently scan the "object" referenced by this obsolete pointer, we are likely to find "garbage memory", possibly resulting in a crash. > > I am thinking that an initial fix might be to do this flushing at init-update-refs instead of at final update refs, and to not recycle cset regions until evacuation is all done. Is there a different handshake there that we might piggyback on? Hmm, that's a good point about recycling regions concurrently. I don't think we can flush before `init-update-refs` because forwarded pointers still exist and the SATB barrier doesn't try to resolve them. That is to say, "bad" pointers can be created throughout the update-refs phase. Even in the (hypothetical) scenario with a forwarding table, a region would only become `old` through an in-place-promotion (in which case, it will never have been recycled) or we will be doing a mixed evacuation. If we are running a mixed evacuation, we will already have finished marking old. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27983#discussion_r2462100316 From wkemper at openjdk.org Fri Oct 24 22:20:02 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 24 Oct 2025 22:20:02 GMT Subject: RFR: 8370041: GenShen: Filter young pointers from thread local SATB buffers when only marking old In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 21:00:40 GMT, William Kemper wrote: > When GenShen is only marking the old generation, we do not need the SATB mechanism to preserve young pointers. We currently filter these out of the SATB buffers during the final-update-refs and init-mark safepoints. This increases latency and introduces no small amount of complexity. It should be possible to instead filter out these pointers when the SATB buffers are 'compacted' before being 'completed'. > > # Background > When GenShen is marking the old generation it leaves the SATB barrier enabled. When a young collection interrupts old marking, it creates a situation where a mutator thread could overwrite a field holding a pointer into a collection set region. The SATB barrier will dutifully place this object in the SATB queue. If this pointer makes it into a mark queue, the marking thread will crash. Prior to this change, GenShen filtered out such pointers _after_ the thread local SATB buffers were completed. After this change, such pointers are filtered out _before_ the buffers are completed. This is more inline with the natural way of things. I have results from an earlier version of this PR that flushed the buffers during `init-mark`. That version showed a consistent 3% improvement on critical _and_ max jops. They also showed a reduction in p99.999 latency for some of the extremem measurements. I will retest with this version. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27983#issuecomment-3445088766 From shade at openjdk.org Fri Oct 24 22:30:03 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Fri, 24 Oct 2025 22:30:03 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures [v2] In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 17:36:42 GMT, William Kemper wrote: >> Keep track of promotion failures. Report the number of failures and total number of bytes that could not be promoted. These changes were hoisted out of https://github.com/openjdk/jdk/pull/27632. > > William Kemper has updated the pull request incrementally with one additional commit since the last revision: > > Use atomic load when reading promotion failure counters Marked as reviewed by shade (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27962#pullrequestreview-3379087151 From wkemper at openjdk.org Fri Oct 24 22:30:04 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 24 Oct 2025 22:30:04 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures [v2] In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 20:33:20 GMT, Kelvin Nilsen wrote: >> Should probably be ok to read these variables without lock. We're only logging these results when evacuation is no longer happening. Right? > > Now that we have this new log message, can we get rid of the "promotion failure messages" for individual objects? We only take the heap lock there conditionally when we haven't yet "squelched" the log message. We could change this to a `log_debug(gc, plab)` level message. The message is still useful when trying to understand the history and context for a how a thread became unable to promote. I'm not completely convinced there aren't still cases where a thread _should_ be able to promote but can't for some (unknown) reason. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27962#discussion_r2462150204 From wkemper at openjdk.org Fri Oct 24 22:30:05 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 24 Oct 2025 22:30:05 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures [v2] In-Reply-To: References: Message-ID: <9GC0R3xlEfMvOMTdEXBL7EjLV8iRh_yaPP7a69YOpWE=.15978eed-6adb-461a-bb5d-1b6de91ed82f@github.com> On Fri, 24 Oct 2025 22:25:56 GMT, William Kemper wrote: >> Now that we have this new log message, can we get rid of the "promotion failure messages" for individual objects? > > We only take the heap lock there conditionally when we haven't yet "squelched" the log message. We could change this to a `log_debug(gc, plab)` level message. The message is still useful when trying to understand the history and context for a how a thread became unable to promote. I'm not completely convinced there aren't still cases where a thread _should_ be able to promote but can't for some (unknown) reason. If we made this a `log_debug(gc, plab)` message, we could make the whole block of code conditional on the log level being enabled. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27962#discussion_r2462151932 From wkemper at openjdk.org Fri Oct 24 23:22:39 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 24 Oct 2025 23:22:39 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures [v3] In-Reply-To: References: Message-ID: > Keep track of promotion failures. Report the number of failures and total number of bytes that could not be promoted. These changes were hoisted out of https://github.com/openjdk/jdk/pull/27632. William Kemper has updated the pull request incrementally with one additional commit since the last revision: Change log level of detailed promotion failure message And only do the work for the message if the log level is enabled. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27962/files - new: https://git.openjdk.org/jdk/pull/27962/files/9213b8cb..a86e34c8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27962&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27962&range=01-02 Stats: 41 lines in 2 files changed: 17 ins; 14 del; 10 mod Patch: https://git.openjdk.org/jdk/pull/27962.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27962/head:pull/27962 PR: https://git.openjdk.org/jdk/pull/27962 From wkemper at openjdk.org Fri Oct 24 23:46:17 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 24 Oct 2025 23:46:17 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures [v4] In-Reply-To: References: Message-ID: > Keep track of promotion failures. Report the number of failures and total number of bytes that could not be promoted. These changes were hoisted out of https://github.com/openjdk/jdk/pull/27632. William Kemper has updated the pull request incrementally with one additional commit since the last revision: New method can be const ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27962/files - new: https://git.openjdk.org/jdk/pull/27962/files/a86e34c8..dac7a318 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27962&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27962&range=02-03 Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/27962.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27962/head:pull/27962 PR: https://git.openjdk.org/jdk/pull/27962 From syan at openjdk.org Sat Oct 25 01:58:45 2025 From: syan at openjdk.org (SendaoYan) Date: Sat, 25 Oct 2025 01:58:45 GMT Subject: RFR: 8370649: Add intermittent tag for gc/shenandoah/generational/TestOldGrowthTriggers.java Message-ID: Hi all, Test gc/shenandoah/generational/TestOldGrowthTriggers.java intermittent fails "'Trigger (Old): Old has overgrown' missing from stdout/stderr" with default JVM options by fastdebug build on linux-aarch64. The failure probability about 1/100. Should we add '@key intermittent' tag for this test until the root cause has been fixed. The '@key intermittent' tag make some test infrasture disable or rerun this test automaticly when it's intermittent fails. Test-fix only. no risk. ------------- Commit messages: - 8370649: Add intermittent tag for gc/shenandoah/generational/TestOldGrowthTriggers.java Changes: https://git.openjdk.org/jdk/pull/27986/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27986&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8370649 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27986.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27986/head:pull/27986 PR: https://git.openjdk.org/jdk/pull/27986 From duke at openjdk.org Sat Oct 25 02:53:01 2025 From: duke at openjdk.org (Josiah Noel) Date: Sat, 25 Oct 2025 02:53:01 GMT Subject: RFR: 8368695: Support 101 switching protocol in jdk.httpserver [v13] In-Reply-To: References: Message-ID: > - adds a flag to ExchangeImpl to signal whether the current request is an Upgrade request > - Adds a new `UpgradeInputStream` to ensure that the server keeps track of when the upgraded request is closed > - on 101 response codes, `sendResponseHeaders` will not immediately close the output stream > - on 101 response codes, `sendResponseHeaders` will use an `UndefLengthOutputStream` Josiah Noel has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 18 commits: - Update ExchangeImpl.java - Merge remote-tracking branch 'upstream/master' into JDK-8368695 - reduce diff - Merge remote-tracking branch 'upstream/master' into JDK-8368695 - Update SwitchingProtocolTest.java - Update SwitchingProtocolTest.java - Update SwitchingProtocolTest.java - add exception test - Create UpgradeOutputStream.java - close raw streams - ... and 8 more: https://git.openjdk.org/jdk/compare/32697bf6...ae2b1184 ------------- Changes: https://git.openjdk.org/jdk/pull/27751/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27751&range=12 Stats: 25304 lines in 632 files changed: 6529 ins; 14641 del; 4134 mod Patch: https://git.openjdk.org/jdk/pull/27751.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27751/head:pull/27751 PR: https://git.openjdk.org/jdk/pull/27751 From duke at openjdk.org Sat Oct 25 02:53:02 2025 From: duke at openjdk.org (Josiah Noel) Date: Sat, 25 Oct 2025 02:53:02 GMT Subject: Withdrawn: 8368695: Support 101 switching protocol in jdk.httpserver In-Reply-To: References: Message-ID: On Fri, 10 Oct 2025 19:45:57 GMT, Josiah Noel wrote: > - adds a flag to ExchangeImpl to signal whether the current request is an Upgrade request > - Adds a new `UpgradeInputStream` to ensure that the server keeps track of when the upgraded request is closed > - on 101 response codes, `sendResponseHeaders` will not immediately close the output stream > - on 101 response codes, `sendResponseHeaders` will use an `UndefLengthOutputStream` This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/27751 From kdnilsen at openjdk.org Sun Oct 26 00:00:03 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Sun, 26 Oct 2025 00:00:03 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v33] In-Reply-To: References: Message-ID: <32pNJLsvsTHcyUfKjADbM-t7phkQt6ZkHUzaztBy4pg=.d7ed6aac-b88f-4ca5-8487-e44884ffaf17@github.com> > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request incrementally with one additional commit since the last revision: reviewer feedback ------------- Changes: - all: https://git.openjdk.org/jdk/pull/26867/files - new: https://git.openjdk.org/jdk/pull/26867/files/abf9b1f8..5557ae9b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=32 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=31-32 Stats: 6 lines in 1 file changed: 0 ins; 2 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From duke at openjdk.org Mon Oct 27 05:11:47 2025 From: duke at openjdk.org (Harshit470250) Date: Mon, 27 Oct 2025 05:11:47 GMT Subject: RFR: 8347396: Efficient TypeFunc creations [v2] In-Reply-To: References: Message-ID: > This PR do similar changes done by [JDK-8330851](https://bugs.openjdk.org/browse/JDK-8330851) on the GC TypeFunc creation as suggested by [JDK-8347396](https://bugs.openjdk.org/browse/JDK-8347396). As discussed in [https://github.com/openjdk/jdk/pull/21782#discussion_r1906535686,](https://github.com/openjdk/jdk/pull/21782#discussion_r1906535686) I have put guard on the shenandoah gc specific part of the code. Harshit470250 has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits: - Merge master - update make_barrier_type - Merge branch 'openjdk:master' into new_pr - Merge branch 'openjdk:master' into new_pr - My chages ------------- Changes: https://git.openjdk.org/jdk/pull/27279/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27279&range=01 Stats: 146 lines in 4 files changed: 100 ins; 42 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/27279.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27279/head:pull/27279 PR: https://git.openjdk.org/jdk/pull/27279 From aseoane at openjdk.org Mon Oct 27 06:37:52 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Mon, 27 Oct 2025 06:37:52 GMT Subject: RFR: 8351149: Remove dead IA32/X32/!AMD64 code blocks after 32-bit x86 removal Message-ID: This PR carries out cleanup of `IA32`-, `X32`- and `!AMD64`-guarded code blocks after the removal of the 32-bit x86 architecture from HotSpot. These code blocks are either not needed anymore or the guards redundant. Please note that this changeset addresses the "complement" of [JDK-8351159](https://github.com/openjdk/jdk/pull/27987). This is to say, this PR targets all directories that are *not* `cpu/x86` and `os_cpu/x86`. **Testing:** passes tiers 1-3 ------------- Commit messages: - X32 - IA32 Changes: https://git.openjdk.org/jdk/pull/27990/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27990&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8351149 Stats: 210 lines in 22 files changed: 0 ins; 185 del; 25 mod Patch: https://git.openjdk.org/jdk/pull/27990.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27990/head:pull/27990 PR: https://git.openjdk.org/jdk/pull/27990 From fweimer at openjdk.org Mon Oct 27 08:27:09 2025 From: fweimer at openjdk.org (Florian Weimer) Date: Mon, 27 Oct 2025 08:27:09 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v2] In-Reply-To: <6u0Ia6A2xQnv51Ti0Jchg6rnncfRRvtK5oGS963CeIA=.bc9c1481-60ad-443d-923b-dc86277dbb14@github.com> References: <6u0Ia6A2xQnv51Ti0Jchg6rnncfRRvtK5oGS963CeIA=.bc9c1481-60ad-443d-923b-dc86277dbb14@github.com> Message-ID: <4Yh4KeUItjdDYihe9d1u66tBROofb0pRLDKIdhw-XZo=.cf383363-c963-4871-941d-5e358f74c048@github.com> On Thu, 9 Oct 2025 12:16:11 GMT, Kim Barrett wrote: >> doc/hotspot-style.md line 567: >> >>> 565: >>> 566: Functions that may throw exceptions must not be used. This is in accordance >>> 567: with the HotSpot policy of [not using exceptions](#error-handling). >> >> In the GCC implementation, destructor registration may throw `__gnu_cxx::recursive_init_error` (via the `__cxa_guard_acquire` Itanium ABI function). Are global or static objects with non-trivial destructors permitted? I think there are a couple of such uses today. > > We (you and me, @fweimer-rh) discussed this a couple of years ago: > https://mail.openjdk.org/pipermail/hotspot-dev/2023-December/082324.html > > Quoting from here: > https://mail.openjdk.org/pipermail/hotspot-dev/2023-December/083142.html > > " > Empirically, a recursive initialization attempt doesn't make any attempt to > throw. Rather, it blocks forever waiting for a futex signal from a thread that > succeeds in the initialization. Which of course will never come. > > And that makes sense, now that I've looked at the code. > > In __cxa_guard_acquire, with _GLIBCXX_USE_FUTEX, if the guard indicates > initialization hasn't yet been completed, then it goes into a while loop. > This while loop tries to claim initialization. Failing that, it checks > whether initialization is complete. Failing that, it does a SYS_futex > syscall, waiting for some other thread to perform the initialization. There's > nothing there to check for recursion. > > throw_recursive_init_exception is only called if single-threaded (either by > configuration or at runtime). > " > > It doesn't look like there have been any relevant changes in that area since > then. So I think there is still not a problem here. @kimbarrett Sorry, I forgot about the old thread. You can get the exception in a single-threaded scenario, something like this: struct S { S() { static S s; *this = s; } } global; Maybe the actual rule is more like this? > Functions that may throw exceptions must not be used, unless individual calls ensure that these particular invocations cannot throw exceptions. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27601#discussion_r2464779655 From roland at openjdk.org Mon Oct 27 09:18:11 2025 From: roland at openjdk.org (Roland Westrelin) Date: Mon, 27 Oct 2025 09:18:11 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v9] In-Reply-To: References: Message-ID: On Wed, 22 Oct 2025 07:56:12 GMT, Emanuel Peter wrote: >> src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp line 1780: >> >>> 1778: fix_memory_uses(u, n, n, c); >>> 1779: } else if (_phase->C->get_alias_index(u->adr_type()) == _alias) { >>> 1780: _phase->igvn().replace_node(u, n); >> >> As far as I can see, the `lazy_replace` only did `igvn.replace_node` for non-ctrl nodes anyway. Since we are dealing with `PhiNode`s here, we might as well only use `igvn.replace_node`. >> >> I discovered this, because it hit my `!old_node->is_CFG()` check. > > @rwestrel Do you have an opinion on this? That change looks good to me. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2464914445 From stefank at openjdk.org Mon Oct 27 09:24:09 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Mon, 27 Oct 2025 09:24:09 GMT Subject: RFR: 8351149: Remove dead IA32/X32/!AMD64 code blocks after 32-bit x86 removal In-Reply-To: References: Message-ID: On Sun, 26 Oct 2025 09:18:40 GMT, Anton Seoane Ampudia wrote: > This PR carries out cleanup of `IA32`-, `X32`- and `!AMD64`-guarded code blocks after the removal of the 32-bit x86 architecture from HotSpot. > > These code blocks are either not needed anymore or the guards redundant. > > Please note that this changeset addresses the "complement" of [JDK-8351159](https://github.com/openjdk/jdk/pull/27987). This is to say, this PR targets all directories that are *not* `cpu/x86` and `os_cpu/x86`. > > **Testing:** passes tiers 1-3 Changes requested by stefank (Reviewer). src/hotspot/os/linux/os_linux.cpp line 3097: > 3095: vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu); > 3096: retval = vgetcpu(&cpu, nullptr, nullptr); > 3097: #endif Should this really have been removed? ------------- PR Review: https://git.openjdk.org/jdk/pull/27990#pullrequestreview-3382481257 PR Review Comment: https://git.openjdk.org/jdk/pull/27990#discussion_r2464928052 From epeter at openjdk.org Mon Oct 27 10:22:53 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Mon, 27 Oct 2025 10:22:53 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v10] In-Reply-To: References: Message-ID: > When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. > > Here, I'm doing the following: > - Add more documentation, and improve it in other cases. > - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. > - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` > - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` > - Made some methods private, and added some additional asserts. > > I'd be more than happy for even better names, and suggestions how to improve the documentation further :) > > Related issues: > https://github.com/openjdk/jdk/pull/27889 > https://github.com/openjdk/jdk/pull/15720 Emanuel Peter 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 19 additional commits since the last revision: - Merge branch 'master' into JDK-8370220-get-ctrl-documentation - Merge branch 'JDK-8370220-get-ctrl-documentation' of https://github.com/eme64/jdk into JDK-8370220-get-ctrl-documentation - Apply suggestions from code review Co-authored-by: Christian Hagedorn - fix shenandoah replace for phis - renaming for Tobias - Apply suggestions from code review Co-authored-by: Tobias Hartmann - more for Christian part 3 - more for Christian part 2 - Apply suggestions from code review Co-authored-by: Christian Hagedorn - for Christian part 1 - ... and 9 more: https://git.openjdk.org/jdk/compare/aa5cb3a4...e4bcb769 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27892/files - new: https://git.openjdk.org/jdk/pull/27892/files/44e808bb..e4bcb769 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27892&range=08-09 Stats: 14620 lines in 312 files changed: 8959 ins; 3739 del; 1922 mod Patch: https://git.openjdk.org/jdk/pull/27892.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27892/head:pull/27892 PR: https://git.openjdk.org/jdk/pull/27892 From epeter at openjdk.org Mon Oct 27 10:22:54 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Mon, 27 Oct 2025 10:22:54 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v7] In-Reply-To: References: <5NCbOn36uvy0cTen6j1ys_E4uDD-qWjW5N1B-doqCGU=.4f75ce02-f27c-4d9a-ace8-5073f211d78f@github.com> Message-ID: On Tue, 21 Oct 2025 09:42:41 GMT, Christian Hagedorn wrote: >> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision: >> >> renaming for Tobias > > Good naming update! The update looks good to me apart from some last nits. @chhagedorn @TobiHartmann Would either of you be able to re-approve? I've fixed a little issue for shenandoah, and Roland approved that change. I merged with master and am currently running some last testing. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27892#issuecomment-3450525961 From epeter at openjdk.org Mon Oct 27 10:22:55 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Mon, 27 Oct 2025 10:22:55 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v9] In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 09:15:45 GMT, Roland Westrelin wrote: >> @rwestrel Do you have an opinion on this? > > That change looks good to me. @rwestrel Thank, good to know :) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2465115642 From chagedorn at openjdk.org Mon Oct 27 10:34:07 2025 From: chagedorn at openjdk.org (Christian Hagedorn) Date: Mon, 27 Oct 2025 10:34:07 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v10] In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 10:22:53 GMT, Emanuel Peter wrote: >> When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. >> >> Here, I'm doing the following: >> - Add more documentation, and improve it in other cases. >> - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. >> - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` >> - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` >> - Made some methods private, and added some additional asserts. >> >> I'd be more than happy for even better names, and suggestions how to improve the documentation further :) >> >> Related issues: >> https://github.com/openjdk/jdk/pull/27889 >> https://github.com/openjdk/jdk/pull/15720 > > Emanuel Peter 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 19 additional commits since the last revision: > > - Merge branch 'master' into JDK-8370220-get-ctrl-documentation > - Merge branch 'JDK-8370220-get-ctrl-documentation' of https://github.com/eme64/jdk into JDK-8370220-get-ctrl-documentation > - Apply suggestions from code review > > Co-authored-by: Christian Hagedorn > - fix shenandoah replace for phis > - renaming for Tobias > - Apply suggestions from code review > > Co-authored-by: Tobias Hartmann > - more for Christian part 3 > - more for Christian part 2 > - Apply suggestions from code review > > Co-authored-by: Christian Hagedorn > - for Christian part 1 > - ... and 9 more: https://git.openjdk.org/jdk/compare/2da7861e...e4bcb769 Still good! ------------- Marked as reviewed by chagedorn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27892#pullrequestreview-3382807850 From thartmann at openjdk.org Mon Oct 27 13:41:18 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Mon, 27 Oct 2025 13:41:18 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v10] In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 10:22:53 GMT, Emanuel Peter wrote: >> When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. >> >> Here, I'm doing the following: >> - Add more documentation, and improve it in other cases. >> - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. >> - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` >> - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` >> - Made some methods private, and added some additional asserts. >> >> I'd be more than happy for even better names, and suggestions how to improve the documentation further :) >> >> Related issues: >> https://github.com/openjdk/jdk/pull/27889 >> https://github.com/openjdk/jdk/pull/15720 > > Emanuel Peter 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 19 additional commits since the last revision: > > - Merge branch 'master' into JDK-8370220-get-ctrl-documentation > - Merge branch 'JDK-8370220-get-ctrl-documentation' of https://github.com/eme64/jdk into JDK-8370220-get-ctrl-documentation > - Apply suggestions from code review > > Co-authored-by: Christian Hagedorn > - fix shenandoah replace for phis > - renaming for Tobias > - Apply suggestions from code review > > Co-authored-by: Tobias Hartmann > - more for Christian part 3 > - more for Christian part 2 > - Apply suggestions from code review > > Co-authored-by: Christian Hagedorn > - for Christian part 1 > - ... and 9 more: https://git.openjdk.org/jdk/compare/ca257175...e4bcb769 Marked as reviewed by thartmann (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27892#pullrequestreview-3383556091 From wkemper at openjdk.org Mon Oct 27 17:06:10 2025 From: wkemper at openjdk.org (William Kemper) Date: Mon, 27 Oct 2025 17:06:10 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures [v5] In-Reply-To: References: Message-ID: > Keep track of promotion failures. Report the number of failures and total number of bytes that could not be promoted. These changes were hoisted out of https://github.com/openjdk/jdk/pull/27632. William Kemper has updated the pull request incrementally with one additional commit since the last revision: Fix build ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27962/files - new: https://git.openjdk.org/jdk/pull/27962/files/dac7a318..96357b45 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27962&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27962&range=03-04 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27962.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27962/head:pull/27962 PR: https://git.openjdk.org/jdk/pull/27962 From shade at openjdk.org Mon Oct 27 17:13:45 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Mon, 27 Oct 2025 17:13:45 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures [v5] In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 17:06:10 GMT, William Kemper wrote: >> Keep track of promotion failures. Report the number of failures and total number of bytes that could not be promoted. These changes were hoisted out of https://github.com/openjdk/jdk/pull/27632. > > William Kemper has updated the pull request incrementally with one additional commit since the last revision: > > Fix build Marked as reviewed by shade (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27962#pullrequestreview-3384598340 From wkemper at openjdk.org Mon Oct 27 17:50:04 2025 From: wkemper at openjdk.org (William Kemper) Date: Mon, 27 Oct 2025 17:50:04 GMT Subject: RFR: 8370649: Add intermittent tag for gc/shenandoah/generational/TestOldGrowthTriggers.java In-Reply-To: References: Message-ID: On Sat, 25 Oct 2025 01:50:25 GMT, SendaoYan wrote: > Hi all, > > Test gc/shenandoah/generational/TestOldGrowthTriggers.java intermittent fails "'Trigger (Old): Old has overgrown' missing from stdout/stderr" with default JVM options by fastdebug build on linux-aarch64. The failure probability about 1/100. > > Should we add '@key intermittent' tag for this test until the root cause has been fixed. The '@key intermittent' tag make some test infrasture disable or rerun this test automaticly when it's intermittent fails. > > Test-fix only. no risk. Thank you for this PR. We will still investigate the test failure. ------------- Marked as reviewed by wkemper (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27986#pullrequestreview-3384739668 From wkemper at openjdk.org Mon Oct 27 21:01:41 2025 From: wkemper at openjdk.org (William Kemper) Date: Mon, 27 Oct 2025 21:01:41 GMT Subject: Integrated: 8370520: GenShen: Track and report on promotion failures In-Reply-To: References: Message-ID: On Thu, 23 Oct 2025 22:46:00 GMT, William Kemper wrote: > Keep track of promotion failures. Report the number of failures and total number of bytes that could not be promoted. These changes were hoisted out of https://github.com/openjdk/jdk/pull/27632. This pull request has now been integrated. Changeset: 70aa3678 Author: William Kemper URL: https://git.openjdk.org/jdk/commit/70aa3678fccddc1a626fd86b9cec348fae571555 Stats: 64 lines in 3 files changed: 36 ins; 12 del; 16 mod 8370520: GenShen: Track and report on promotion failures Reviewed-by: shade, fandreuzzi ------------- PR: https://git.openjdk.org/jdk/pull/27962 From kdnilsen at openjdk.org Mon Oct 27 21:54:11 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Mon, 27 Oct 2025 21:54:11 GMT Subject: RFR: 8370520: GenShen: Track and report on promotion failures [v2] In-Reply-To: <9GC0R3xlEfMvOMTdEXBL7EjLV8iRh_yaPP7a69YOpWE=.15978eed-6adb-461a-bb5d-1b6de91ed82f@github.com> References: <9GC0R3xlEfMvOMTdEXBL7EjLV8iRh_yaPP7a69YOpWE=.15978eed-6adb-461a-bb5d-1b6de91ed82f@github.com> Message-ID: On Fri, 24 Oct 2025 22:27:26 GMT, William Kemper wrote: >> We only take the heap lock there conditionally when we haven't yet "squelched" the log message. We could change this to a `log_debug(gc, plab)` level message. The message is still useful when trying to understand the history and context for a how a thread became unable to promote. I'm not completely convinced there aren't still cases where a thread _should_ be able to promote but can't for some (unknown) reason. > > If we made this a `log_debug(gc, plab)` message, we could make the whole block of code conditional on the log level being enabled. I'd be comfortable with that. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27962#discussion_r2467171498 From xpeng at openjdk.org Mon Oct 27 21:59:35 2025 From: xpeng at openjdk.org (Xiaolong Peng) Date: Mon, 27 Oct 2025 21:59:35 GMT Subject: RFR: 8361099: Shenandoah: Improve heap lock contention by using CAS for memory allocation [v5] In-Reply-To: References: Message-ID: > Shenandoah always allocates memory with heap lock, we have observed heavy heap lock contention on memory allocation path in performance analysis of some service in which we tried to adopt Shenandoah. This change is to propose an optimization for the code path of mutator memory allocation to improve heap lock contention, at vey high level, here is how it works: > * ShenandoahFreeSet holds a N (default to 13) number of ShenandoahHeapRegion* which are used by mutator threads for regular object allocations, they are called shared regions/directly allocatable regions, which are stored in PaddedEnd data structure(padded array). > * Each mutator thread will be assigned one of the directly allocatable regions, the thread will try to allocate in the directly allocatable region with CAS atomic operation, if fails will try 2 more consecutive directly allocatable regions in the array storing directly allocatable region. > * If mutator thread fails after trying 3 directly allocatable regions, it will: > * Take heap lock > * Try to retire the directly allocatable regions which are ready to retire. > * Iterator mutator partition and allocate directly allocatable regions and store to the padded array if any need to be retired. > * Satisfy mutator allocation request if possible. > > > I'm not expecting significant performance impact for most of the cases since in most case the contention on heap lock it not high enough to cause performance issue, I have done many tests, here are some of them: > > 1. Dacapo lusearch test on EC2 host with 96 CPU cores: > Openjdk TIP: > > [ec2-user at ip-172-31-42-91 jdk]$ ./master-jdk/bin/java -XX:-TieredCompilation -XX:+AlwaysPreTouch -Xms4G -Xmx4G -XX:+UseShenandoahGC -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-ShenandoahUncommit -XX:ShenandoahGCMode=generational -XX:+UseTLAB -jar ~/tools/dacapo/dacapo-23.11-MR2-chopin.jar -n 10 lusearch | grep "metered full smoothing" > ===== DaCapo tail latency, metered full smoothing: 50% 131684 usec, 90% 200192 usec, 99% 211369 usec, 99.9% 212517 usec, 99.99% 213043 usec, max 235289 usec, measured over 524288 events ===== > ===== DaCapo tail latency, metered full smoothing: 50% 1568 usec, 90% 36101 usec, 99% 42172 usec, 99.9% 42928 usec, 99.99% 43100 usec, max 43305 usec, measured over 524288 events ===== > ===== DaCapo tail latency, metered full smoothing: 50% 52644 usec, 90% 124393 usec, 99% 137711 usec, 99.9% 139355 usec, 99.99% 139749 usec, max 146722 usec, measured over 524288 events ====... Xiaolong Peng has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 135 commits: - Merge branch 'openjdk:master' into cas-alloc-1 - Merge branch 'openjdk:master' into cas-alloc-1 - format - Merge branch 'openjdk:master' into cas-alloc-1 - Merge branch 'openjdk:master' into cas-alloc-1 - Merge branch 'master' into cas-alloc-1 - Move ShenandoahHeapRegionIterationClosure to shenandoahFreeSet.hpp - Merge branch 'openjdk:master' into cas-alloc-1 - Fix errors caused by renaming ofAtomic to AtomicAccess - Merge branch 'openjdk:master' into cas-alloc-1 - ... and 125 more: https://git.openjdk.org/jdk/compare/2f613911...e6bfef05 ------------- Changes: https://git.openjdk.org/jdk/pull/26171/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26171&range=04 Stats: 735 lines in 16 files changed: 674 ins; 7 del; 54 mod Patch: https://git.openjdk.org/jdk/pull/26171.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26171/head:pull/26171 PR: https://git.openjdk.org/jdk/pull/26171 From syan at openjdk.org Tue Oct 28 01:24:11 2025 From: syan at openjdk.org (SendaoYan) Date: Tue, 28 Oct 2025 01:24:11 GMT Subject: RFR: 8370649: Add intermittent tag for gc/shenandoah/generational/TestOldGrowthTriggers.java In-Reply-To: References: Message-ID: <9ysx-wUFeHHX5b2P7jGI5Rt2t2KlqH-paYaYeAAN2s8=.78781c4b-6cc8-467e-9eb4-88dd94c7c820@github.com> On Mon, 27 Oct 2025 17:47:20 GMT, William Kemper wrote: >> Hi all, >> >> Test gc/shenandoah/generational/TestOldGrowthTriggers.java intermittent fails "'Trigger (Old): Old has overgrown' missing from stdout/stderr" with default JVM options by fastdebug build on linux-aarch64. The failure probability about 1/100. >> >> Should we add '@key intermittent' tag for this test until the root cause has been fixed. The '@key intermittent' tag make some test infrasture disable or rerun this test automaticly when it's intermittent fails. >> >> Test-fix only. no risk. > > Thank you for this PR. We will still investigate the test failure. Thanks for the reviews @earthling-amzn ------------- PR Comment: https://git.openjdk.org/jdk/pull/27986#issuecomment-3454025662 From syan at openjdk.org Tue Oct 28 01:24:12 2025 From: syan at openjdk.org (SendaoYan) Date: Tue, 28 Oct 2025 01:24:12 GMT Subject: Integrated: 8370649: Add intermittent tag for gc/shenandoah/generational/TestOldGrowthTriggers.java In-Reply-To: References: Message-ID: On Sat, 25 Oct 2025 01:50:25 GMT, SendaoYan wrote: > Hi all, > > Test gc/shenandoah/generational/TestOldGrowthTriggers.java intermittent fails "'Trigger (Old): Old has overgrown' missing from stdout/stderr" with default JVM options by fastdebug build on linux-aarch64. The failure probability about 1/100. > > Should we add '@key intermittent' tag for this test until the root cause has been fixed. The '@key intermittent' tag make some test infrasture disable or rerun this test automaticly when it's intermittent fails. > > Test-fix only. no risk. This pull request has now been integrated. Changeset: b3e63aea Author: SendaoYan URL: https://git.openjdk.org/jdk/commit/b3e63aeab304016b9b479a05f44ed1c8dfb0b9bb Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod 8370649: Add intermittent tag for gc/shenandoah/generational/TestOldGrowthTriggers.java Reviewed-by: wkemper ------------- PR: https://git.openjdk.org/jdk/pull/27986 From epeter at openjdk.org Tue Oct 28 06:45:18 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Tue, 28 Oct 2025 06:45:18 GMT Subject: RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v10] In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 10:31:42 GMT, Christian Hagedorn wrote: >> Emanuel Peter 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 19 additional commits since the last revision: >> >> - Merge branch 'master' into JDK-8370220-get-ctrl-documentation >> - Merge branch 'JDK-8370220-get-ctrl-documentation' of https://github.com/eme64/jdk into JDK-8370220-get-ctrl-documentation >> - Apply suggestions from code review >> >> Co-authored-by: Christian Hagedorn >> - fix shenandoah replace for phis >> - renaming for Tobias >> - Apply suggestions from code review >> >> Co-authored-by: Tobias Hartmann >> - more for Christian part 3 >> - more for Christian part 2 >> - Apply suggestions from code review >> >> Co-authored-by: Christian Hagedorn >> - for Christian part 1 >> - ... and 9 more: https://git.openjdk.org/jdk/compare/ffb48287...e4bcb769 > > Still good! @chhagedorn @TobiHartmann Thanks for the review / approval! @rwestrel Thanks for approving the shanandoah changes! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27892#issuecomment-3454862103 From epeter at openjdk.org Tue Oct 28 06:45:19 2025 From: epeter at openjdk.org (Emanuel Peter) Date: Tue, 28 Oct 2025 06:45:19 GMT Subject: Integrated: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes In-Reply-To: References: Message-ID: On Mon, 20 Oct 2025 08:57:33 GMT, Emanuel Peter wrote: > When working on https://github.com/openjdk/jdk/pull/27889, I was irritated by the lack of documentation and suboptimal naming. > > Here, I'm doing the following: > - Add more documentation, and improve it in other cases. > - Rename "lazy" methods: "lazy" could indicate that we delay it somehow until later, but it is unclear what is delayed. > - `lazy_replace` -> `replace_ctrl_node_and_forward_ctrl_and_idom` > - `lazy_update` -> `install_lazy_ctrl_and_idom_forwarding` > - Made some methods private, and added some additional asserts. > > I'd be more than happy for even better names, and suggestions how to improve the documentation further :) > > Related issues: > https://github.com/openjdk/jdk/pull/27889 > https://github.com/openjdk/jdk/pull/15720 This pull request has now been integrated. Changeset: d5ce6669 Author: Emanuel Peter URL: https://git.openjdk.org/jdk/commit/d5ce66698d2f15c5f8316110a6118a10baa4013d Stats: 126 lines in 8 files changed: 63 ins; 4 del; 59 mod 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes Reviewed-by: chagedorn, thartmann ------------- PR: https://git.openjdk.org/jdk/pull/27892 From aseoane at openjdk.org Tue Oct 28 09:10:08 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Tue, 28 Oct 2025 09:10:08 GMT Subject: RFR: 8351149: Remove dead IA32/X32/!AMD64 code blocks after 32-bit x86 removal In-Reply-To: References: Message-ID: On Mon, 27 Oct 2025 09:19:24 GMT, Stefan Karlsson wrote: >> This PR carries out cleanup of `IA32`-, `X32`- and `!AMD64`-guarded code blocks after the removal of the 32-bit x86 architecture from HotSpot. >> >> These code blocks are either not needed anymore or the guards redundant. >> >> Please note that this changeset addresses the "complement" of [JDK-8351159](https://github.com/openjdk/jdk/pull/27987). This is to say, this PR targets all directories that are *not* `cpu/x86` and `os_cpu/x86`. >> >> **Testing:** passes tiers 1-3 > > src/hotspot/os/linux/os_linux.cpp line 3097: > >> 3095: vgetcpu_t vgetcpu = (vgetcpu_t)VSYSCALL_ADDR(__NR_vgetcpu); >> 3096: retval = vgetcpu(&cpu, nullptr, nullptr); >> 3097: #endif > > Should this really have been removed? It really shouldn't have. Fixed it ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27990#discussion_r2468603246 From aseoane at openjdk.org Tue Oct 28 11:36:44 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Tue, 28 Oct 2025 11:36:44 GMT Subject: RFR: 8351149: Remove dead IA32/X32/!AMD64 code blocks after 32-bit x86 removal [v2] In-Reply-To: References: Message-ID: > This PR carries out cleanup of `IA32`-, `X32`- and `!AMD64`-guarded code blocks after the removal of the 32-bit x86 architecture from HotSpot. > > These code blocks are either not needed anymore or the guards redundant. > > Please note that this changeset addresses the "complement" of [JDK-8351159](https://github.com/openjdk/jdk/pull/27987). This is to say, this PR targets all directories that are *not* `cpu/x86` and `os_cpu/x86`. > > **Testing:** passes tiers 1-3 Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: Apply review comments (restore mistakenly cleaned define) ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27990/files - new: https://git.openjdk.org/jdk/pull/27990/files/e36fc5ac..a26d83f9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27990&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27990&range=00-01 Stats: 12 lines in 1 file changed: 12 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27990.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27990/head:pull/27990 PR: https://git.openjdk.org/jdk/pull/27990 From stefank at openjdk.org Tue Oct 28 12:11:05 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Tue, 28 Oct 2025 12:11:05 GMT Subject: RFR: 8351149: Remove dead IA32/X32/!AMD64 code blocks after 32-bit x86 removal [v2] In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 11:36:44 GMT, Anton Seoane Ampudia wrote: >> This PR carries out cleanup of `IA32`-, `X32`- and `!AMD64`-guarded code blocks after the removal of the 32-bit x86 architecture from HotSpot. >> >> These code blocks are either not needed anymore or the guards redundant. >> >> Please note that this changeset addresses the "complement" of [JDK-8351159](https://github.com/openjdk/jdk/pull/27987). This is to say, this PR targets all directories that are *not* `cpu/x86` and `os_cpu/x86`. >> >> **Testing:** passes tiers 1-3 > > Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: > > Apply review comments (restore mistakenly cleaned define) Marked as reviewed by stefank (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27990#pullrequestreview-3388453838 From ayang at openjdk.org Tue Oct 28 12:32:11 2025 From: ayang at openjdk.org (Albert Mingkun Yang) Date: Tue, 28 Oct 2025 12:32:11 GMT Subject: RFR: 8351149: Remove dead IA32/X32/!AMD64 code blocks after 32-bit x86 removal [v2] In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 11:36:44 GMT, Anton Seoane Ampudia wrote: >> This PR carries out cleanup of `IA32`-, `X32`- and `!AMD64`-guarded code blocks after the removal of the 32-bit x86 architecture from HotSpot. >> >> These code blocks are either not needed anymore or the guards redundant. >> >> Please note that this changeset addresses the "complement" of [JDK-8351159](https://github.com/openjdk/jdk/pull/27987). This is to say, this PR targets all directories that are *not* `cpu/x86` and `os_cpu/x86`. >> >> **Testing:** passes tiers 1-3 > > Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: > > Apply review comments (restore mistakenly cleaned define) Marked as reviewed by ayang (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27990#pullrequestreview-3388536050 From duke at openjdk.org Tue Oct 28 12:50:05 2025 From: duke at openjdk.org (duke) Date: Tue, 28 Oct 2025 12:50:05 GMT Subject: RFR: 8351149: Remove dead IA32/X32/!AMD64 code blocks after 32-bit x86 removal [v2] In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 11:36:44 GMT, Anton Seoane Ampudia wrote: >> This PR carries out cleanup of `IA32`-, `X32`- and `!AMD64`-guarded code blocks after the removal of the 32-bit x86 architecture from HotSpot. >> >> These code blocks are either not needed anymore or the guards redundant. >> >> Please note that this changeset addresses the "complement" of [JDK-8351159](https://github.com/openjdk/jdk/pull/27987). This is to say, this PR targets all directories that are *not* `cpu/x86` and `os_cpu/x86`. >> >> **Testing:** passes tiers 1-3 > > Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: > > Apply review comments (restore mistakenly cleaned define) @anton-seoane Your change (at version a26d83f936d1abd1b4c5c9da8382bd81f8f7f046) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27990#issuecomment-3456303809 From aseoane at openjdk.org Tue Oct 28 12:50:05 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Tue, 28 Oct 2025 12:50:05 GMT Subject: RFR: 8351149: Remove dead IA32/X32/!AMD64 code blocks after 32-bit x86 removal [v2] In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 11:36:44 GMT, Anton Seoane Ampudia wrote: >> This PR carries out cleanup of `IA32`-, `X32`- and `!AMD64`-guarded code blocks after the removal of the 32-bit x86 architecture from HotSpot. >> >> These code blocks are either not needed anymore or the guards redundant. >> >> Please note that this changeset addresses the "complement" of [JDK-8351159](https://github.com/openjdk/jdk/pull/27987). This is to say, this PR targets all directories that are *not* `cpu/x86` and `os_cpu/x86`. >> >> **Testing:** passes tiers 1-3 > > Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: > > Apply review comments (restore mistakenly cleaned define) Thanks all for the reviews! ------------- PR Comment: https://git.openjdk.org/jdk/pull/27990#issuecomment-3456305029 From wkemper at openjdk.org Tue Oct 28 17:33:42 2025 From: wkemper at openjdk.org (William Kemper) Date: Tue, 28 Oct 2025 17:33:42 GMT Subject: RFR: 8369013: Shenandoah: passive mode should support enabling ShenandoahCardBarrier In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 00:18:03 GMT, Rui Li wrote: > Add card barriers to passive mode to test out the price of card barriers. > > How this change is implemented is to instantiate the old region in passive mode - old region owns the card table so this would minimize the code change with a bit price of native memory. It does sound weird to have old gen in passive mode, but since passive mode is a just diagnostic mode, we'll go with it for the cleanliness of the change. This turned out to be simpler than expected. Nice work. I suggest some small changes. src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.hpp line 47: > 45: > 46: static ShenandoahGenerationalHeap* heap() { > 47: shenandoah_assert_generational(); Can we put these assertions back? I don't see any code in the PR that would invalidate these assertions. I also don't see any changes that would instantiate the generational heap for non generational mode, so if there _is_ code trying to use the generational heap, its behavior will be undefined. src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 255: > 253: // for the purpose of having card table. > 254: if (ShenandoahCardBarrier && !(mode()->is_generational())) { > 255: _generation_sizer.heap_size_changed(max_capacity()); I think we could simplify here by not using the `_generation_sizer`. It should be fine to pass `max_capacity()` instead of `max_capacity_old` here. src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp line 533: > 531: > 532: ShenandoahOldGeneration* old_generation() const { > 533: assert(mode()->is_generational(), "Old generation requires generational mode"); Can we assert that `ShenandoahCardBarrier` is on instead of removing this assertion? src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp line 566: > 564: // For exporting to SA > 565: int _log_min_obj_alignment_in_bytes; > 566: ShenandoahGenerationSizer _generation_sizer; I don't think we need this here. ------------- Changes requested by wkemper (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27966#pullrequestreview-3378765228 PR Review Comment: https://git.openjdk.org/jdk/pull/27966#discussion_r2461936571 PR Review Comment: https://git.openjdk.org/jdk/pull/27966#discussion_r2461923434 PR Review Comment: https://git.openjdk.org/jdk/pull/27966#discussion_r2461925051 PR Review Comment: https://git.openjdk.org/jdk/pull/27966#discussion_r2461928806 From duke at openjdk.org Tue Oct 28 17:33:43 2025 From: duke at openjdk.org (Rui Li) Date: Tue, 28 Oct 2025 17:33:43 GMT Subject: RFR: 8369013: Shenandoah: passive mode should support enabling ShenandoahCardBarrier In-Reply-To: References: Message-ID: <7fmLPWnHWEMLkVD5t_cXpkH_-WQ3-5Pxz7aGw4lbjsE=.a462aebf-32e1-4b88-a84a-f719a26897fe@github.com> On Fri, 24 Oct 2025 20:44:01 GMT, William Kemper wrote: >> Add card barriers to passive mode to test out the price of card barriers. >> >> How this change is implemented is to instantiate the old region in passive mode - old region owns the card table so this would minimize the code change with a bit price of native memory. It does sound weird to have old gen in passive mode, but since passive mode is a just diagnostic mode, we'll go with it for the cleanliness of the change. > > src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.hpp line 47: > >> 45: >> 46: static ShenandoahGenerationalHeap* heap() { >> 47: shenandoah_assert_generational(); > > Can we put these assertions back? I don't see any code in the PR that would invalidate these assertions. I also don't see any changes that would instantiate the generational heap for non generational mode, so if there _is_ code trying to use the generational heap, its behavior will be undefined. It would crash at here with the assertion: [code](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp#L65). Provided some of the stacktrace below. It's mostly because we enabled card barrier flag and the code just fell through and assumes it's generational. Would it be more appropriate to change [this line](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp#L65) to be `ShenandoahHeap* heap = ShenandoahHeap::heap();`? Stack: [0x00007f1082bd2000,0x00007f1082cd2000], sp=0x00007f1082cce370, free space=1008k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) V [libjvm.so+0x13e0e90] NativeStackPrinter::print_stack(outputStream*, char*, int, unsigned char*&, bool , int)+0x70 (shenandoahGenerationalHeap.hpp:47) V [libjvm.so+0x18fd2e9] VMError::report(outputStream*, bool)+0x1bff (vmError.cpp:979) V [libjvm.so+0x1900d01] VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void const*, void const*, char const*, int, unsigned long)+0x8b1 (vmError.cpp:1887) V [libjvm.so+0xacf5ca] report_vm_status_error(char const*, int, char const*, int, char const*)+0x0 (deb ug.cpp:196) V [libjvm.so+0xacf33b] print_error_for_unit_test(char const*, char const*, __va_list_tag*)+0x0 (debug.c pp:149) V [libjvm.so+0x15bbec1] ShenandoahAsserts::assert_generational(char const*, int)+0x8b (shenandoahAssert s.cpp:532) V [libjvm.so+0x15be196] ShenandoahGenerationalHeap::heap()+0x19 (shenandoahGenerationalHeap.hpp:47) V [libjvm.so+0x16993bc] void card_mark_barrier(narrowOop*, oopDesc*)+0x73 (shenandoahReferenceProcessor.cpp:65) V [libjvm.so+0x169a2ac] bool ShenandoahReferenceProcessor::discover(oopDesc*, ReferenceType, unsigned int)+0x1da (shenandoahReferenceProcessor.cpp:409) V [libjvm.so+0x1698a5d] ShenandoahReferenceProcessor::discover_reference(oopDesc*, ReferenceType)+0xed (shenandoahReferenceProcessor.cpp:433) V [libjvm.so+0x1684aeb] bool InstanceRefKlass::try_discover >(oopDesc*, ReferenceType, ShenandoahMarkRefsClosure<(ShenandoahGenerationType)0>*)+0x77 (instanceRefKlass.inline.hpp:74) V [libjvm.so+0x1682bfc] void InstanceRefKlass::oop_oop_iterate_discovery, AlwaysContains>(oopDesc*, ReferenceType, ShenandoahMarkRefsClosure<(ShenandoahGenerationType)0>*, AlwaysContains&)+0x2c (instanceRefKlass.inline.hpp:84) V [libjvm.so+0x1680acc] void InstanceRefKlass::oop_oop_iterate_ref_processing, AlwaysContains>(oopDesc*, ShenandoahMarkRefsClosure<(ShenandoahGenerationType)0>*, AlwaysContains&)+0x80 (instanceRefKlass.inline.hpp:111) V [libjvm.so+0x167ec2e] void InstanceRefKlass::oop_oop_iterate_ref_processing >(oopDesc*, ShenandoahMarkRefsClosure<(ShenandoahGenerationType)0>*)+0x2c (instanceRefKlass.inline.hpp:134) V [libjvm.so+0x167ba88] void InstanceRefKlass::oop_oop_iterate >(oopDesc*, ShenandoahMarkRefsClosure<(ShenandoahGenerationType)0>*)+0x16c (instanceRefKlass.inline.hpp:154) > src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 255: > >> 253: // for the purpose of having card table. >> 254: if (ShenandoahCardBarrier && !(mode()->is_generational())) { >> 255: _generation_sizer.heap_size_changed(max_capacity()); > > I think we could simplify here by not using the `_generation_sizer`. It should be fine to pass `max_capacity()` instead of `max_capacity_old` here. Yeah that'd be simpler. Updating. Thanks. > src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp line 533: > >> 531: >> 532: ShenandoahOldGeneration* old_generation() const { >> 533: assert(mode()->is_generational(), "Old generation requires generational mode"); > > Can we assert that `ShenandoahCardBarrier` is on instead of removing this assertion? Sure ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27966#discussion_r2462100322 PR Review Comment: https://git.openjdk.org/jdk/pull/27966#discussion_r2462131735 PR Review Comment: https://git.openjdk.org/jdk/pull/27966#discussion_r2462100239 From duke at openjdk.org Tue Oct 28 17:33:38 2025 From: duke at openjdk.org (Rui Li) Date: Tue, 28 Oct 2025 17:33:38 GMT Subject: RFR: 8369013: Shenandoah: passive mode should support enabling ShenandoahCardBarrier Message-ID: Add card barriers to passive mode to test out the price of card barriers. How this change is implemented is to instantiate the old region in passive mode - old region owns the card table so this would minimize the code change with a bit price of native memory. It does sound weird to have old gen in passive mode, but since passive mode is a just diagnostic mode, we'll go with it for the cleanliness of the change. ------------- Commit messages: - Missed UnlockDiagnosticVMOptions - Corrected copyright header - Addressed comments and added a test - 8369013: Shenandoah: passive mode should support enabling ShenandoahCardBarrier Changes: https://git.openjdk.org/jdk/pull/27966/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27966&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8369013 Stats: 117 lines in 9 files changed: 104 ins; 7 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/27966.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27966/head:pull/27966 PR: https://git.openjdk.org/jdk/pull/27966 From kvn at openjdk.org Tue Oct 28 17:52:42 2025 From: kvn at openjdk.org (Vladimir Kozlov) Date: Tue, 28 Oct 2025 17:52:42 GMT Subject: RFR: 8351149: Remove dead IA32/X32/!AMD64 code blocks after 32-bit x86 removal [v2] In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 11:36:44 GMT, Anton Seoane Ampudia wrote: >> This PR carries out cleanup of `IA32`-, `X32`- and `!AMD64`-guarded code blocks after the removal of the 32-bit x86 architecture from HotSpot. >> >> These code blocks are either not needed anymore or the guards redundant. >> >> Please note that this changeset addresses the "complement" of [JDK-8351159](https://github.com/openjdk/jdk/pull/27987). This is to say, this PR targets all directories that are *not* `cpu/x86` and `os_cpu/x86`. >> >> **Testing:** passes tiers 1-3 > > Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: > > Apply review comments (restore mistakenly cleaned define) Good. src/hotspot/share/c1/c1_CodeStubs.hpp line 141: > 139: ConversionStub(Bytecodes::Code bytecode, LIR_Opr input, LIR_Opr result) > 140: : _bytecode(bytecode), _input(input), _result(result) { > 141: ShouldNotReachHere(); Should we remove this code then in separate RFE? ------------- Marked as reviewed by kvn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27990#pullrequestreview-3390086571 PR Review Comment: https://git.openjdk.org/jdk/pull/27990#discussion_r2470503030 From aseoane at openjdk.org Tue Oct 28 17:52:44 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Tue, 28 Oct 2025 17:52:44 GMT Subject: Integrated: 8351149: Remove dead IA32/X32/!AMD64 code blocks after 32-bit x86 removal In-Reply-To: References: Message-ID: On Sun, 26 Oct 2025 09:18:40 GMT, Anton Seoane Ampudia wrote: > This PR carries out cleanup of `IA32`-, `X32`- and `!AMD64`-guarded code blocks after the removal of the 32-bit x86 architecture from HotSpot. > > These code blocks are either not needed anymore or the guards redundant. > > Please note that this changeset addresses the "complement" of [JDK-8351159](https://github.com/openjdk/jdk/pull/27987). This is to say, this PR targets all directories that are *not* `cpu/x86` and `os_cpu/x86`. > > **Testing:** passes tiers 1-3 This pull request has now been integrated. Changeset: 86f60f60 Author: Anton Seoane Ampudia Committer: Vladimir Kozlov URL: https://git.openjdk.org/jdk/commit/86f60f608198c2fa5cbbe945d9396326b6944401 Stats: 201 lines in 22 files changed: 0 ins; 173 del; 28 mod 8351149: Remove dead IA32/X32/!AMD64 code blocks after 32-bit x86 removal Reviewed-by: stefank, ayang, kvn ------------- PR: https://git.openjdk.org/jdk/pull/27990 From wkemper at openjdk.org Tue Oct 28 20:54:05 2025 From: wkemper at openjdk.org (William Kemper) Date: Tue, 28 Oct 2025 20:54:05 GMT Subject: RFR: 8370726: GenShen: Misplaced assertion that old referent is marked during young collection Message-ID: <5L_CsIwXfAAGEIcPhVkxeBWa4CtaJ5SBDwQxQZTUg4o=.8a624a29-3c90-4b33-9467-415016a7c36d@github.com> Recently introduced assertion is too strong: # # A fatal error has been detected by the Java Runtime Environment: # # Internal Error (/codebuild/output/src2096/src/s3/00/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp:332), pid=1373, tid=1375 # Error: Marking should be complete for object 0x00000007ffc029b0 in the Old generation ------------- Commit messages: - Something in full gc still needs 'active' generation? - Give reference processor a generation field Changes: https://git.openjdk.org/jdk/pull/28026/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28026&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8370726 Stats: 27 lines in 3 files changed: 4 ins; 14 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/28026.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28026/head:pull/28026 PR: https://git.openjdk.org/jdk/pull/28026 From wkemper at openjdk.org Tue Oct 28 20:57:34 2025 From: wkemper at openjdk.org (William Kemper) Date: Tue, 28 Oct 2025 20:57:34 GMT Subject: RFR: 8370667: TestPinnedGarbage.java intermittent trigger assert Region \d+ pinning status is inconsistent Message-ID: This broke recently because we expanded the scope of the assertion to check all regions. However, there are times when the pin status for a region is only updated if the region belongs to the generation being collected. This change restores the previous behavior of the assertion. ------------- Commit messages: - Only verify region pins for collected generation Changes: https://git.openjdk.org/jdk/pull/28027/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28027&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8370667 Stats: 13 lines in 4 files changed: 7 ins; 0 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/28027.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28027/head:pull/28027 PR: https://git.openjdk.org/jdk/pull/28027 From wkemper at openjdk.org Tue Oct 28 21:35:04 2025 From: wkemper at openjdk.org (William Kemper) Date: Tue, 28 Oct 2025 21:35:04 GMT Subject: RFR: 8369013: Shenandoah: passive mode should support enabling ShenandoahCardBarrier In-Reply-To: References: Message-ID: <2lQ8u6wu_P-mNdo4R9VY9BaqGc24tL7H5eher3hgx28=.e7f574eb-94b3-4c6f-8f3a-e81757c59e1b@github.com> On Fri, 24 Oct 2025 00:18:03 GMT, Rui Li wrote: > Add card barriers to passive mode to test out the price of card barriers. > > How this change is implemented is to instantiate the old region in passive mode - old region owns the card table so this would minimize the code change with a bit price of native memory. It does sound weird to have old gen in passive mode, but since passive mode is a just diagnostic mode, we'll go with it for the cleanliness of the change. Looks good. I think we should clear the card table for each degenerated cycle. Thank you for adding the test! src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp line 1177: > 1175: > 1176: // passive mode with ShenandoahCardBarrier turned on, clean the write table without swapping the tables > 1177: if (ShenandoahCardBarrier && !heap->mode()->is_generational()) { In general, the passive mode will only initiate a _degenerated_ cycle. It will run a full GC only if the degenerated cycle cannot evacuate or it doesn't make "good progress". Could we move this behavior into `shDegeneratedGC` or somewhere in `shPassiveHeuristic`? Cleaning the card table on every GC would be more aligned with the concurrent mode behavior. ------------- PR Review: https://git.openjdk.org/jdk/pull/27966#pullrequestreview-3390877820 PR Review Comment: https://git.openjdk.org/jdk/pull/27966#discussion_r2471100098 From duke at openjdk.org Wed Oct 29 01:13:53 2025 From: duke at openjdk.org (Rui Li) Date: Wed, 29 Oct 2025 01:13:53 GMT Subject: RFR: 8369013: Shenandoah: passive mode should support enabling ShenandoahCardBarrier [v2] In-Reply-To: References: Message-ID: > Add card barriers to passive mode to test out the price of card barriers. > > How this change is implemented is to instantiate the old region in passive mode - old region owns the card table so this would minimize the code change with a bit price of native memory. It does sound weird to have old gen in passive mode, but since passive mode is a just diagnostic mode, we'll go with it for the cleanliness of the change. Rui Li has updated the pull request incrementally with one additional commit since the last revision: Move write table clean to degen ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27966/files - new: https://git.openjdk.org/jdk/pull/27966/files/ecde5211..e6fdbc60 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27966&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27966&range=00-01 Stats: 11 lines in 2 files changed: 6 ins; 5 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/27966.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27966/head:pull/27966 PR: https://git.openjdk.org/jdk/pull/27966 From aseoane at openjdk.org Wed Oct 29 13:11:21 2025 From: aseoane at openjdk.org (Anton Seoane Ampudia) Date: Wed, 29 Oct 2025 13:11:21 GMT Subject: RFR: 8351149: Remove dead IA32/X32/!AMD64 code blocks after 32-bit x86 removal [v2] In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 17:46:15 GMT, Vladimir Kozlov wrote: >> Anton Seoane Ampudia has updated the pull request incrementally with one additional commit since the last revision: >> >> Apply review comments (restore mistakenly cleaned define) > > src/hotspot/share/c1/c1_CodeStubs.hpp line 141: > >> 139: ConversionStub(Bytecodes::Code bytecode, LIR_Opr input, LIR_Opr result) >> 140: : _bytecode(bytecode), _input(input), _result(result) { >> 141: ShouldNotReachHere(); > > Should we remove this code then in separate RFE? Yes. I have filed [JDK-8370878](https://bugs.openjdk.org/browse/JDK-8370878) for it ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27990#discussion_r2472956106 From wkemper at openjdk.org Wed Oct 29 17:20:36 2025 From: wkemper at openjdk.org (William Kemper) Date: Wed, 29 Oct 2025 17:20:36 GMT Subject: RFR: 8369013: Shenandoah: passive mode should support enabling ShenandoahCardBarrier [v2] In-Reply-To: References: Message-ID: On Wed, 29 Oct 2025 01:13:53 GMT, Rui Li wrote: >> Add card barriers to passive mode to test out the price of card barriers. >> >> How this change is implemented is to instantiate the old region in passive mode - old region owns the card table so this would minimize the code change with a bit price of native memory. It does sound weird to have old gen in passive mode, but since passive mode is a just diagnostic mode, we'll go with it for the cleanliness of the change. > > Rui Li has updated the pull request incrementally with one additional commit since the last revision: > > Move write table clean to degen Looks good. Thank you! ------------- Marked as reviewed by wkemper (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27966#pullrequestreview-3394917347 From duke at openjdk.org Wed Oct 29 21:29:06 2025 From: duke at openjdk.org (duke) Date: Wed, 29 Oct 2025 21:29:06 GMT Subject: RFR: 8369013: Shenandoah: passive mode should support enabling ShenandoahCardBarrier [v2] In-Reply-To: References: Message-ID: <9HSBPAmwzo65uPWM6chbjDeFzY4g7UwBOsu2PgHKnGQ=.e6f5bcb4-bd42-4a01-bc9c-e82c27a9840f@github.com> On Wed, 29 Oct 2025 01:13:53 GMT, Rui Li wrote: >> Add card barriers to passive mode to test out the price of card barriers. >> >> How this change is implemented is to instantiate the old region in passive mode - old region owns the card table so this would minimize the code change with a bit price of native memory. It does sound weird to have old gen in passive mode, but since passive mode is a just diagnostic mode, we'll go with it for the cleanliness of the change. > > Rui Li has updated the pull request incrementally with one additional commit since the last revision: > > Move write table clean to degen @rgithubli Your change (at version e6fdbc604a2d71889c820ebe8bdb9540a6aa66aa) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27966#issuecomment-3464135922 From duke at openjdk.org Wed Oct 29 21:43:19 2025 From: duke at openjdk.org (Rui Li) Date: Wed, 29 Oct 2025 21:43:19 GMT Subject: Integrated: 8369013: Shenandoah: passive mode should support enabling ShenandoahCardBarrier In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 00:18:03 GMT, Rui Li wrote: > Add card barriers to passive mode to test out the price of card barriers. > > How this change is implemented is to instantiate the old region in passive mode - old region owns the card table so this would minimize the code change with a bit price of native memory. It does sound weird to have old gen in passive mode, but since passive mode is a just diagnostic mode, we'll go with it for the cleanliness of the change. This pull request has now been integrated. Changeset: f3dfdfa3 Author: Rui Li Committer: Xiaolong Peng URL: https://git.openjdk.org/jdk/commit/f3dfdfa3fdc97c2c850251d58f91134e0ae82240 Stats: 118 lines in 9 files changed: 105 ins; 7 del; 6 mod 8369013: Shenandoah: passive mode should support enabling ShenandoahCardBarrier Reviewed-by: wkemper ------------- PR: https://git.openjdk.org/jdk/pull/27966 From jrose at openjdk.org Wed Oct 29 23:28:06 2025 From: jrose at openjdk.org (John R Rose) Date: Wed, 29 Oct 2025 23:28:06 GMT Subject: RFR: 8369186: HotSpot Style Guide should permit some uses of the C++ Standard Library [v4] In-Reply-To: References: Message-ID: On Sat, 18 Oct 2025 17:11:48 GMT, Kim Barrett wrote: >> Please review this change to the HotSpot Style Guide to suggest that C++ >> Standard Library components may be used, after appropriate vetting and >> discussion, rather than just a blanket "no, don't use it" with a few very >> narrow exceptions. It provides some guidance on that vetting process and >> the criteria to use, along with usage patterns. >> >> In particular, it proposes that Standard Library headers should not be >> included directly, but instead through HotSpot-provided wrapper headers. This >> gives us a place to document usage, provide workarounds for platform issues in >> a single place, and so on. >> >> Such wrapper headers are provided by this PR for ``, ``, and >> ``, along with updates to use them. I have a separate change for >> `` that I plan to propose later, under JDK-8369187. There will be >> additional followups for other C compatibility headers besides ``. >> >> This PR also cleans up some nomenclature issues around forbid vs exclude and >> the like. >> >> Testing: mach5 tier1-5, GHA sanity tests > > Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains nine commits: > > - Merge branch 'master' into stdlib-header-wrappers > - Merge branch 'master' into stdlib-header-wrappers > - Merge branch 'master' into stdlib-header-wrappers > - jrose comments > - move tuple to undecided category > - add wrapper for > - add wrapper for > - add wrapper for > - style guide permits some standard library facilities Thanks Kim for this work, and specifically for your responses to my comments. Looks like everybody has had a chance to weigh in. Let's do this. ------------- Marked as reviewed by jrose (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/27601#pullrequestreview-3396839241 From xpeng at openjdk.org Wed Oct 29 23:29:37 2025 From: xpeng at openjdk.org (Xiaolong Peng) Date: Wed, 29 Oct 2025 23:29:37 GMT Subject: RFR: 8370850: Shenandoah: Simplify collector allocation to save unnecessary region iteration Message-ID: To allocate an object in Collector/OldCollector partition, current implementation may traverse the regions in the partition twice: 1. fast path: traverse regions between left most and right most in the partition, and try to allocate in an affiliated region in the partition; 2. if fails in fast path, traverse regions between left most empty and right most empty in the partition, and try try to allocate in a FREE region. #2 can be saved if we also remember the first FREE region seem in #1. The PR makes the code much cleaner, and and more efficient(although the performance impact may not be measurable, I have run some dacapo benchmarks and didn't see meaningful difference) Test: - [x] hotspot_gc_shenandoah ------------- Commit messages: - Merge branch 'openjdk:master' into collector-allocation - Touch up - Remove test 'req.is_old()' when steal an empty region from the mutator view - Update comment - Fix wrong condition when steal an empty region from the mutator view - Fix potential failure in young evac - fix and touch up - Fix wrong condition to find first empty region - Simplify ShenandoahFreeSet::allocate_for_collector for better allocation performance Changes: https://git.openjdk.org/jdk/pull/28036/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28036&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8370850 Stats: 72 lines in 2 files changed: 16 ins; 46 del; 10 mod Patch: https://git.openjdk.org/jdk/pull/28036.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28036/head:pull/28036 PR: https://git.openjdk.org/jdk/pull/28036 From xpeng at openjdk.org Thu Oct 30 15:47:41 2025 From: xpeng at openjdk.org (Xiaolong Peng) Date: Thu, 30 Oct 2025 15:47:41 GMT Subject: RFR: 8370726: GenShen: Misplaced assertion that old referent is marked during young collection In-Reply-To: <5L_CsIwXfAAGEIcPhVkxeBWa4CtaJ5SBDwQxQZTUg4o=.8a624a29-3c90-4b33-9467-415016a7c36d@github.com> References: <5L_CsIwXfAAGEIcPhVkxeBWa4CtaJ5SBDwQxQZTUg4o=.8a624a29-3c90-4b33-9467-415016a7c36d@github.com> Message-ID: On Tue, 28 Oct 2025 20:48:25 GMT, William Kemper wrote: > Recently introduced assertion is too strong: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # Internal Error (/codebuild/output/src2096/src/s3/00/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp:332), pid=1373, tid=1375 > # Error: Marking should be complete for object 0x00000007ffc029b0 in the Old generation Looks good, thanks! Many of our performance test pipelines failed due to this assert. ------------- Marked as reviewed by xpeng (Committer). PR Review: https://git.openjdk.org/jdk/pull/28026#pullrequestreview-3400332333 From kdnilsen at openjdk.org Thu Oct 30 18:20:51 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Thu, 30 Oct 2025 18:20:51 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v34] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 156 commits: - Merge remote-tracking branch 'jdk/master' into freeset-has-authoritative-tallies - reviewer feedback - Merge remote-tracking branch 'jdk/master' into freeset-has-authoritative-tallies - Rework implementation of CompressedClassSpaceSizeInJmapHeap.java - fix errors in CompressedClassSpaceSizeInJmapHeap.java - Add debug instrumentation to CompressedClassSpaceSizeInJmapHeap.java - Add sleep to CompressedClassSpaceSizeInJmapHeap.java test - Fix up vmstructs and other infrastructure for jmap heap dump - After initialization, check for SoftMaxHeapSize changed by constraints enforcement - clamp SoftMaxHeapSize during initialization - ... and 146 more: https://git.openjdk.org/jdk/compare/d18e815b...657529e3 ------------- Changes: https://git.openjdk.org/jdk/pull/26867/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=33 Stats: 3531 lines in 44 files changed: 2118 ins; 1009 del; 404 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From xpeng at openjdk.org Thu Oct 30 18:32:58 2025 From: xpeng at openjdk.org (Xiaolong Peng) Date: Thu, 30 Oct 2025 18:32:58 GMT Subject: RFR: 8370667: GenShen: Only make assertions about region pinning for collected generation In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 20:52:01 GMT, William Kemper wrote: > This broke recently because we expanded the scope of the assertion to check all regions. However, there are times when the pin status for a region is only updated if the region belongs to the generation being collected. This change restores the previous behavior of the assertion. Marked as reviewed by xpeng (Committer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28027#pullrequestreview-3401073785 From ysr at openjdk.org Thu Oct 30 20:36:35 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Thu, 30 Oct 2025 20:36:35 GMT Subject: RFR: 8370726: GenShen: Misplaced assertion that old referent is marked during young collection In-Reply-To: <5L_CsIwXfAAGEIcPhVkxeBWa4CtaJ5SBDwQxQZTUg4o=.8a624a29-3c90-4b33-9467-415016a7c36d@github.com> References: <5L_CsIwXfAAGEIcPhVkxeBWa4CtaJ5SBDwQxQZTUg4o=.8a624a29-3c90-4b33-9467-415016a7c36d@github.com> Message-ID: On Tue, 28 Oct 2025 20:48:25 GMT, William Kemper wrote: > Recently introduced assertion is too strong: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # Internal Error (/codebuild/output/src2096/src/s3/00/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp:332), pid=1373, tid=1375 > # Error: Marking should be complete for object 0x00000007ffc029b0 in the Old generation ? ------------- Marked as reviewed by ysr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/28026#pullrequestreview-3401532511 From wkemper at openjdk.org Thu Oct 30 20:43:35 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 30 Oct 2025 20:43:35 GMT Subject: Integrated: 8370726: GenShen: Misplaced assertion that old referent is marked during young collection In-Reply-To: <5L_CsIwXfAAGEIcPhVkxeBWa4CtaJ5SBDwQxQZTUg4o=.8a624a29-3c90-4b33-9467-415016a7c36d@github.com> References: <5L_CsIwXfAAGEIcPhVkxeBWa4CtaJ5SBDwQxQZTUg4o=.8a624a29-3c90-4b33-9467-415016a7c36d@github.com> Message-ID: On Tue, 28 Oct 2025 20:48:25 GMT, William Kemper wrote: > Recently introduced assertion is too strong: > > # > # A fatal error has been detected by the Java Runtime Environment: > # > # Internal Error (/codebuild/output/src2096/src/s3/00/src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp:332), pid=1373, tid=1375 > # Error: Marking should be complete for object 0x00000007ffc029b0 in the Old generation This pull request has now been integrated. Changeset: c69e0eb2 Author: William Kemper URL: https://git.openjdk.org/jdk/commit/c69e0eb2f98dc80eaefdb399dcfe86cdab32dbd5 Stats: 27 lines in 3 files changed: 4 ins; 14 del; 9 mod 8370726: GenShen: Misplaced assertion that old referent is marked during young collection Reviewed-by: xpeng, ysr ------------- PR: https://git.openjdk.org/jdk/pull/28026 From ysr at openjdk.org Thu Oct 30 20:53:11 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Thu, 30 Oct 2025 20:53:11 GMT Subject: RFR: 8370667: GenShen: Only make assertions about region pinning for collected generation In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 20:52:01 GMT, William Kemper wrote: > This broke recently because we expanded the scope of the assertion to check all regions. However, there are times when the pin status for a region is only updated if the region belongs to the generation being collected. This change restores the previous behavior of the assertion. Marked as reviewed by ysr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/28027#pullrequestreview-3401594703 From wkemper at openjdk.org Thu Oct 30 21:12:38 2025 From: wkemper at openjdk.org (William Kemper) Date: Thu, 30 Oct 2025 21:12:38 GMT Subject: Integrated: 8370667: GenShen: Only make assertions about region pinning for collected generation In-Reply-To: References: Message-ID: On Tue, 28 Oct 2025 20:52:01 GMT, William Kemper wrote: > This broke recently because we expanded the scope of the assertion to check all regions. However, there are times when the pin status for a region is only updated if the region belongs to the generation being collected. This change restores the previous behavior of the assertion. This pull request has now been integrated. Changeset: c6eea8ac Author: William Kemper URL: https://git.openjdk.org/jdk/commit/c6eea8acf6eea7314a1615e5923ac7bf73e6da02 Stats: 13 lines in 4 files changed: 7 ins; 0 del; 6 mod 8370667: GenShen: Only make assertions about region pinning for collected generation Reviewed-by: xpeng, ysr ------------- PR: https://git.openjdk.org/jdk/pull/28027 From ysr at openjdk.org Thu Oct 30 23:56:03 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Thu, 30 Oct 2025 23:56:03 GMT Subject: RFR: 8370521: GenShen: Various code cleanup related to promotion In-Reply-To: References: Message-ID: On Thu, 23 Oct 2025 22:50:04 GMT, William Kemper wrote: > * Use more log tags for finer grained control over debug output. > * Add instrumentation for plab and cset decisions > * Fix typos in comments and minor formatting issues > * Rename some methods and variables for easier reading > > There are no behavioral changes here. These changes were hoisted from https://github.com/openjdk/jdk/pull/27632 to facilitate its review. Marked as reviewed by ysr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/27963#pullrequestreview-3402108722 From wkemper at openjdk.org Fri Oct 31 00:02:49 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 31 Oct 2025 00:02:49 GMT Subject: RFR: 8370041: GenShen: Filter young pointers from thread local SATB buffers when only marking old [v2] In-Reply-To: References: Message-ID: > When GenShen is only marking the old generation, we do not need the SATB mechanism to preserve young pointers. We currently filter these out of the SATB buffers during the final-update-refs and init-mark safepoints. This increases latency and introduces no small amount of complexity. It should be possible to instead filter out these pointers when the SATB buffers are 'compacted' before being 'completed'. > > # Background > When GenShen is marking the old generation it leaves the SATB barrier enabled. When a young collection interrupts old marking, it creates a situation where a mutator thread could overwrite a field holding a pointer into a collection set region. The SATB barrier will dutifully place this object in the SATB queue. If this pointer makes it into a mark queue, the marking thread will crash. Prior to this change, GenShen filtered out such pointers _after_ the thread local SATB buffers were completed. After this change, such pointers are filtered out _before_ the buffers are completed. This is more inline with the natural way of things. William Kemper 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 20 additional commits since the last revision: - Merge remote-tracking branch 'jdk/master' into piggyback-satb-flush-on-update-roots - Flush SATB buffers upon entering degenerated cycle when old marking is in progress This has to happen at least once during the degenerated cycle. Doing it at the start, rather than the end, simplifies the verifier. - Fix typo in comment - Remove duplicate satb flush closure - Only flush satb once during degenerated cycle - Cleanup and comments - Merge remote-tracking branch 'jdk/master' into piggyback-satb-flush-on-update-roots - Fix assertion - Oops, move inline definition out of ifdef ASSERT - Try piggybacking satb flush on update roots - ... and 10 more: https://git.openjdk.org/jdk/compare/3bb543d1...01f0f976 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/27983/files - new: https://git.openjdk.org/jdk/pull/27983/files/ec58b72f..01f0f976 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=27983&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27983&range=00-01 Stats: 43161 lines in 471 files changed: 21775 ins; 18947 del; 2439 mod Patch: https://git.openjdk.org/jdk/pull/27983.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27983/head:pull/27983 PR: https://git.openjdk.org/jdk/pull/27983 From wkemper at openjdk.org Fri Oct 31 00:02:50 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 31 Oct 2025 00:02:50 GMT Subject: RFR: 8370041: GenShen: Filter young pointers from thread local SATB buffers when only marking old In-Reply-To: References: Message-ID: On Fri, 24 Oct 2025 21:00:40 GMT, William Kemper wrote: > When GenShen is only marking the old generation, we do not need the SATB mechanism to preserve young pointers. We currently filter these out of the SATB buffers during the final-update-refs and init-mark safepoints. This increases latency and introduces no small amount of complexity. It should be possible to instead filter out these pointers when the SATB buffers are 'compacted' before being 'completed'. > > # Background > When GenShen is marking the old generation it leaves the SATB barrier enabled. When a young collection interrupts old marking, it creates a situation where a mutator thread could overwrite a field holding a pointer into a collection set region. The SATB barrier will dutifully place this object in the SATB queue. If this pointer makes it into a mark queue, the marking thread will crash. Prior to this change, GenShen filtered out such pointers _after_ the thread local SATB buffers were completed. After this change, such pointers are filtered out _before_ the buffers are completed. This is more inline with the natural way of things. I found an issue with the verifier that needs to be fixed before this PR is integrated. ------------- PR Comment: https://git.openjdk.org/jdk/pull/27983#issuecomment-3457297107 From wkemper at openjdk.org Fri Oct 31 00:11:11 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 31 Oct 2025 00:11:11 GMT Subject: Integrated: 8370521: GenShen: Various code cleanup related to promotion In-Reply-To: References: Message-ID: On Thu, 23 Oct 2025 22:50:04 GMT, William Kemper wrote: > * Use more log tags for finer grained control over debug output. > * Add instrumentation for plab and cset decisions > * Fix typos in comments and minor formatting issues > * Rename some methods and variables for easier reading > > There are no behavioral changes here. These changes were hoisted from https://github.com/openjdk/jdk/pull/27632 to facilitate its review. This pull request has now been integrated. Changeset: 6347f10b Author: William Kemper URL: https://git.openjdk.org/jdk/commit/6347f10bf1dd3959cc1f2aba32e72ca8d9d56e82 Stats: 75 lines in 12 files changed: 18 ins; 10 del; 47 mod 8370521: GenShen: Various code cleanup related to promotion Reviewed-by: fandreuzzi, kdnilsen, ysr ------------- PR: https://git.openjdk.org/jdk/pull/27963 From wkemper at openjdk.org Fri Oct 31 00:21:27 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 31 Oct 2025 00:21:27 GMT Subject: RFR: 8314599: [GenShen] Couple adaptive tenuring and generation size budgeting [v7] In-Reply-To: References: Message-ID: > Notable changes: > * Improvements to logging > * More accurate tracking of promotion failures > * Use shared allocation for promotions only when the size is above the maximum plab size (not the minimum size) > * Use census information gathered during mark to size promotion reserves and old generation > > With these changes, GenShen is expected to have fewer promotion failures and this is indeed the case. As a result of this, we expect less time to be spent in concurrent marking and update refs for young collections. We may also expect shorter concurrent evacuation phases because GenShen will have fewer densely packed regions stuck in the young generation. With more objects being promoted, we also expect to see longer remembered set scan times. This is generally the case across all benchmarks, but we do also see some counter-intuitive results. > > Here we are comparing 20 executions (10 on x86, 10 on aarch64) of the changes in the PR (experiment) against 20 executions of the same benchmarks results from tip. This is a summary of statistically significant changes of more than 5% across all benchmarks: > > > Concurrent Evacuation: 7 improvements, 3 regressions > ? Best improvements: extremem-large-45g (-29.6%), neo4j-analytics (-26.9%) > ? Worst regression: xalan (+53.7%) > > Concurrent Marking: 15 improvements, 1 regression > ? Best improvements: hyperalloc_a2048_o4096 (-30.1%), crypto.rsa (-27.3%) > ? Only regression: serial (+8.9%) > > Concurrent Scan Remembered Set: 7 improvements, 2 regressions > ? Best improvements: xalan (-49.4%), pmd (-49.0%), crypto.rsa (-41.8%) > ? Worst regression: extremem-phased (+52.4%) > > Concurrent Update Refs: 5 improvements, 4 regressions > ? Best improvements: crypto.rsa (-36.4%), mnemonics (-28.4%) > ? Worst regression: xalan (+89.4%) William Kemper has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 60 commits: - Merge remote-tracking branch 'jdk/master' into promotion-budget-improvements - Merge remote-tracking branch 'jdk/master' into promotion-budget-improvements - Merge tag 'jdk-26+20' into promotion-budget-improvements Added tag jdk-26+20 for changeset b5b83247 - Proper format bytes in logs for better readability - Merge remote-tracking branch 'jdk/master' into promotion-budget-improvements - Review feedback, bug fixes - Fix windows build more - Fix windows build - Little cleanup - Fix wrong asserts - ... and 50 more: https://git.openjdk.org/jdk/compare/6347f10b...1d81159a ------------- Changes: https://git.openjdk.org/jdk/pull/27632/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27632&range=06 Stats: 245 lines in 5 files changed: 139 ins; 79 del; 27 mod Patch: https://git.openjdk.org/jdk/pull/27632.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/27632/head:pull/27632 PR: https://git.openjdk.org/jdk/pull/27632 From kdnilsen at openjdk.org Fri Oct 31 01:09:32 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 31 Oct 2025 01:09:32 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v35] In-Reply-To: References: Message-ID: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. Kelvin Nilsen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 157 commits: - Merge remote-tracking branch 'jdk/master' into freeset-has-authoritative-tallies - Merge remote-tracking branch 'jdk/master' into freeset-has-authoritative-tallies - reviewer feedback - Merge remote-tracking branch 'jdk/master' into freeset-has-authoritative-tallies - Rework implementation of CompressedClassSpaceSizeInJmapHeap.java - fix errors in CompressedClassSpaceSizeInJmapHeap.java - Add debug instrumentation to CompressedClassSpaceSizeInJmapHeap.java - Add sleep to CompressedClassSpaceSizeInJmapHeap.java test - Fix up vmstructs and other infrastructure for jmap heap dump - After initialization, check for SoftMaxHeapSize changed by constraints enforcement - ... and 147 more: https://git.openjdk.org/jdk/compare/6347f10b...53af6b19 ------------- Changes: https://git.openjdk.org/jdk/pull/26867/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26867&range=34 Stats: 3516 lines in 43 files changed: 2110 ins; 1006 del; 400 mod Patch: https://git.openjdk.org/jdk/pull/26867.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26867/head:pull/26867 PR: https://git.openjdk.org/jdk/pull/26867 From wkemper at openjdk.org Fri Oct 31 01:15:09 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 31 Oct 2025 01:15:09 GMT Subject: RFR: 8370850: Shenandoah: Simplify collector allocation to save unnecessary region iteration In-Reply-To: References: Message-ID: <7KjxoZ7UQ9LugnCVgBT6moBrQEfxmPNBXrvyWXD-MQ8=.37907346-c252-4daf-b7bb-9d0f89291753@github.com> On Wed, 29 Oct 2025 05:29:14 GMT, Xiaolong Peng wrote: > To allocate an object in Collector/OldCollector partition, current implementation may traverse the regions in the partition twice: > 1. fast path: traverse regions between left most and right most in the partition, and try to allocate in an affiliated region in the partition; > 2. if fails in fast path, traverse regions between left most empty and right most empty in the partition, and try try to allocate in a FREE region. > > 2 can be saved if we also remember the first FREE region seem in 1. > > The PR makes the code much cleaner, and more efficient(although the performance impact may not be measurable, I have run some dacapo benchmarks and didn't see meaningful difference) > > > Test: > - [x] hotspot_gc_shenandoah src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 779: > 777: return result; > 778: } > 779: } else if (free_region == nullptr && r->affiliation() == FREE && The logic in `can_allocate_from` is slightly different from what's here. Do we want to check that the region is `FREE` _or_ it is `trash` and we are not in concurrent weak roots? src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 901: > 899: } > 900: > 901: bool allow_new_region = can_allocate_in_new_region(req); Are we losing the check here? Before this change, the region had to be `FREE` _and_ the generation affiliated with the request had to have `free_unaffiliated_regions`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28036#discussion_r2479902404 PR Review Comment: https://git.openjdk.org/jdk/pull/28036#discussion_r2479900571 From ysr at openjdk.org Fri Oct 31 05:09:04 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Fri, 31 Oct 2025 05:09:04 GMT Subject: RFR: 8369048: GenShen: Defer ShenFreeSet::available() during rebuild In-Reply-To: <_PEoOc0oWb8Vzq16-Or_hykkL4NkIrwEFgLCgCRac5U=.2c23c497-acbe-48f9-a1dc-4eb4e8f25a8d@github.com> References: <_PEoOc0oWb8Vzq16-Or_hykkL4NkIrwEFgLCgCRac5U=.2c23c497-acbe-48f9-a1dc-4eb4e8f25a8d@github.com> Message-ID: On Thu, 2 Oct 2025 17:58:48 GMT, Kelvin Nilsen wrote: > This code introduces a new rebuild-freeset lock for purposes of coordinating the freeset rebuild activities and queries as to memory available for allocation in the mutator partition. > > This addresses a problem that results if available memory is probed while we are rebuilding the freeset. > > Rather than using the existing global heap lock to synchronize these activities, a new more narrowly scoped lock is introduced. This allows the available memory to be probed even when other activities hold the global heap lock for reasons other than rebuilding the freeset, such as when they are allocating memory. It is known that the global heap lock is heavily contended for certain workloads, and using this new lock avoids adding to contention for the global heap lock. Left a few comments. (In particular of what looks like a deadlock possibility in debug builds.) src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp line 240: > 238: // Return available_in assuming caller does not hold the heap lock. In production builds, available is > 239: // returned without acquiring the lock. In debug builds, the global heap lock is acquired in order to > 240: // enforce a consistency assert. Can the comment be simplified to: // Return bytes `available` in the given `partition` // while holding the `rebuild_lock`. Don't say anything about the heap lock in the API comment. Rather, in the part that is `ifdef ASSERT` where you take the heap lock (line ~244), say: // Acquire the heap lock to get a consistent // snapshot to check assert. src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp line 323: > 321: ShenandoahRegionPartitions _partitions; > 322: > 323: // This locks the rebuild process (in combination with the global heap lock) Explain the role of this & the global heap lock vis-a-vis the rebuild process. Also may be call it `_rebuild_lock`, rather than just `_lock`. src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp line 426: > 424: > 425: > 426: ShenandoahRebuildLock* lock() { `rebuild_lock()` instead? src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp line 1158: > 1156: size_t young_cset_regions, old_cset_regions, first_old, last_old, num_old; > 1157: ShenandoahFreeSet* free_set = heap->free_set(); > 1158: ShenandoahRebuildLocker rebuild_locker(free_set->lock()); Should you not create a scope around lines 1158 to line 1167, since you don't want to hold the rebuild lock as soon as the rebuild is done (i.e. immediately following `finish_rebuild()`)? ------------- PR Review: https://git.openjdk.org/jdk/pull/27612#pullrequestreview-3402148589 PR Review Comment: https://git.openjdk.org/jdk/pull/27612#discussion_r2479874892 PR Review Comment: https://git.openjdk.org/jdk/pull/27612#discussion_r2479853761 PR Review Comment: https://git.openjdk.org/jdk/pull/27612#discussion_r2479854317 PR Review Comment: https://git.openjdk.org/jdk/pull/27612#discussion_r2479861263 From ysr at openjdk.org Fri Oct 31 05:09:05 2025 From: ysr at openjdk.org (Y. Srinivas Ramakrishna) Date: Fri, 31 Oct 2025 05:09:05 GMT Subject: RFR: 8369048: GenShen: Defer ShenFreeSet::available() during rebuild In-Reply-To: References: <_PEoOc0oWb8Vzq16-Or_hykkL4NkIrwEFgLCgCRac5U=.2c23c497-acbe-48f9-a1dc-4eb4e8f25a8d@github.com> Message-ID: On Fri, 31 Oct 2025 00:44:11 GMT, Y. Srinivas Ramakrishna wrote: >> This code introduces a new rebuild-freeset lock for purposes of coordinating the freeset rebuild activities and queries as to memory available for allocation in the mutator partition. >> >> This addresses a problem that results if available memory is probed while we are rebuilding the freeset. >> >> Rather than using the existing global heap lock to synchronize these activities, a new more narrowly scoped lock is introduced. This allows the available memory to be probed even when other activities hold the global heap lock for reasons other than rebuilding the freeset, such as when they are allocating memory. It is known that the global heap lock is heavily contended for certain workloads, and using this new lock avoids adding to contention for the global heap lock. > > src/hotspot/share/gc/shenandoah/shenandoahFreeSet.hpp line 240: > >> 238: // Return available_in assuming caller does not hold the heap lock. In production builds, available is >> 239: // returned without acquiring the lock. In debug builds, the global heap lock is acquired in order to >> 240: // enforce a consistency assert. > > Can the comment be simplified to: > > > // Return bytes `available` in the given `partition` > // while holding the `rebuild_lock`. > > > Don't say anything about the heap lock in the API comment. Rather, in the part that is `ifdef ASSERT` where you take the heap lock (line ~244), say: > > // Acquire the heap lock to get a consistent > // snapshot to check assert. As I write this, I realize that in the most general case where two threads may call these API's independently in a fastdebug build, you could theoretically get into a deadlock because they attempted to acquire locks in different orders (this possibility exists -- statically -- only in the fastdebug builds). The general MuteLocker machinery has ranked mutexes to avoid such situations through static ranking and checks while acquiring locks (in debug builds as a way of potentially catching such situations and flagging them). With such ranking though this code would assert because the locks are acquired in different order between here and elsewhere. In product builds you are fine because the rebuild lock acts as a "leaf lock" (in hotspot parlance). But there seems to be a definite possibility of deadlock in debug builds if/when the rebuild is attempted by one thread while another checks available and attempts to acquire the heap lock to check the assertion. You could solve it by acquiring the heap lock before calling the work method where the assertion check is done. However, I'd be much more comfortable if we used some form of lock rank framework, unless it was utterly impossible to do so for some reason. (Here it was easy to spot the lock order inversion because it was in the code. Of course, if a debug build deadlocked you would also figure out the same, but having lock ordering gives you a quick and easy way to verify if there's potential for trouble.) Not sure of the history of ShenandoahLock or why the parallel infra to MutexLocker was introduced (perhaps for allowing some performance/tunability), but might be worthwhile to see if we want to build lock rank checks in for robustness/maintainability. > src/hotspot/share/gc/shenandoah/shenandoahFullGC.cpp line 1158: > >> 1156: size_t young_cset_regions, old_cset_regions, first_old, last_old, num_old; >> 1157: ShenandoahFreeSet* free_set = heap->free_set(); >> 1158: ShenandoahRebuildLocker rebuild_locker(free_set->lock()); > > Should you not create a scope around lines 1158 to line 1167, since you don't want to hold the rebuild lock as soon as the rebuild is done (i.e. immediately following `finish_rebuild()`)? May be it doesn't matter, since no one else is running during a full gc who needs to query `available()`? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/27612#discussion_r2479898169 PR Review Comment: https://git.openjdk.org/jdk/pull/27612#discussion_r2479867780 From xpeng at openjdk.org Fri Oct 31 15:31:23 2025 From: xpeng at openjdk.org (Xiaolong Peng) Date: Fri, 31 Oct 2025 15:31:23 GMT Subject: RFR: 8370850: Shenandoah: Simplify collector allocation to save unnecessary region iteration In-Reply-To: <7KjxoZ7UQ9LugnCVgBT6moBrQEfxmPNBXrvyWXD-MQ8=.37907346-c252-4daf-b7bb-9d0f89291753@github.com> References: <7KjxoZ7UQ9LugnCVgBT6moBrQEfxmPNBXrvyWXD-MQ8=.37907346-c252-4daf-b7bb-9d0f89291753@github.com> Message-ID: On Fri, 31 Oct 2025 01:10:23 GMT, William Kemper wrote: >> To allocate an object in Collector/OldCollector partition, current implementation may traverse the regions in the partition twice: >> 1. fast path: traverse regions between left most and right most in the partition, and try to allocate in an affiliated region in the partition; >> 2. if fails in fast path, traverse regions between left most empty and right most empty in the partition, and try try to allocate in a FREE region. >> >> 2 can be saved if we also remember the first FREE region seem in 1. >> >> The PR makes the code much cleaner, and more efficient(although the performance impact may not be measurable, I have run some dacapo benchmarks and didn't see meaningful difference) >> >> >> Test: >> - [x] hotspot_gc_shenandoah > > src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 901: > >> 899: } >> 900: >> 901: bool allow_new_region = can_allocate_in_new_region(req); > > Are we losing the check here? Before this change, the region had to be `FREE` _and_ the generation affiliated with the request had to have `free_unaffiliated_regions`. I was confused about this part, if we can find a FREE region in the partition, why we still need to test if the generation must have free_unaffiliated_regions, I can add can_allocate_in_new_region back to retain the original behavior. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28036#discussion_r2481808233 From xpeng at openjdk.org Fri Oct 31 15:36:54 2025 From: xpeng at openjdk.org (Xiaolong Peng) Date: Fri, 31 Oct 2025 15:36:54 GMT Subject: RFR: 8370850: Shenandoah: Simplify collector allocation to save unnecessary region iteration In-Reply-To: <7KjxoZ7UQ9LugnCVgBT6moBrQEfxmPNBXrvyWXD-MQ8=.37907346-c252-4daf-b7bb-9d0f89291753@github.com> References: <7KjxoZ7UQ9LugnCVgBT6moBrQEfxmPNBXrvyWXD-MQ8=.37907346-c252-4daf-b7bb-9d0f89291753@github.com> Message-ID: On Fri, 31 Oct 2025 01:12:19 GMT, William Kemper wrote: >> To allocate an object in Collector/OldCollector partition, current implementation may traverse the regions in the partition twice: >> 1. fast path: traverse regions between left most and right most in the partition, and try to allocate in an affiliated region in the partition; >> 2. if fails in fast path, traverse regions between left most empty and right most empty in the partition, and try try to allocate in a FREE region. >> >> 2 can be saved if we also remember the first FREE region seem in 1. >> >> The PR makes the code much cleaner, and more efficient(although the performance impact may not be measurable, I have run some dacapo benchmarks and didn't see meaningful difference) >> >> >> Test: >> - [x] hotspot_gc_shenandoah > > src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 779: > >> 777: return result; >> 778: } >> 779: } else if (free_region == nullptr && r->affiliation() == FREE && > > The logic in `can_allocate_from` is slightly different from what's here. Do we want to check that the region is `FREE` _or_ it is `trash` and we are not in concurrent weak roots? `try_allocate_in(free_region, req, in_new_region)` returns nullptr if the region is trash and we are in in concurrent weak roots, I added the additional check to ensure try_allocate_in always succeed. The check may not be needed, I remember a FREE region can't be trash, I updated the trash/recycle related code in a while ago, I will double check. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28036#discussion_r2481827416 From wkemper at openjdk.org Fri Oct 31 20:38:13 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 31 Oct 2025 20:38:13 GMT Subject: RFR: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet [v35] In-Reply-To: References: Message-ID: On Fri, 31 Oct 2025 01:09:32 GMT, Kelvin Nilsen wrote: >> This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. >> Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. >> >> This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. >> >> The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. > > Kelvin Nilsen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 157 commits: > > - Merge remote-tracking branch 'jdk/master' into freeset-has-authoritative-tallies > - Merge remote-tracking branch 'jdk/master' into freeset-has-authoritative-tallies > - reviewer feedback > - Merge remote-tracking branch 'jdk/master' into freeset-has-authoritative-tallies > - Rework implementation of CompressedClassSpaceSizeInJmapHeap.java > - fix errors in CompressedClassSpaceSizeInJmapHeap.java > - Add debug instrumentation to CompressedClassSpaceSizeInJmapHeap.java > - Add sleep to CompressedClassSpaceSizeInJmapHeap.java test > - Fix up vmstructs and other infrastructure for jmap heap dump > - After initialization, check for SoftMaxHeapSize changed by constraints enforcement > - ... and 147 more: https://git.openjdk.org/jdk/compare/6347f10b...53af6b19 Marked as reviewed by wkemper (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/26867#pullrequestreview-3406038405 From xpeng at openjdk.org Fri Oct 31 20:45:37 2025 From: xpeng at openjdk.org (Xiaolong Peng) Date: Fri, 31 Oct 2025 20:45:37 GMT Subject: RFR: 8370850: Shenandoah: Simplify collector allocation to save unnecessary region iteration [v2] In-Reply-To: References: Message-ID: > To allocate an object in Collector/OldCollector partition, current implementation may traverse the regions in the partition twice: > 1. fast path: traverse regions between left most and right most in the partition, and try to allocate in an affiliated region in the partition; > 2. if fails in fast path, traverse regions between left most empty and right most empty in the partition, and try try to allocate in a FREE region. > > 2 can be saved if we also remember the first FREE region seem in 1. > > The PR makes the code much cleaner, and more efficient(although the performance impact may not be measurable, I have run some dacapo benchmarks and didn't see meaningful difference) > > > Test: > - [x] hotspot_gc_shenandoah Xiaolong Peng has updated the pull request incrementally with two additional commits since the last revision: - Remove condition check for trash region - Address the PR review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/28036/files - new: https://git.openjdk.org/jdk/pull/28036/files/81cd8ab0..2c73b9f7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=28036&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28036&range=00-01 Stats: 31 lines in 2 files changed: 22 ins; 2 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/28036.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28036/head:pull/28036 PR: https://git.openjdk.org/jdk/pull/28036 From wkemper at openjdk.org Fri Oct 31 20:57:05 2025 From: wkemper at openjdk.org (William Kemper) Date: Fri, 31 Oct 2025 20:57:05 GMT Subject: RFR: 8370850: Shenandoah: Simplify collector allocation to save unnecessary region iteration [v2] In-Reply-To: References: <7KjxoZ7UQ9LugnCVgBT6moBrQEfxmPNBXrvyWXD-MQ8=.37907346-c252-4daf-b7bb-9d0f89291753@github.com> Message-ID: On Fri, 31 Oct 2025 15:29:05 GMT, Xiaolong Peng wrote: >> src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp line 901: >> >>> 899: } >>> 900: >>> 901: bool allow_new_region = can_allocate_in_new_region(req); >> >> Are we losing the check here? Before this change, the region had to be `FREE` _and_ the generation affiliated with the request had to have `free_unaffiliated_regions`. > > I was confused about this part, if we can find a FREE region in the partition, why we still need to test if the generation must have free_unaffiliated_regions, I can add can_allocate_in_new_region back to retain the original behavior. The young and old collector reserves both have `FREE` regions, but we need to make sure we don't exceed the reserves for one or the other. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28036#discussion_r2482658205 From xpeng at openjdk.org Fri Oct 31 21:03:22 2025 From: xpeng at openjdk.org (Xiaolong Peng) Date: Fri, 31 Oct 2025 21:03:22 GMT Subject: RFR: 8370850: Shenandoah: Simplify collector allocation to save unnecessary region iteration [v2] In-Reply-To: References: <7KjxoZ7UQ9LugnCVgBT6moBrQEfxmPNBXrvyWXD-MQ8=.37907346-c252-4daf-b7bb-9d0f89291753@github.com> Message-ID: On Fri, 31 Oct 2025 20:54:47 GMT, William Kemper wrote: >> I was confused about this part, if we can find a FREE region in the partition, why we still need to test if the generation must have free_unaffiliated_regions, I can add can_allocate_in_new_region back to retain the original behavior. > > The young and old collector reserves both have `FREE` regions, but we need to make sure we don't exceed the reserves for one or the other. I have added the can_allocate_in_new_region check back, it should have same behavior now. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/28036#discussion_r2482669646 From kdnilsen at openjdk.org Fri Oct 31 21:05:22 2025 From: kdnilsen at openjdk.org (Kelvin Nilsen) Date: Fri, 31 Oct 2025 21:05:22 GMT Subject: Integrated: 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet In-Reply-To: References: Message-ID: On Wed, 20 Aug 2025 19:17:48 GMT, Kelvin Nilsen wrote: > This PR eliminates redundant bookkeeping that had been carried out by both ShenandoahGeneration and ShenandoahFreeSet. In the new code, we keep a single tally of relevant information within ShenandoahFreeSet. > Queries serviced by ShenandoahGeneration are now delegated to ShenandoahFreeSet. > > This change eliminates rare and troublesome assertion failures that were often raised when the ShenandoahFreeSet tallies did not match the ShenandoahGeneration tallies. These assertion failures resulted because the two sets of books are updated at different times, using different synchronization mechanisms. > > The other benefit of this change is that we have less synchronization overhead because we only have to maintain a single set of books. This pull request has now been integrated. Changeset: ec059c0e Author: Kelvin Nilsen URL: https://git.openjdk.org/jdk/commit/ec059c0e85bc612f430269d9e110dc7ecbdce342 Stats: 3516 lines in 43 files changed: 2110 ins; 1006 del; 400 mod 8365880: Shenandoah: Unify memory usage accounting in ShenandoahFreeSet Reviewed-by: wkemper ------------- PR: https://git.openjdk.org/jdk/pull/26867 From xpeng at openjdk.org Fri Oct 31 22:09:18 2025 From: xpeng at openjdk.org (Xiaolong Peng) Date: Fri, 31 Oct 2025 22:09:18 GMT Subject: RFR: 8370850: Shenandoah: Simplify collector allocation to save unnecessary region iteration [v3] In-Reply-To: References: Message-ID: > To allocate an object in Collector/OldCollector partition, current implementation may traverse the regions in the partition twice: > 1. fast path: traverse regions between left most and right most in the partition, and try to allocate in an affiliated region in the partition; > 2. if fails in fast path, traverse regions between left most empty and right most empty in the partition, and try try to allocate in a FREE region. > > 2 can be saved if we also remember the first FREE region seem in 1. > > The PR makes the code much cleaner, and more efficient(although the performance impact may not be measurable, I have run some dacapo benchmarks and didn't see meaningful difference) > > > Test: > - [x] hotspot_gc_shenandoah Xiaolong Peng has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: - Remove can_allocate_in_new_region - Merge remote-tracking branch 'origin/master' into collector-allocation - Remove condition check for trash region - Address the PR review comments - Merge branch 'openjdk:master' into collector-allocation - Touch up - Remove test 'req.is_old()' when steal an empty region from the mutator view - Update comment - Fix wrong condition when steal an empty region from the mutator view - Fix potential failure in young evac - ... and 3 more: https://git.openjdk.org/jdk/compare/ec059c0e...8e01d691 ------------- Changes: https://git.openjdk.org/jdk/pull/28036/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28036&range=02 Stats: 77 lines in 2 files changed: 18 ins; 45 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/28036.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/28036/head:pull/28036 PR: https://git.openjdk.org/jdk/pull/28036