RFR: 8234822: Limit ZGC jtreg-support to Windows 2019 Server
Stefan Karlsson
stefan.karlsson at oracle.com
Wed Nov 27 14:29:32 UTC 2019
On 2019-11-26 19:13, Igor Ignatyev wrote:
> Hi Stefan,
>
> it looks reasonable to me. could you please add a TODO comment saying that the check isn't precise as it can be?
Sure.
>
> feel free to ignore this comment, but given sun.hotspot.gc.GC is a enum, I'd suggest you to override isSupported() method in Z instead of checking 'this != Z' in supportsOSVersion() so you will get smth like this:
>
>> diff -r 5bda975bc9ea test/lib/sun/hotspot/gc/GC.java
>> --- a/test/lib/sun/hotspot/gc/GC.java Mon Nov 25 17:02:08 2019 -0800
>> +++ b/test/lib/sun/hotspot/gc/GC.java Tue Nov 26 10:08:48 2019 -0800
>> @@ -37,7 +37,20 @@
>> Parallel(2),
>> G1(3),
>> Epsilon(4),
>> - Z(5),
>> + Z(5) {
>> + public boolean isSelected() {
>> + if (!WB.isGCSelected(Z.name)) {
>> + return false;
>> + }
>> +
>> + String osName = System.getProperty("os.name");
>> + if (!osName.startsWith("Windows")) {
>> + return true;
>> + }
>> + return osName.equals("Windows Server 2019");
>> + }
>> +
>> + },
>
> or you can define s.h.gc.GC:supportsOSVersion() which always returns true and override supportsOSVersion() in Z to check os.name.
>
Thanks for the suggestion. If others strongly agree that this is nicer,
I'll do it, otherwise I'll go with the somewhat smaller patch in the webrev.
Thanks,
StefanK
> Thanks,
> -- Igor
>
>
>> On Nov 26, 2019, at 9:24 AM, Stefan Karlsson <stefan.karlsson at oracle.com> wrote:
>>
>> Hi all,
>>
>> Please review this patch that makes sure we don't try to run ZGC on older Windows versions.
>>
>> https://cr.openjdk.java.net/~stefank/8234822/webrev.01/
>> https://bugs.openjdk.java.net/browse/JDK-8234822
>>
>> It causes @requires vm.gc.Z to filter out the test if run on older Windows version.
>>
>> It's a bit of a hack, since it checks against a hard-coded Windows version. It makes the implementation easy, and doesn't drag in new dependencies to sun.hotspot.gc.GC, but it's not as precise as it could be. I'd prefer to push the code in webrev.01, but if I get push-back an alternative would be to extend GCConfig and add ZGC specific checks, and add suitable code to ZGC:
>>
>> +bool GCConfig::is_gc_supported_on_os(CollectedHeap::Name name) {
>> + if (name != CollectedHeap::Z) {
>> + return true;
>> + }
>> +
>> +#if INCLUDE_ZGC
>> + if (ZInitialize::is_os_supported()) {
>> + return true;
>> + }
>> +#endif
>> +
>> + return false;
>> +}
>>
>> and call that from GCConfig::is_gc_supported.
>>
>> Thanks,
>> StefanK
>
More information about the hotspot-gc-dev
mailing list