RFR: Restrict generational mode to adaptive heuristic
William Kemper
wkemper at openjdk.org
Mon Mar 27 16:46:50 UTC 2023
On Mon, 27 Mar 2023 09:52:50 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> This is a small change to Shenandoah, but it prevents us from running the tests with the generational mode enabled via a jtreg vm option. This requires us to properly integrate the generational mode with the jtreg tests. There are many test files changed, but the `generational` mode is now handled in the same fashion as other modes (`iu`, `passive`). There are two additional advantages to these changes:
>> * We no longer need to run the test suite twice (once in the default mode and again with `-XX:ShenandoahGCMode=generational`).
>> * Expanded test coverage, as some tests would spawn their own VMs with permutations of mode and heuristic options that ignored the generational mode.
>
> test/hotspot/jtreg/gc/shenandoah/TestRetainObjects.java line 107:
>
>> 105: * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
>> 106: * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive -XX:ShenandoahGCMode=generational
>> 107: * -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify
>
> I think the intent here is to run without `-XX:+ShenandoahVerify`.
This configuration runs with `ShenandoahAllocFailureALot`, the preceeding configuration runs with `ShenandoahOOMDuringEvacALot`. I enabled verification for both to make the tests more rigorous. Verification may find errors in card marking that wouldn't necessarily fail the test otherwise.
> test/hotspot/jtreg/gc/shenandoah/TestSieveObjects.java line 107:
>
>> 105: * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
>> 106: * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive -XX:ShenandoahGCMode=generational
>> 107: * -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify
>
> Excessive `-XX:+ShenandoahVerify`?
Same rationale for `TestRetainObjects` - are you concerned about the runtime length of the tests?
> test/hotspot/jtreg/gc/shenandoah/compiler/BarrierInInfiniteLoop.java line 35:
>
>> 33: */
>> 34:
>> 35: /**
>
> This looks like a compiler regression test, so we don't need to run it in all these different GC modes.
I added the generational mode to these tests because we've added a "post-write" barrier for card marking and it touches many of the same files. Figured it's better to error on the side of caution.
> test/hotspot/jtreg/gc/shenandoah/generational/TestCLIModeGenerational.java line 34:
>
>> 32: * @library /testlibrary /test/lib /
>> 33: * @build jdk.test.whitebox.WhiteBox
>> 34: * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
>
> Generally, these changes should be done separately, not to clobber the actual "generational"-related test change. It is fine to do them here, if these only touch the files than exist only in GenShen.
Right - these files were added to the generational branch, so they were not updated when we merged the WhiteBox renaming changes.
> test/hotspot/jtreg/gc/shenandoah/oom/TestAllocOutOfMemory.java line 35:
>
>> 33: /**
>> 34: * @test id=heap
>> 35: * @summary Test allocation of small object to result OOM, but not to crash JVM
>
> The `@summary` in these configs are all the same, copy-paste error.
> Also, we might want to fix English here a bit:
> `Test allocation of (small|large|larger-than-heap) object should result in OOM, not in JVM crash`.
Yep, good catch. Thanks.
-------------
PR Review Comment: https://git.openjdk.org/shenandoah/pull/233#discussion_r1149515600
PR Review Comment: https://git.openjdk.org/shenandoah/pull/233#discussion_r1149517068
PR Review Comment: https://git.openjdk.org/shenandoah/pull/233#discussion_r1149519460
PR Review Comment: https://git.openjdk.org/shenandoah/pull/233#discussion_r1149522555
PR Review Comment: https://git.openjdk.org/shenandoah/pull/233#discussion_r1149523271
More information about the shenandoah-dev
mailing list