Integrated: 8349915: CTW: Lots of level 3 compiles are done at level 2 after JDK-8348570
Aleksey Shipilev
shade at openjdk.org
Sat Feb 15 07:25:16 UTC 2025
On Wed, 12 Feb 2025 14:47:32 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
This pull request has now been integrated.
Changeset: 62345364
Author: Aleksey Shipilev <shade at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/623453647a8a387b2d8d375cb18b33666abc16ee
Stats: 7 lines in 2 files changed: 7 ins; 0 del; 0 mod
8349915: CTW: Lots of level 3 compiles are done at level 2 after JDK-8348570
Reviewed-by: kvn, chagedorn
-------------
PR: https://git.openjdk.org/jdk/pull/23589
More information about the hotspot-compiler-dev
mailing list