RFR: 8355296: [leyden] Some methods are stuck at level=0 with -XX:-TieredCompilation
Aleksey Shipilev
shade at openjdk.org
Tue Apr 22 18:20:10 UTC 2025
Discovered this originally when testing Persistent Profiles PR in Leyden. In short, the transition from level=0 would not go to level=4 ever for some methods, if we disable intermediate levels. I believe this is one the causes for at least some performance artifacts I seen in Leyden testing last week.
There are two bugs:
1. In `CompilationPolicy::common`: Trivial/native method shortcut was lost, so trivial methods enter through the normal profiled policy (without a good reason?)
2. In `CompilationPolicy::should_create_mdo`: When training data is used we _only_ create MDOs for methods that are referenced in TD. This has a major knock-on effect on _normal_ JIT compilations that want to see MDO invocation/backedge counters. Instead, MDO is missing, so interpreter only increments MCS counters, and then compilation policy misses the transitions.
(1) is really subsumed by (2), so we can really only do (2).
See reproducers and logs in the issue. More performance data in comments.
Additional testing:
- [x] Linux x86_64 server fastdebug, `runtime/cds`
-------------
Commit messages:
- Fix
Changes: https://git.openjdk.org/leyden/pull/57/files
Webrev: https://webrevs.openjdk.org/?repo=leyden&pr=57&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8355296
Stats: 32 lines in 1 file changed: 10 ins; 14 del; 8 mod
Patch: https://git.openjdk.org/leyden/pull/57.diff
Fetch: git fetch https://git.openjdk.org/leyden.git pull/57/head:pull/57
PR: https://git.openjdk.org/leyden/pull/57
More information about the leyden-dev
mailing list