RFR: 8349915: CTW: Lots of level 3 compiles are done at level 2 after JDK-8348570 [v2]
Aleksey Shipilev
shade at openjdk.org
Fri Feb 14 14:51:11 UTC 2025
On Wed, 12 Feb 2025 19:50:51 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> Noticed this in manual CTW runs after [JDK-8348570](https://bugs.openjdk.org/browse/JDK-8348570) that lots and lots of methods are compiled at level 2 instead of requested level 3:
>>
>>
>> ...
>> [97] javax.enterprise.deploy.shared.ActionType::getValue() WARNING compilation level = 2, but not 3
>> [97] javax.enterprise.deploy.shared.ActionType::getOffset() WARNING compilation level = 2, but not 3
>> [97] javax.enterprise.deploy.shared.ActionType::getEnumValueTable() WARNING compilation level = 2, but not 3
>> [97] javax.enterprise.deploy.shared.ActionType::getStringTable() WARNING compilation level = 2, but not 3
>> [97] javax.enterprise.deploy.shared.ActionType::getActionType(int) WARNING compilation level = 2, but not 3
>> [97] javax.enterprise.deploy.shared.ActionType::toString() WARNING compilation level = 2, but not 3
>> [99] javax.enterprise.deploy.shared.DConfigBeanVersionType
>> [98] javax.enterprise.deploy.shared.CommandType::toString() WARNING compilation level = 2, but not 3
>> [98] javax.enterprise.deploy.shared.CommandType::getOffset() WARNING compilation level = 2, but not 3
>> ...
>>
>>
>> I narrowed it down to level downgrade in compilation policy here:
>> https://github.com/openjdk/jdk/blob/ed17c55ea34b3b6009dab11d64f21e0b7af3d701/src/hotspot/share/compiler/compilationPolicy.cpp#L677
>>
>> [JDK-8348570](https://bugs.openjdk.org/browse/JDK-8348570) enters here, because we mark all methods as having profiles to extend the CTW scope. So now `is_method_profiled(max_method_h)` is `true` and downgrade happens. There is already check for `!Arguments::is_compiler_only()` there, so I think we better exclude CTW from this downgrade as well.
>>
>> I looked at possibly making this kind of downgrade fatal in CTW runner, but the error propagation there is not simple. I filed [JDK-8349917](https://bugs.openjdk.org/browse/JDK-8349917) if anyone want to take a stab on it.
>>
>> I looked at other `set_comp_level()` uses in Hotspot, and this is the only place where it is called. So I presume we have caught all places where this downgrade can happen.
>>
>> Additional testing:
>> - [x] Linux x86_64 server fastdebug, eyeballing some manual CTW run results
>> - [x] Linux x86_64 server fastdebug, `applications/ctw/modules` passes
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>
> Shortcut CTW tasks directly
@eme64, @chhagedorn -- could you take a look as well? There is a recent hole in CTW testing that I want to plug before weekend runs start :)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23589#issuecomment-2659524425
More information about the hotspot-compiler-dev
mailing list