RFR: 8371381: [Shenandoah] Setting ergo flags should use FLAG_SET_ERGO [v3]

Rui Li duke at openjdk.org
Wed Nov 12 23:08:08 UTC 2025


On Wed, 12 Nov 2025 19:33:12 GMT, Rui Li <duke at openjdk.org> wrote:

>> Setting ergo flags using `FLAG_SET_ERGO`, instead of `FLAG_SET_DEFAULT`, so we can have the right origin info.
>> 
>> 
>> For `ShenandoahEvacReserve` change: when we use shenandoah passive mode and degen is also turned off (`-XX:ShenandoahGCMode=passive -XX:-ShenandoahDegeneratedGC`), we set the ShenandoahEvacReserve to 0:  https://github.com/openjdk/jdk/blob/c6a8027b94bbcbde5f7dcabd0bff48b93bbb5a7f/src/hotspot/share/gc/shenandoah/mode/shenandoahPassiveMode.cpp#L40-L42
>> 
>> `FLAG_SET_DEFAULT` doesn't check the range but `FLAG_SET_ERGO` does so some of the jtreg would fail because of this change. Had to move this ergo setting to regular `FLAG_SET_DEFAULT`.
>> 
>> Testing: jtreg gc. GHA pending.
>
> Rui Li has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Move ShenandoahEvacReserve back to (1,100)

GHA test `test/jdk/java/util/Arrays/SortingNearlySortedPrimitive.java` failed, but it uses g1, should be unrelated:


 # JRE version: OpenJDK Runtime Environment (26.0) (build 26-internal-rgithubli-6200456b7130997d227dd5a128e4cefbd05059b5)
# Java VM: OpenJDK 64-Bit Server VM (26-internal-rgithubli-6200456b7130997d227dd5a128e4cefbd05059b5, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x6765ff]  frame::sender(RegisterMap*) const+0x29f


It passed on my local. Rerun on GHA and check hs_err log.

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

PR Comment: https://git.openjdk.org/jdk/pull/28242#issuecomment-3524259349


More information about the hotspot-gc-dev mailing list