RFR: 8305753: Allow JIT compilation for -Xshare:dump
Ioi Lam
iklam at openjdk.org
Wed Oct 18 21:54:49 UTC 2023
On Wed, 18 Oct 2023 19:54:32 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
>> This RFE makes it possible for the user to enable the JIT compiler during the CDS dump by specifying `-Xshare:dump -Xmixed`
>>
>> By default, `-Xshare:dump` runs with `-Xint`. This maintains the previous behavior.
>>
>> Which mode to use?
>>
>> - Dumping in `-Xint` mode is faster when the classlist is small. `-Xint` is also required for deterministic dumping (compiler threads can change the order of the archived object).
>>
>> - However, dumping in `-Xmixed` mode is faster when the class list is larger. We also need to run the compiler in Leyden so that we can generate the CDS archive and AOT code at the same time.
>>
>>
>> Tested with tiers 1-4 and builds-tier5.
>
> src/hotspot/share/runtime/arguments.cpp line 3048:
>
>> 3046: // -Xcomp may use excessive CPU for the test tiers. Also, -Xshare:dump runs a small and fixed set of
>> 3047: // Java code, so there's not much benefit in running -Xcomp.
>> 3048: log_info(cds)("reduced -Xcomp to -Xmixed");
>
> Is it preferable to reduce the user-selected option over throwing an error for incompatible options?
We have many test jobs that add `-Xcomp` to every test case, so throwing an error will cause these tests to fail.
If we don't reduce the strength to `-Xmixed`, then many of these tests will fail due to timeout, forcing us to change the timeout value in these tests.
So I think changing to `-Xmixed` is a good compromise to do some testing with the JIT during `-Xshare:dump` without being intrusive.
> src/hotspot/share/runtime/arguments.cpp line 3049:
>
>> 3047: // Java code, so there's not much benefit in running -Xcomp.
>> 3048: log_info(cds)("reduced -Xcomp to -Xmixed");
>> 3049: set_mode_flags(_mixed);
>
> Missing an else if case for `_mode==_mixed` ?
That's intentional: if the user has explicitly chosen -Xint or -Xmixed, we don't override that.
> test/hotspot/jtreg/runtime/cds/DeterministicDump.java line 82:
>
>> 80: String mapName = logName + ".map";
>> 81: CDSOptions opts = (new CDSOptions())
>> 82: .addPrefix("-Xint") // Override any -Xmixed/-Xcomp flags from jtreg -vmoptions
>
> I assume this issue could pop up in newer tests as well. Is there a place where you can specify that `-Xint` needs to be explicitly added when doing a static dump?
-Xint is necessary only when we want to test for deterministic dumps. We don't have many such test cases.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16233#discussion_r1364576065
PR Review Comment: https://git.openjdk.org/jdk/pull/16233#discussion_r1364577865
PR Review Comment: https://git.openjdk.org/jdk/pull/16233#discussion_r1364576956
More information about the hotspot-runtime-dev
mailing list